LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-13-2013, 08:40 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 713

Rep: Reputation: Disabled
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
yum install php54w
rpm
Quote:
The general form of an rpm upgrade command is

rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...

This upgrades or installs the package currently installed to a newer version. This is the same as install, except all other version(s) of the package are removed after the new package is installed.

-v
Print verbose information - normally routine progress messages will be displayed.

-h, --hash
Print 50 hash marks as the package archive is unpacked. Use with -v|--verbose for a nicer display.
yum
Quote:
install
Is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied. (See Specifying package names for more information) If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed. If the name starts with an @ character the rest of the name is used as though passed to the groupinstall command. If the name starts with a - character, then a search is done within the transaction and any matches are removed. If the name is a file, then install works like localinstall. If the name doesn't match a package, then package "provides" are searched (e.g. "_sqlitecache.so()(64bit)") as are filelists (Eg. "/usr/bin/yum"). Also note that for filelists, wildcards will match multiple packages.
 
Old 06-13-2013, 08:52 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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

Last edited by chrism01; 06-13-2013 at 08:56 AM.
 
Old 06-13-2013, 08:54 AM   #3
shane25119
Member
 
Registered: Aug 2003
Location: Illinois
Distribution: Linux Mint XFCE
Posts: 653

Rep: Reputation: 53
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
 
Old 06-13-2013, 09:00 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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.
 
Old 06-13-2013, 09:08 AM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 713

Original Poster
Rep: Reputation: Disabled
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
error: file /http://mirror.webtatic.com/yum/el6/latest.rpm: No such file or directory
[root@vps ~]# wget http://mirror.webtatic.com/yum/el6/latest.rpm
--2013-06-13 08:03:09--  http://mirror.webtatic.com/yum/el6/latest.rpm
Resolving mirror.webtatic.com... 72.21.195.40
Connecting to mirror.webtatic.com|72.21.195.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11612 (11K) [binary/octet-stream]
Saving to: `latest.rpm'

100%[======================================>] 11,612      --.-K/s   in 0.01s

2013-06-13 08:03:10 (857 KB/s) - `latest.rpm' saved [11612/11612]

[root@vps ~]# rpm -qlf latest.rpm
file /root/latest.rpm is not owned by any package
[root@vps ~]#
 
Old 06-13-2013, 09:15 AM   #6
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 525

Rep: Reputation: 141Reputation: 141
Code:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
Above line installs Webtatic Yum Repository. Check /etc/yum.repos.d/ directory, you should have webtatic.repo file in it.

Code:
yum install php54w
This installs PHP 5.4 from webstatic repository

Last edited by mddnix; 06-13-2013 at 09:16 AM.
 
Old 06-13-2013, 09:21 AM   #7
kepson77
LQ Newbie
 
Registered: May 2013
Posts: 2

Rep: Reputation: Disabled
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.

Last edited by kepson77; 06-13-2013 at 09:29 AM.
 
Old 06-13-2013, 09:32 AM   #8
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 713

Original Poster
Rep: Reputation: Disabled
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]
name=Webtatic Repository $releasever - $basearch
#baseurl=http://repo.webtatic.com/yum/el6/$basearch/
mirrorlist=http://mirror.webtatic.com/yum/el6/$basearch/mirrorlist
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

[webtatic-debuginfo]
name=Webtatic Repository $releasever - $basearch - Debug
#baseurl=http://repo.webtatic.com/yum/el6/$basearch/debug/
mirrorlist=http://mirror.webtatic.com/yum/el6/$basearch/debug/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

[webtatic-source]
name=Webtatic Repository $releasever - $basearch
#baseurl=http://repo.webtatic.com/yum/el6/SRPMS/
mirrorlist=http://mirror.webtatic.com/yum/el6/SRPMS/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
 
Old 06-13-2013, 09:35 AM   #9
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 713

Original Poster
Rep: Reputation: Disabled
Thank you kepson77! Very informative. I understand much of what you have said, but will need to go through it in more detail.
 
