Understanding rpm and yum
I am trying to better understand how applications are installed. Let's say I run the following two lines.
The first line upgrades (or installs if not existing) either a file on my hard drive or a file on the internet, and displays verbose information and hash marks. Where does it get installed? Is it just one application/file? What is being installed? The next line then installs php54. Is yum looking at all my repositories, and looking for php54? Before it does so, how can I tell what is being installed? I am not sure that I even asked the right questions, and appreciate any clarification. Thanks! Code:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm Quote:
Quote:
|
A pkg can contain many files, which (should) be installed according to https://en.wikipedia.org/wiki/Filesy...archy_Standard.
rpm is really a pkg format, but you can also do operations with the rpm cmd. However, the rpm cmd does not handle dependencies, whereas the yum cmd does operations with rpm files, but DOES handle dependencies automatically, so normally you'd use this, not rpm cmd. What actually gets installed by any pkg is defined within the pkg and is unique to that pkg. There is some good info in the man pages, as you seem to have found, but there are also lots of HOWTOs on the web. Feel free to ask some more if you need to. HTH |
Generally speaking you can think of .rpm, .yum, .dpkg files etc as .exes for Linux. Yes, I know the comparison is not perfect.
Where things install varies, you can figure out where by using the whereis command after installing. So, your example: Code:
whereis php54 |
I don't know what that latest.rpm is, but seeing as you are asking about this sort fo thing... have a look. run:
wget http://mirror.webtatic.com/yum/el6/latest.rpm rpm -qlf latest.rpm actually, I presume "rpm -qlf http://mirror.webtatic.com/yum/el6/latest.rpm" would also work and you'll be able to see what files are in it. One thing that is odd is that you'd really NEVER see a file called "latest"... what is it??? I presume it's some repo files or something... so how you're messing with that file now is not very typical, as it's surely not going to install a package called "latest" whereas "php54" is the package (NOT the file) you're after, so that's more normal. How can you tell what's being installed? it'll tell you at the time. Note that until you ask to install it, it's not going to check what is needed on your specific system in terms of dependencies. |
Thank you all! I am still trying to digest the information. In the mean time, what am I missing? Thanks
Code:
[root@vps /]# rpm -qlf http://mirror.webtatic.com/yum/el6/latest.rpm |
Code:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm Code:
yum install php54w |
Hi ,
I too had difficulties understanding yum and rpm when getting started. I will attempt to reply to your individual questions. For starters, forgive me if this is redundant to you. rpm is a package management tool that installs, queries, removes, updates, and performs integrity checks (among other things) with *.rpm packages. yum is a tool used to download and install rpm packages, along with any packages the new package may be dependent on. With that being said, I will now address your questions. 1---------------------------------------------------------------- You said 'Where does it get installed? Depending on the package, it may go in several locations. For instance, the most typical location will be under '/usr/bin/'. This is where executable files are commonly installed. Still, there may be what is called a 'modular' package, which is a package that contains many (more than one) associated file. Such files may be an executable (located in /usr/bin/) and a configuration file (located in /etc/). To solve the seemingly ridiculous riddle of 'where are the installation files', you can run the below rpm command: rpm -qc [package name] (e.g. rpm -qc php54w) The '-q' option enables a query, while the '-c' option enables a listing of all configuration files associated with the package name; this will also list the locations of those files. 2------------------------------------------------------------------- You said 'Is it just one application/file? When installing a package via rpm, it may be one file or multiple files. Its important to note that an rpm 'package' may be a combination of several files that work together to make a complete application. So, to answer this question, you may run the above-mentioned command, rpm -qc [package name] to list all associated configuration files for the package. If there are no files listed, the application is likely a standalone file. But chances are it contains at least one other files. 3------------------------------------------------------------------- You said 'What is being installed?' To find what's actually being installed on an rpm package, you can run the below command: rpm -ql [package name] (e.g. rpm -ql systemd) The -q option (of course) enables a query, while the -l option enables a listing of all associated files. One more thing... when installing packages via yum, yum actually downloads and installs all packages the new package is dependent on; this is important for the above question of what's being installed. If yum is executed without any additional options (e.g. yum install [package]), it will report that it is downloading dependencies, and will even give a [y/n] prompt for approval before installed the additional packages. This too will help in understanding what's being installed. I hope this info is helpful for both this post, as well as other rpm/yum usage for you. |
Thank you mddesai, When I first used rpm to install the first application, did it ONLY install the following in the /etc/yum.repos.d/ directory? They yum looks at all my repos and tries to use one of them to install a given package?
Code:
[webtatic] |
Thank you kepson77! Very informative. I understand much of what you have said, but will need to go through it in more detail.
|
Quote:
Code:
# rpm -qpl http://mirror.webtatic.com/yum/el6/latest.rpm Code:
# yum --disablerepo="*" --enablerepo="webtatic" list available |
Quote:
For example, For packages that are already installed: Code:
# rpm -qa | grep beesu Code:
# rpm -qpl http://repo.webtatic.com/yum/el6/x86_64/php54w-5.4.16-1.w6.x86_64.rpm You can also use -i option to get more information Code:
# rpm -qpi http://repo.webtatic.com/yum/el6/x86_64/php54w-5.4.16-1.w6.x86_64.rpm |
If you're going to add extra repos you MUST install yum-priorities and set it up to prevent clashes
http://wiki.centos.org/PackageManagement/Yum/Priorities. Otherwise, sooner or later, you'll break something (most likely sooner), and that includes the OS. |
All times are GMT -5. The time now is 11:47 PM. |