How
do I install an RPM?
RPMs are programs that are easily installed an run. To install
an RPM file, log in as root and type the following:
rpm
-i rpmname-here.i386.rpm
How
do I uninstall an RPM?
RPMs can be removed by typing the package name only. For
instance, if we had an RPM file with the name above ( rpmname-here.i386.rpm
)
we
would remove it only by specifying the base name of the
page, in this case rpmname:
rpm
-e rpmname
How
do I get a list of all installed RPMs?
As root type:
rpm
-qa
How
do I get a list of all files that belong to a certain package?
In this case, we'll look at all the files installed by the
package elfutils. As root type:
rpm
-ql elfutils
How
do I get a list of all files that will be installed by an
RPM file?
If we have an RPM file with the name rpmname-here.i386.rpm
we
would type the following:
rpm
-qlf rpmname-here.i386.rpm
How
do I find which package a file belongs to?
If we have an file with the name /etc/php.ini
we
would type the following:
rpm
-qf /etc/php.ini
How
do I use an SRPM?
SRPMs are the files used to create RPMs. Typically you can
just get an RPM and install it asis. However, there are
special cases when you'll need to create an RPM from an
SRPM file. To do this, get the desired SRPM file. We'll
pretend we have one called aumix-2.7-16.src.rpm.
If your install is less than Red Hat 8.0 log in as root
and type the following:
rpm
--rebuild aumix-2.7-16.src.rpm
If
your install is Red Hat 8.0 or newer, log in as root and
type the following:
rpmbuild
--rebuild aumix-2.7-16.src.rpm
Towards
the end of the output you will see something such as:
Wrote:
/usr/src/redhat/RPMS/i386/aumix-2.7-16.rpm
This
means you have an RPM (that was just created by you!) in
the /usr/src/redhat/RPMS/i386 directory. To install this
package type:
rpm
-i
/usr/src/redhat/RPMS/i386/aumix-2.7-16.rpm
How
do extract the files from an RPM or SRPM?
Files can be extracted from either RPM or SRPMs by using
the following command (this example would extract from an
RPM file called, rpm-4.2-0.69.src.rpm):
rpm2cpio
rpm-4.2-0.69.src.rpm | cpio -idmv --no-absolute-filenames
After
using the command above, you will get a .tar.gz file and
a .spec file. The files will be located in the .tar.gz file.
In this example we'd type:
tar -xvzf
rpm-4.2.tar.gz
Related
Topics & Information |
|
None |
|
|
|
|