Installing lammps on Linux with packages

Dear lammps users, I wanna install LAMMPS (stable release 2022) on Linux and install some packages like GPU and KSPACE. I have tried two different approaches.
In the traditional method, I ran these lines in terminal
make yes-GPU
I installed the packages that I wanted.
then I run, make mpi, but I get this error:
(base) system1@System1:~/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src$ make mpi
Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/system1/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src’
make[1]: ‘lmpinstalledpkgs.h’ is up to date.
Gathering git version information
make[1]: Leaving directory ‘/home/system1/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src’
Compiling LAMMPS for machine mpi
make[1]: Entering directory ‘/home/system1/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src/Obj_mpi’
Makefile.package.settings:5: …/…/lib/electrode/Makefile.lammps: No such file or directory
Makefile.package.settings:6: …/…/lib/atc/Makefile.lammps: No such file or directory
Makefile.package.settings:9: …/…/lib/qmmm/Makefile.lammps: No such file or directory
Makefile.package.settings:11: …/…/lib/poems/Makefile.lammps: No such file or directory
Makefile.package.settings:12: …/…/lib/plumed/Makefile.lammps: No such file or directory
Makefile.package.settings:15: …/…/lib/mscg/Makefile.lammps: No such file or directory
/bin/sh: 1: Syntax error: “(” unexpected
…/…/lib/quip/Makefile.lammps:17: *** Environment or make variable QUIP_ROOT must be set… Stop.
make[1]: Leaving directory ‘/home/system1/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src/Obj_mpi’
make[1]: Entering directory ‘/home/system1/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src/Obj_mpi’
Makefile.package.settings:5: …/…/lib/electrode/Makefile.lammps: No such file or directory
Makefile.package.settings:6: …/…/lib/atc/Makefile.lammps: No such file or directory
Makefile.package.settings:9: …/…/lib/qmmm/Makefile.lammps: No such file or directory
Makefile.package.settings:11: …/…/lib/poems/Makefile.lammps: No such file or directory
Makefile.package.settings:12: …/…/lib/plumed/Makefile.lammps: No such file or directory
Makefile.package.settings:15: …/…/lib/mscg/Makefile.lammps: No such file or directory
/bin/sh: 1: Syntax error: “(” unexpected
…/…/lib/quip/Makefile.lammps:17: *** Environment or make variable QUIP_ROOT must be set… Stop.
make[1]: Leaving directory ‘/home/system1/Downloads/lmp 2022/lammps-stable(1)/lammps-23Jun2022/src/Obj_mpi’
Makefile:376: recipe for target ‘mpi’ failed.

when I try to install lammps with CMAKE, I get error too.
I wrote cmake-gui …/cmake
in the window, I selected the packages but in the log file I can see that a package can not be downloaded (the link that can not be downloaded is Downloading https://download.lammps.org/thirdparty/opencl-loader-2022.01.04.tar.gz)
error in configuration process, project files may be invalid

when I type cmake …/cmake
– The CXX compiler identification is GNU 7.5.0
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Running check for auto-generated files from make-based build system
– Found OpenMP_CXX: -fopenmp
– Found OpenMP: TRUE found components: CXX
– Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so
– Could NOT find FFMPEG (missing: FFMPEG_EXECUTABLE)
– Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found version “3.6.9”)
– Setting default Kokkos CXX standard to 14
CMake Error at /home/system1/Downloads/lmp2022/lammps-stable(1)/lammps-23Jun2022/lib/kokkos/CMakeLists.txt:75 (cmake_minimum_required):
CMake 3.16 or higher is required. You are running version 3.10.2
– Configuring incomplete, errors occurred!
See also “/home/system1/Downloads/lmp2022/lammps-stable(1)/lammps-23Jun2022/build/CMakeFiles/CMakeOutput.log”.
See also “/home/system1/Downloads/lmp2022/lammps-stable(1)/lammps-23Jun2022/build/CMakeFiles/CMakeError.log”.

I appreciate your help in advance

The error suggests that you did “make yes-all” at some point and not undone it “make no-all”.
Also, it can be a problem, that you are in a folder where the path name contains parenthesis (‘lammps(1)’) this may confuse some of the scripts.

At any rate, the error indicates that you have installed packages that require extra steps that need to be done first in the lib folder or with “make lib-xxx” (where xxx is the name of the folder). Details about this are in the LAMMPS documentation. You need to read it more carefully.

This error steps from the KOKKOS package and is self explanatory.