RStudio keeps asking to reinstall packages

Hi everyone, I'm new to R and RStudio.

I'm trying to run a .Rmd script that requires the packages 'ggpubr' and 'lme4' in RStudio on Manjaro Linux. Something during installation is not working and even the packages that seem to be installed are asked to be installed the next time I open RStudio.
I'm using CRAN repository and installing dependencies (‘nloptr’, ‘pbkrtest’, ‘lme4’, ‘car’)

Can anyone help me?

RStudio 2022. 07. 1+554 "Spotted Wakerobin" Release (7872775ebddc40635780ca1ed238934c3345c5de, 2022-07-22) for Ubuntu Bionic
Mozilla/5. 0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5. 12. 8 Chrome/69. 0. 3497. 128 Safari/537. 36

** Installing R Packages: 'ggpubr', 'lme4'
[1/4] Installing rstatix ...
Installing package into ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘nloptr’, ‘pbkrtest’, ‘lme4’, ‘car’

trying URL 'https://cran. rstudio. com/src/contrib/nloptr_2. 0. 3. tar. gz'
Content type 'application/x-gzip' length 2219877 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran. rstudio.  com/src/contrib/pbkrtest_0 .5 .1. tar. gz'
Content type 'application/x- gzip' length 246327 bytes (240 KB)
==================================================
downloaded 240 KB

trying URL 'https://cran. rstudio. com/src/contrib/lme4_1. 1-30 .tar . gz'
Content type 'application/x- gzip' length 3307884 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

trying URL 'https://cran. rstudio. com/src/contrib/car_3. 1-1. tar. gz'
Content type 'application/x-gzip' length 578902 bytes (565 KB)
==================================================
downloaded 565 KB

trying URL 'https://cran. rstudio. com/src/contrib/rstatix_0. 7. 0. tar. gz'
Content type 'application/x-gzip' length 402481 bytes (393 KB)
==================================================
downloaded 393 KB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking for g++ -std=gnu++14 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether g++ -std=gnu++14 accepts -g... (cached) yes
checking for g++ -std=gnu++14 option to enable C++11 features... (cached) none needed
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows NLopt... no
checking for cmake... no
------------------ CMAKE NOT FOUND --------------------
CMake was not found on the PATH. Please install CMake:
 - sudo yum install cmake          (Fedora/CentOS; inside a terminal)
 - sudo apt install cmake          (Debian/Ubuntu; inside a terminal).
 - sudo pacman -S cmake            (Arch Linux; inside a terminal).
 - sudo brew install cmake         (MacOS; inside a terminal with Homebrew)
 - sudo port install cmake         (MacOS; inside a terminal with MacPorts)
Alternatively install CMake from: <https://cmake.org/>
-------------------------------------------------------
ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/lme4’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2/pbkrtest’
ERROR: dependencies ‘pbkrtest’, ‘lme4’ are not available for package ‘car’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/car’
[2/4] Installing ggpubr ...
ERROR: dependency ‘car’ is not available for package ‘rstatix’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2/rstatix’

The downloaded source packages are in
	‘/tmp/Rtmp7S8MC6/downloaded_packages’
Installing package into ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘nloptr’, ‘pbkrtest’, ‘lme4’, ‘car’, ‘rstatix’

trying URL 'https://cran. rstudio. com/src/contrib/nloptr_2. 0. 3. tar. gz'
Content type 'application/x-gzip' length 2219877 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran. rstudio. com/src/contrib/pbkrtest_0. 5. 1. tar. gz'
Content type 'application/x-gzip' length 246327 bytes (240 KB)
==================================================
downloaded 240 KB

trying URL 'https://cran. rstudio. com/src/contrib/lme4_1. 1-30. tar. gz'
Content type 'application/x-gzip' length 3307884 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

trying URL 'https://cran. rstudio. com/src/contrib/car_3. 1-1. tar. gz'
Content type 'application/x-gzip' length 578902 bytes (565 KB)
==================================================
downloaded 565 KB

trying URL 'https://cran. rstudio. com/src/contrib/rstatix_0. 7. 0. tar. gz'
Content type 'application/x-gzip' length 402481 bytes (393 KB)
==================================================
downloaded 393 KB