Old 06-13-2013, 10:06 AM   #10
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 525

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by NotionCommotion View Post
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?
if you check the files that are contained in latest.rpm, it suggets so.
Code:
# rpm -qpl http://mirror.webtatic.com/yum/el6/latest.rpm
warning: http://mirror.webtatic.com/yum/el6/latest.rpm: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
/etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
/etc/yum.repos.d/webtatic.repo
/usr/share/doc/webtatic-release-6
/usr/share/doc/webtatic-release-6/GPLv2
i suggest you to change enabled=1 to enabled=0 in webtatic.repo, so that every time you install any package it doesnt look in webtatic repository. when you want to install specific package from webtatic repo, you can use '--enablerepo=webtatic' option. to list available packages in webtatic repo, you can use following command.

Code:
# yum --disablerepo="*" --enablerepo="webtatic" list available
 
Old 06-13-2013, 10:33 AM   #11
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 525

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by NotionCommotion View Post
What is being installed?

how can I tell what is being installed?
To find what and where files are installed, you can do one of the following:

For example,

For packages that are already installed:
Code:
# rpm -qa | grep beesu
beesu-2.6-1.el6.x86_64
# rpm -ql beesu-2.6-1.el6.x86_64
/etc/beesu.conf
/etc/pam.d/beesu
/etc/profile.d/beesu-bash-completion.sh
/etc/security/console.apps/beesu
/usr/bin/beesu
/usr/sbin/beesu
/usr/share/doc/beesu-2.6
/usr/share/doc/beesu-2.6/COPYING
/usr/share/doc/beesu-2.6/README
/usr/share/man/man1/beesu.1.gz
For packages that are not installed you can use -p option. (packages could be local, ftp or http):
Code:
# rpm -qpl http://repo.webtatic.com/yum/el6/x86_64/php54w-5.4.16-1.w6.x86_64.rpm
warning: http://repo.webtatic.com/yum/el6/x86_64/php54w-5.4.16-1.w6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
/etc/httpd/conf.d/php.conf
/usr/lib64/httpd/modules/libphp5.so
/var/lib/php/session
/var/www/icons/php.gif
From the above response, you will know where files will be installed.

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
warning: http://repo.webtatic.com/yum/el6/x86_64/php54w-5.4.16-1.w6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Name        : php54w                       Relocations: (not relocatable)
Version     : 5.4.16                            Vendor: Webtatic
Release     : 1.w6                          Build Date: Sun 09 Jun 2013 12:17:44 PM IST
Install Date: (not installed)               Build Host: mock6.local
Group       : Development/Languages         Source RPM: php54w-5.4.16-1.w6.src.rpm
Size        : 4657421                          License: PHP
Signature   : DSA/SHA1, Sun 09 Jun 2013 01:40:48 PM IST, Key ID b7434b06cf4c4ff9
Packager    : Andy Thompson <andy@webtatic.com>
URL         : http://www.php.net/
Summary     : PHP scripting language for creating dynamic web sites
Description :
PHP is an HTML-embedded scripting language. PHP attempts to make it
easy for developers to write dynamically generated webpages. PHP also
offers built-in database integration for several commercial and
non-commercial database management systems, so writing a
database-enabled webpage with PHP is fairly simple. The most common
use of PHP coding is probably as a replacement for CGI scripts.

The php54w package contains the module which adds support for the PHP
language to Apache HTTP Server.
More: man rpm

Last edited by mddnix; 06-13-2013 at 10:52 AM.
 
Old 06-13-2013, 08:26 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help understanding Yum update dependency issues snowweb Linux - Server 3 08-29-2012 07:46 AM
Understanding source vs. src-rpm vs rpm Rush_898 Linux - Software 1 03-11-2010 06:51 PM
Why -bash: rpm: command not found??? Also an rpm/yum Q? vbtalent Debian 6 01-23-2006 05:55 PM
yum version yum-2.0.5-0.9.2.legacy.noarch.rpm master Red Hat 6 05-13-2005 04:03 PM
Understanding RPM? EpicLinux Linux - Newbie 4 10-29-2003 02:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration