Posts tagged Redhat package Manager
How to uninstall an RPM
Nov 4th
The rpm -e command can be used to erase an installed RPM. The following example attempts to delete a RPM called codeina-0.10.1-5.fc8 .
[neo@techpulp ~]# rpm -e codeina-0.10.1-5.fc8 [neo@techpulp ~]#
If the RPM given is not an installed RPM, it shows an error message as shown below.
[neo@techpulp ~]# rpm -e abcd error: package abcd is not installed [neo@techpulp ~]#
How to find list of installed files of an RPM
Nov 4th
The rpm -q -l can be used to get the list of files installed by an installed RPM. The following example finds the files installed by bash RPM.
[neo@techpulp ~]# rpm -aq | grep bash bash-3.2-18.fc8 [neo@techpulp ~]# rpm -q -l bash-3.2-18.fc8 /bin/bash /bin/sh /etc/skel/.bash_logout /etc/skel/.bash_profile /etc/skel/.bashrc /usr/bin/bashbug-32 /usr/share/doc/bash-3.2 /usr/share/doc/bash-3.2/CHANGES .... /usr/share/man/man1/unset.1.gz /usr/share/man/man1/wait.1.gz [neo@techpulp ~]#
How to find which RPM owns an installed file
Nov 4th
The ‘rpm -q -f’ command can be used to identify RPM to which an installed file belongs to. The following example queries RPM database to find the RPM that own /usr/bin/kompare file.
[neo@techpulp ~]# rpm -q -f /usr/bin/kompare kdesdk-3.5.8-2.fc8 [neo@techpulp ~]#
If the file doesn’t belong to any RPM it displays a message as shown below.
[neo@techpulp ~]# rpm -q -f /home/neo/myfile.txt file /home/neo/myfile.txt is not owned by any package [neo@techpulp ~]#
How to find the list of installed RPMs
Nov 4th
The “rpm -aq” command can be used to query the list of RPMs installed in the system.
[neo@techpulp ~]# rpm -aq gnu-regexp-1.1.4-10jpp.3.fc8 java_cup-manual-0.10-0.k.6jpp.1 ql2200-firmware-2.02.08-1.fc8.1 popt-1.12-3.fc8 freetype-2.3.5-3.fc8 sed-4.1.5-9.fc8 libattr-2.4.38-1.fc8 device-mapper-1.02.22-1.fc8 libIDL-0.8.9-1.fc8 .... python-xlib-0.13-3.fc7 qt-designer-3.3.8b-2.fc8 [neo@techpulp ~]#
You can use ‘grep‘ command to search for a particular RPM in the list as shown below. In this example, we are trying to find if the GIMP package is installed in the system.
[neo@techpulp ~]# rpm -aq | grep gimp gimp-libs-2.4.0-0.rc3.2.fc8 xsane-gimp-0.994-4.fc8 gimp-2.4.0-0.rc3.2.fc8 [neo@techpulp ~]#
How to extract files from RPM
Jul 26th
All the files present in a RPM file can be extracted using rpm2cpio and cpio utilities. The rpm2cpio command is used to convert RPM to cpio compatible archive and cpio command can be used to extract files from the archive.
The following example shows how extract files from ElectricFence RPM.
[liz@techpulp ~]# rpm2cpio ElectricFence-2.2.2-23.rpm | cpio -idv


Recent Comments