5

I downloaded the rpm for dos2unix and installed (on RHEL 6, 64 bit) like this

[root@xilinx Downloads]# rpm -ivh dos2unix-5.3.3-5.ram0.98.src.rpm 
   1:dos2unix               warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
########################################### [100%]
[root@xilinx Downloads]# 

But as can be seen I am getting these warnings. Why?

How do I know that my installation of dos2unix was succesful ?

Update

[root@xilinx Downloads]# rpm -ivh dos2unix-5.3.3-5.ram0.98.src.rpm
   1:dos2unix               warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
########################################### [100%]
[root@xilinx Downloads]# 
[root@xilinx Downloads]# 
[root@xilinx Downloads]# 
[root@xilinx Downloads]# 
[root@xilinx Downloads]# rpm -ql dos2unix
package dos2unix is not installed
[root@xilinx Downloads]# 

I then tried

[root@xilinx acme]# yum install mock
Loaded plugins: refresh-packagekit, rhnplugin
There was an error parsing the RHN proxy settings.
RHN support will be disabled.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again
[root@xilinx acme]# 
gpuguy
  • 1,356
  • Did you mean to install the Source RPM? Or did you want to install the binary RPM? Or build the binary RPM from the source RPM? – jsbillings Jan 25 '14 at 22:51

4 Answers4

13

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
Kusalananda
  • 333,661
slm
  • 369,824
4

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

Michael
  • 171
1

Find out if the rpm's files have been installed:

rpm -ql dos2unix

Regarding your installation, it looks good, the rpm expects a group (mockbuild) and a user that you do not have. Should be fixed by the rpm responsible, but these are warnings only and your installation most probably worked fine.

0

If you want to install a source rpm you need first to build it:

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

The mock package is not required to do this, so you can ignore the warnings:

warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root

The rpmbuild will create a binary rpm. The location may vary, e.g. /usr/src/redhat/RPMS/ or ~/rpmbuild/RPMS (the output of rpmbuild should help with this). The RPM will be in a subdirectory representing your architecture (e.g. x86_64/). You can install normally this rpm:

# rpm -Uvh /usr/src/redhat/RPMS/x86_64/dos2unix-5.3.3-5.x86_64.rpm

If there were no errors, you should have the package installed:

# rpm -q dos2unix
dos2unix-5.3.3-5
mik
  • 1,342