trying URL 'https://cran. rstudio. com/src/contrib/ggpubr_0. 4. 0. tar. gz'
Content type 'application/x-gzip' length 2689307 bytes (2.6 MB)
==================================================
downloaded 2.6 MB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking for g++ -std=gnu++14 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether g++ -std=gnu++14 accepts -g... (cached) yes
checking for g++ -std=gnu++14 option to enable C++11 features... (cached) none needed
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows NLopt... no
checking for cmake... no
------------------ CMAKE NOT FOUND --------------------
CMake was not found on the PATH. Please install CMake:
 - sudo yum install cmake          (Fedora/CentOS; inside a terminal)
 - sudo apt install cmake          (Debian/Ubuntu; inside a terminal).
 - sudo pacman -S cmake            (Arch Linux; inside a terminal).
 - sudo brew install cmake         (MacOS; inside a terminal with Homebrew)
 - sudo port install cmake         (MacOS; inside a terminal with MacPorts)
Alternatively install CMake from: <https://cmake.org/>
-------------------------------------------------------
ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/lme4’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/pbkrtest’
ERROR: dependencies ‘pbkrtest’, ‘lme4’ are not available for package ‘car’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/car’
ERROR: dependency ‘car’ is not available for package ‘rstatix’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/rstatix’
[3/4] Installing nloptr...
ERROR: dependency ‘rstatix’ is not available for package ‘ggpubr’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2/ggpubr’

The downloaded source packages are in
	‘/tmp/Rtmp7S8MC6/downloaded_packages’
Installing package into ‘/home/nico/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran. rstudio. com/src/contrib/nloptr_2. 0. 3. tar. gz'
Content type 'application/x-gzip' length 2219877 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking for g++ -std=gnu++14 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether g++ -std=gnu++14 accepts -g... (cached) yes
checking for g++ -std=gnu++14 option to enable C++11 features... (cached) none needed
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows NLopt... no
checking for cmake... no
------------------ CMAKE NOT FOUND --------------------
CMake was not found on the PATH. Please install CMake:
 - sudo yum install cmake          (Fedora/CentOS; inside a terminal)
 - sudo apt install cmake          (Debian/Ubuntu; inside a terminal).
 - sudo pacman -S cmake            (Arch Linux; inside a terminal).
 - sudo brew install cmake         (MacOS; inside a terminal with Homebrew)
 - sudo port install cmake         (MacOS; inside a terminal with MacPorts)
Alternatively install CMake from: <https://cmake. org/>
-------------------------------------------------------
[4/4] Installing lme4...
ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2/nloptr’

The downloaded source packages are in
	‘/tmp/Rtmp7S8MC6/downloaded_packages’
Installing package into ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2’
(as ‘lib’ is unspecified)
also installing the dependency ‘nloptr’

trying URL 'https://cran. rstudio. com/src/contrib/nloptr_2. 0. 3. tar. gz'
Content type 'application/x-gzip' length 2219877 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran. rstudio. com/src/contrib/lme4_1. 1-30. tar. gz'
Content type 'application/x-gzip' length 3307884 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking for g++ -std=gnu++14 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether g++ -std=gnu++14 accepts -g... (cached) yes
checking for g++ -std=gnu++14 option to enable C++11 features... (cached) none needed
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows NLopt... no
checking for cmake... no
------------------ CMAKE NOT FOUND --------------------
CMake was not found on the PATH. Please install CMake:
 - sudo yum install cmake          (Fedora/CentOS; inside a terminal)
 - sudo apt install cmake          (Debian/Ubuntu; inside a terminal).
 - sudo pacman -S cmake            (Arch Linux; inside a terminal).
 - sudo brew install cmake         (MacOS; inside a terminal with Homebrew)
 - sudo port install cmake         (MacOS; inside a terminal with MacPorts)
Alternatively install CMake from: <https://cmake.org/>
-------------------------------------------------------
ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/home/nico/R/x86_64-pc-linux-gnu-library/4. 2/lme4’

The downloaded source packages are in
	‘/tmp/Rtmp7S8MC6/downloaded_packages’


✔ Packages successfully installed.
There were 14 warnings (use warnings() to see them)

Installation is failing but the error message is already telling you what to try, run that command in a system terminal to install the missing cmake library and then try to install the R package again.

Manjaro doesn't have "apt"

Well, then use whatever package manager you have available on Manjaro (pacman maybe?) to install cmake, the thing is you need this system library in other to compile R packages on Linux.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.