Using SUDO to install stuff changes the owner to root and causes problems
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Using SUDO to install stuff changes the owner to root and causes problems
I have a feeling this is a REALLY stupid question.
Lets say I'm using Mint and I need to install a program via the SUDO command. I noticed that once this program installs and copies its files to say.... /home/Downloads ..... when I try to run the program as myself, it fails. Right clicking on the folder, I see the permissions belong to 'root'.....makes since because I used SUDO to install it?! If I use 'sudo chown etc' to change ownership of that folder and its sub-directories back to my account, I can run it perfectly.
Is this something I'll need to just remember to do every time I need elevated access to install something or am I not using the 'sudo' command right?
That really depends on what you install, most programs grant system-wide user permissions when installed. Mint uses apt, Synaptic is an apt GUI, but is only run as root (or sudo, I hate sudo, I use "su" whenever possible), whenever you install pretty much anything from the distro's repo, it will appear in the menu, ready for any user to use, unless it's a tiny binary that has no GUI, then it's run from the command-line (depending on the type of binary, you may have to run some non-GUI progs as root as well). You'll notice programs like Bleachbit or luckyBackup have to separate icons, one is regular user, the other is root activated, that's because they are both file-system progs that sometimes require a higher level of system access. I hope that's not too confusing. So I guess the answer to your question is yes, if you are installing special things by hand, you will have to manipulate their permissions from time to time.
Lets say I'm using Mint and I need to install a program via the SUDO command. I noticed that once this program installs and copies its files to say.... /home/Downloads ..... when I try to run the program as myself, it fails. Right clicking on the folder, I see the permissions belong to 'root'.....makes since because I used SUDO to install it?!
it seems you are confusing "downloading" with "installing".
you don't need super user privileges to download something to your /home/<username>/Downloads (i hope you didn't really use /home/Downloads???).
there are some fundamental differences in how linux managaes software installations, compared to windows.
please show us what, and how you "installed".
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
You should download to /home/user_name/Downloads and not sudo until you actually install the program with make install, or some like command. If your installing from a package manager you don't need to worry. If your using /home/Downloads, you had to be sudoed to make the directory. So, you won't be able to expand and untar source packages as a normal user in that directory. If you want to do it that way, you must chown -R user: /home/downloads, and then not use sudo to work in that 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.