LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   a bunch of linux newbie questions (https://www.linuxquestions.org/questions/linux-newbie-8/a-bunch-of-linux-newbie-questions-4175422930/)

narin1975 08-19-2012 08:20 PM

a bunch of linux newbie questions
 
Hi

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?


Thanks,
Narin

frankbell 08-19-2012 08:45 PM

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.

Here's a good intro to the Linux file system: http://www.cyberciti.biz/tips/unders...em-part-i.html

narin1975 08-19-2012 09:00 PM

thanks a lot!

DavidMcCann 08-20-2012 12:37 PM

You may have read it, but if you haven't
http://wiki.centos.org/AdditionalRes...epositories%29
tells you about getting extra software from other repositories; CentOS just has the stuff on the 2 installation DVDs. If you do use other repos, follow their advice on using prorities:
http://wiki.centos.org/PackageManagement/Yum/Priorities
Set CentOS with priority=1, EPEL with priority=2, and any others with 3, 4, etc.

chrism01 08-20-2012 08:44 PM

Qn2. addendum answer: if you are installing via the repos, it will take care of ownerships & perms for you.

David the H. 08-21-2012 02:57 PM

A few points to add to frankbell's post.


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.


All times are GMT -5. The time now is 10:15 AM.