Cannot access software installed in /opt/ directory...why?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Cannot access software installed in /opt/ directory...why?
I was trying to install QtSDK in /opt/ directory by logging in as a normal user then launching the installer through terminal as root...but since the installer is a GUI installer so it game me an error: Problem elevating the user privilege...or some thing...
So, I then finally logged in as root (GUI) and launched the installer through GUI an installed it in /opt/QtSDK directory...and was able to launch in as root.
but by logging as normal user...I cannot launch the program...it gives me an error:Failed to change to directory '/root' (Permission denied)
i tried chmod 777 /opt/QtSDK and also chmod 777 /opt/ as root but still doesn't work...
You must have read/write access to the location where you intend to install the software, and that location must be listed in your $PATH.
In most systems, the /usr/local directory is set aside for software that you have installed "locally," and it is good practice to create a non-rootly "maintenance user" that has read/write access to that location expressly for the purpose of doing local software installation and maintenance.
For a variety of reasons that we need not go into here, it's a good idea to use this "well-known location" for this purpose, if you are given a choice in the matter.
Some installer-packages allow you to designate where the software is to be installed; others do not. Therefore, some installer packages pragmatically must be run as root.
You must have read/write access to the location where you intend to install the software, and that location must be listed in your $PATH.
In most systems, the /usr/local directory is set aside for software that you have installed "locally," and it is good practice to create a non-rootly "maintenance user" that has read/write access to that location expressly for the purpose of doing local software installation and maintenance.
For a variety of reasons that we need not go into here, it's a good idea to use this "well-known location" for this purpose, if you are given a choice in the matter.
Some installer-packages allow you to designate where the software is to be installed; others do not. Therefore, some installer packages pragmatically must be run as root.
Ok I did this
chmod 777 /opt/QtSDK/, as root to allow read write and execute permission for all users
and
PATH=$PATH:/opt/QtSDK/, to add the location to my PATH
export PATH
I did chmod -R 777 /QtSDK as root to allow rwx permission for all users
but still same error.
I was able to launch SDK Updater (even before) and when I click update it downloads all the files and asks for root password,
but when I enter the password it fails again with the same error after long pause.
You really shouldn't just go around doing "chmod 777" on stuff. You are allowing anybody who gets access to the machine to make any changes they want there. A malicious user can cause you a lot of trouble.
This error looks like the problem: Failed to change to directory '/root' (Permission denied).
The user you are running as can't change to the directory /root, because that directory is normally only readable by the root user. I am certainly not suggesting that you change the permissions on the /root directory.
You need to somehow figure out why it is trying to change directory to /root. Maybe it's because you installed the software as root, and it thinks that /root must be your home directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.