How do I know that my rpm installation of a package was succesful?

Any time you install an RPM you can check if it's installed using RPM's query switch. You can find our 2 useful pieces of info about an installed package.

However before I get into all that notice the name of the .rpm you installed.

dos2unix-5.3.3-5.ram0.98.src.rpm

Binary RPMS vs. Source RPMs

This is a source RPM, which isn't built software (binary), rather this is a package that you can use to rebuild/recompile the normal .rpm file from. You typically do this using the rpmbuild command:

$ rpmbuild --rebuild dos2unix-5.3.3-5.ram0.98.src.rpm

You can also tell the difference if you list the contents of the package prior to installing it.

$ rpm -qpl dos2unix-5.3.3-5.ram0.98.src.rpm
dos2unix-5.3.3.tar.gz
dos2unix.spec

Notice this .rpm includes a .spec file? That's the "recipe" file for how to compile and install the dos2unix software which is also included in the file, dos2unix-5.3.3.tar.gz.

You can read more about source RPMs (aka. src.rpm or .srpm) files on the rpm.org website in this article titled: Source Package Files and How To Use Them.

So instead you should be installing a package named like this if you truly want to install dos2unix:

  • dos2unix-5.3.3-5.ram0.98.i386.rpm
  • dos2unix-5.3.3-5.ram0.98.x86_64.rpm
  • dos2unix-5.3.3-5.ram0.98.i686.rpm
  • dos2unix-5.3.3-5.ram0.98.noarch.rpm

NOTE: The rest of this post shows how you'd find binary RPM's such as these install on your system.


rpm -qi <...pkg name..>

This will give you standard information about a given package. Version, where it was built, when it was built etc.

$ rpm -qi dos2unix
Name        : dos2unix
Version     : 6.0.3
Release     : 2.fc19
Architecture: x86_64
Install Date: Sat 07 Dec 2013 09:02:59 PM EST
Group       : Applications/Text
Size        : 184775
License     : BSD
Signature   : RSA/SHA256, Thu 14 Mar 2013 05:25:00 AM EDT, Key ID 07477e65fb4b18e6
Source RPM  : dos2unix-6.0.3-2.fc19.src.rpm
Build Date  : Fri 22 Feb 2013 10:50:05 AM EST
Build Host  : buildvm-20.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://waterlan.home.xs4all.nl/dos2unix.html
Summary     : Text file format converters
Description :
Convert text files with DOS or Mac line endings to Unix line endings and
vice versa.

rpm -ql <..pkg name..>

You can get the contents of an RPM using the rpm -ql <..pkg name..>.

$ rpm -ql dos2unix
/usr/bin/dos2unix
/usr/bin/mac2unix
/usr/bin/unix2dos
/usr/bin/unix2mac
/usr/share/doc/dos2unix-6.0.3
/usr/share/doc/dos2unix-6.0.3/COPYING.txt
/usr/share/doc/dos2unix-6.0.3/ChangeLog.txt
...

Verifying a package installation

There is a lesser though still useful switch which will allow you to verify the installation of a package. This switch will qualify the files on disk to make sure that their permissions are set correctly, the same as when it was installed, as well as perform a checksum (MD5SUM) of each file to make sure it hasn't been tampered with or changed.

$ rpm -V -v dos2unix
.........    /usr/bin/dos2unix
.........    /usr/bin/mac2unix
.........    /usr/bin/unix2dos
.........    /usr/bin/unix2mac
.........    /usr/share/doc/dos2unix-6.0.3
.........  d /usr/share/doc/dos2unix-6.0.3/COPYING.txt
.........  d /usr/share/doc/dos2unix-6.0.3/ChangeLog.txt
.........  d /usr/share/doc/dos2unix-6.0.3/NEWS.txt
...

You should only see dots in the left column. If you see letters such as S or M then you know the size or permissions are inconsistent.

excerpt from rpm man page

   S file Size differs
   M Mode differs (includes permissions and file type)
   5 digest (formerly MD5 sum) differs
   D Device major/minor number mismatch
   L readLink(2) path mismatch
   U User ownership differs
   G Group ownership differs
   T mTime differs
   P caPabilities differ

The ‘mock’ module is responsible to build the source RPMs (SRPMs) under a chroot environment and uses the ‘mockbuild’ user. If the mockbuild user does not exist while installing the source RPM, you will receive the ‘Warning: user mockbuild does not exist. using root‘ error message. In order to fix the warning message, install the ‘mock’ module:

# yum install mock

and create the ‘mockbuild’ user

# useradd -s /sbin/nologin mockbuild

Once done, you should be able to install the required tool under the mockbuild user.

from this source

Tags:

Rhel