1

I was trying to build one project with cmake but turned out that root doesn't have it (admin user had it). After installing it on root they have now different versions. I thought that root has only more access privileges than normal user and they have same files. Why is so?

admin@raspberrypi:/home/pi/profinet/p-net $ cmake --version
cmake version 3.26.0

admin@raspberrypi:/home/pi/profinet/p-net $ sudo su
root@raspberrypi:/home/pi/profinet/p-net# cmake --version
cmake version 3.18.4
4
  • 1
    This is not a raspberry pi specific question, the answer will be the same for any Linux system. Nevertheless, this comes from differences in the PATH for different users. Probably local installation of cmake is referenced in the admin user PATH higher than a global or any other installation used by the root. Typing which cmake may give you some more details
    – Vadim
    Commented Mar 16, 2023 at 8:47
  • How did you install your special version (V3.26.0) of cmake?
    – Dougie
    Commented Mar 16, 2023 at 11:06
  • 1
    I think you mean you installed a new version and don't understand why root is still using the old one; which cmake (try it as user then root) will probably shed some light on that.
    – goldilocks
    Commented Mar 16, 2023 at 13:11
  • 1
    admin@raspberrypi:~ $ which cmake /usr/bin/cmake admin@raspberrypi:~ $ sudo su root@raspberrypi:/home/admin# which cmake /usr/bin/cmake root@raspberrypi:/home/admin# cmake --version cmake version 3.18.4 root@raspberrypi:/home/admin# exit exit admin@raspberrypi:~ $ cmake --version cmake version 3.18.4 Pretty strange now they look the same :( Commented Mar 16, 2023 at 16:16

0

Browse other questions tagged or ask your own question.