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.
I am learning to use linux (CentOS). I have a few questions which I could not quite find the answers from books.
1. Which directory in the file system does rpm actually store all available packages? And if I have a software to install, should I store its .rpm file on that directory or it could be placed anywhere.
2. Is it true that we should not install any non-system admin related software as root? If so, how do we ensure the software will have all necessary permission to access any files it needs to?
3. What is the primary purpose of /var? What should be kept in here in general?
I'll take a quick shot based on my limited understanding as an intermediate home user.
Quote:
1. Which directory in the file system does rpm actually store all available packages? And if I have a software to install, should I store its .rpm file on that directory or it could be placed anywhere.
Package managers such as RPM do not normally store available packages. They store links to repositories on the web where the packages reside. Most users do not store the source package; they install the package and move on. This can vary in enterprise environments, in which local repositories may be desirable.
Quote:
2. Is it true that we should not install any non-system admin related software as root? If so, how do we ensure the software will have all necessary permission to access any files it needs to?
Software that is supposed to be available to all users of the computer should be installed as root. Otherwise, it is available only to the user who installed it.
Quote:
3. What is the primary purpose of /var? What should be kept in here in general?
As regards /var, var is short for "variable." It is a location for log files, mail files, and other files that tend to change with usage. Generally, users do not put anything there; the system does that. In enterprise webserver environments, the Apache htdocs (website) files are sometimes stored in /var.
Your package manager likely does have a directory for the temporary caching of rpm packages it downloads and installs for you (probably somewhere in /var), but there's generally no reason for you to be messing with it, other than perhaps to empty it if your disk runs out of space.
Various projects sometimes offer downloadable rpm's that you can install manually too. Most of the time you should first check to see if your distribution offers the program first, and only go for the manual installation if you find nothing, or you have some other specific reason for not using the distro's package (i.e. it only has an older version available).
Manual installation generally involves simply downloading the package (location doesn't matter) and running a specific installation command with root privileges. My system isn't rpm-based though, so you'll have to research what that command is yourself.
There are also a few projects, such as firefox, that offer binaries that are not standard rpm packages, but come packaged inside their own home-rolled installation scripts. You sometimes have a choice with these. If you run the installer as root, then it can be made available system-wide, but if you run it as another user it can be installed to a local directory (usually your home) and only be available to that user.
Yet another common option for installing software involves downloading the source code for it and compiling it yourself. You download the source package, decompress it to a working directory, and run a series of compiling commands on the files. This can all be done as non-root. Finally you can become root (for global access, or they can usually be configured to install locally as well) and run the final install command, which will put the binary files where they need to go.
One limitation of source compiling (and other non-standard packages) is that they don't generally integrate with your package manager. You have to track/update everything manually and usually keep the source/installer around if you ever want to uninstall it again. For source packages I therefore recommend running the checkinstall program in place of the regular install command. It will convert the source install into an rpm (or other package type), which can be then be installed and managed by your system regularly.
Last edited by David the H.; 08-21-2012 at 02:58 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.