OpenSUSE Linux Rants

OpenSUSE Linux Tips, tricks, how-tos, opinions, and news

My Resume  -  My LinkedIn Profile - twitter: @scottmmorris

February 4, 2008

Viewing all the gory details of an RPM

by @ 6:59 am. Filed under General Linux, Linux tips, command-line

RPM Icon

Linux has a varied methodology of managing packages. RPMs are one of the most common. Some distros have source-based package management systems, such as Portage for Gentoo. Derivatives of Debian such as Ubuntu have packages in DEB format.

For the RPM-based distributions, the package manager tries to take care of resolving dependencies for you. Some of them do a great job at this. At some point, however, you’ll likely have to work directly with an RPM package on the command-line.

One thing I really like about YAST (and others) is that you can browse and search through the description, and view other package details. You can see the author, version, vendor, build date, build host, size, etc. You can also see a list of what files will be installed, and where they will be placed.

So how do we view all that info from the command line?

This is fully possible by using the rpm command. Let’s say we are going to install vsftpd from an RPM from the command line. Using the rpm command, we add a few switches to display the information:

rpm -qpil vsftpd-2.0.5-78.x86_64.rpm

The ‘q’ is for ‘query’. The ‘p’ refers to querying a package file. ‘i’ means, “Display package information, including name, version, and description.” The ‘l’ tells the rpm command to list all the files in the package.

Output of this command would look something like the following:

[1116][scott@tomahawk:~/64-bit software/vsftpd]$ rpm -qpil vsftpd-2.0.5-78.x86_64.rpm
Name        : vsftpd                       Relocations: (not relocatable)
Version     : 2.0.5                             Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 78                            Build Date: Fri 21 Sep 2007 02:34:57 PM MDT
Install Date: (not installed)               Build Host: glinka.suse.de
Group       : Productivity/Networking/Ftp/Servers   Source RPM: vsftpd-2.0.5-78.src.rpm
Size        : 286006                           License: GPL v2 or later
Signature   : DSA/SHA1, Fri 21 Sep 2007 02:43:56 PM MDT, Key ID a84edae89c800aca
Packager    : http://bugs.opensuse.org
URL         : http://vsftpd.beasts.org
Summary     : Very Secure FTP Daemon - Written from Scratch
Description :
Vsftpd is an FTP server, or dæmon. The "vs" stands for Very Secure.
Obviously this is not a guarantee, but the entire codebase was written
with security in mind, and carefully designed to be resilient to
attack.

Recent evidence suggests that vsftpd is also extremely fast (and this
is before any explicit performance tuning!). In tests against wu-ftpd,
vsftpd was always faster, supporting over twice as many users in some
tests.

Authors:
--------
    Chris Evans 
Distribution: openSUSE 10.3 (X86-64)
/etc/init.d/vsftpd
/etc/logrotate.d/vsftpd
/etc/pam.d/vsftpd
/etc/sysconfig/SuSEfirewall2.d/services/vsftpd
/etc/vsftpd.conf
/etc/xinetd.d/vsftpd
/usr/sbin/rcvsftpd
/usr/sbin/vsftpd
/usr/share/doc/packages/vsftpd
/usr/share/doc/packages/vsftpd/AUDIT
/usr/share/doc/packages/vsftpd/BUGS
/usr/share/doc/packages/vsftpd/COPYING
/usr/share/doc/packages/vsftpd/Changelog
/usr/share/doc/packages/vsftpd/EXAMPLE
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE/README
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE/vsftpd.conf
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE/vsftpd.xinetd
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE_NOINETD
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE_NOINETD/README
/usr/share/doc/packages/vsftpd/EXAMPLE/INTERNET_SITE_NOINETD/vsftpd.conf
/usr/share/doc/packages/vsftpd/EXAMPLE/PER_IP_CONFIG
/usr/share/doc/packages/vsftpd/EXAMPLE/PER_IP_CONFIG/README
/usr/share/doc/packages/vsftpd/EXAMPLE/PER_IP_CONFIG/hosts.allow
/usr/share/doc/packages/vsftpd/EXAMPLE/README
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_HOSTS
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_HOSTS/README
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS/README
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS/logins.txt
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS/vsftpd.conf
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS/vsftpd.pam
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS_2
/usr/share/doc/packages/vsftpd/EXAMPLE/VIRTUAL_USERS_2/README
/usr/share/doc/packages/vsftpd/FAQ
/usr/share/doc/packages/vsftpd/INSTALL
/usr/share/doc/packages/vsftpd/LICENSE
/usr/share/doc/packages/vsftpd/README
/usr/share/doc/packages/vsftpd/README.SUSE
/usr/share/doc/packages/vsftpd/README.security
/usr/share/doc/packages/vsftpd/REWARD
/usr/share/doc/packages/vsftpd/SECURITY
/usr/share/doc/packages/vsftpd/SECURITY/DESIGN
/usr/share/doc/packages/vsftpd/SECURITY/IMPLEMENTATION
/usr/share/doc/packages/vsftpd/SECURITY/OVERVIEW
/usr/share/doc/packages/vsftpd/SECURITY/TRUST
/usr/share/doc/packages/vsftpd/SIZE
/usr/share/doc/packages/vsftpd/SPEED
/usr/share/doc/packages/vsftpd/TODO
/usr/share/doc/packages/vsftpd/TUNING
/usr/share/empty
/usr/share/man/man5/vsftpd.conf.5.gz
/usr/share/man/man8/vsftpd.8.gz
/usr/share/omc
/usr/share/omc/svcinfo.d
/usr/share/omc/svcinfo.d/vsftpd.xml
[1116][scott@tomahawk:~/64-bit software/vsftpd]$

Now, we can see where the binaries will be installed. We can see where the config file will be. We can see where the docs and man pages will be placed.

If you need to install an RPM from the command line, normally, you could issue a command such as:

rpm -i [packagename]

A better way to do this may be as follows:

rpm -Uvh [packagename]

The “U” means upgrade. In cases where you have an older version of an RPM installed, and you’re trying to install a newer version, the -i will not do this. You’d first have to erase the RPM with the -e switch. However, if you have dependencies that rely on that RPM, you won’t be able to erase the old version of the RPM unless you want to get even more hairy. It’s easier to just tell it to upgrade. In cases where you do not have an older version of the RPM installed, the command will still install the intended RPM.

The “v” is for verbose. This just provides more information about the installation process of the RPM.

The “h” option is for “show hashes.”

The problem here is that it doesn’t automatically install dependencies.

The other thing is that you can create your own installation repository (super easy) with createrepo. Install the createrepo package. Then, you create a directory which you will use as the repository, such as /my_inst_src. Dump the RPM in there. Then, you run the createrepo command, pointing it to the new repository:

createrepo /my_inst_src

You then go into YAST and add /my_inst_src as an installation source.

You should now be able to go into YAST and install it just like you do any other RPM. Dependencies should be resolved as usual, should any exist.

If you are interested in package management through YAST, there is just such an ebook available from suseblog.com. In the upper left corner, there is a place to grab some ebooks. One of them is called “YAST – Installation and Management of Software.” Take a look at that and see if it’s helpful for you.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Leave a Reply

OpenSUSE Linux Rants
Official OpenSUSE Linux Site

internal links:

categories:

SUSE Resources

search blog:

rss feeds

news & syndication

archives:

September 2010
S M T W T F S
« Aug    
 1234
567891011
12131415161718
19202122232425
2627282930  

latest tweets:

33 queries. 1.285 seconds