Search Engine

Loading

Sallar

Sallar
RedhatEnterpriseLinux Blog

Installing RPM Package Software


Installing an RPM package can be done via the command line or a graphical program. Because some systems such as servers do not always have a graphical desktop installed, it is important to learn at least the basics of how to use the command-line version of RPM. The command is simple to remember: It is the rpm command.
Before installing any software, confirm that it was packaged by a trusted source and has not been altered since the trusted source built it. This process is done by checking the GPG signature of the package.

First, as the root user, import the GPG signature of the trusted party with the rpm –import <keyfile> command, where <keyfile> is the file containing the key. If you do not know where to securely obtain the key file, ask your trusted RPM source. To verify that the key was imported properly, execute the rpm -qa gpg-pubkey* command. If you imported the RPM-GPG-KEY-redhat-release key, the output will be similar to the following:

gpg-pubkey-37017186-45761324
To view the details of the key, execute the rpm -qi gpg-pubkey-37017186-45761324 command.

Details of RPM GPG Key
Name : gpg-pubkey   Relocations: (not relocatable)
Version : 37017186                          Vendor: (none)
Release : 45761324                         Build Date: Wed 28 Feb 2007 12:36:35 AM EST
Install Date: Wed 28 Feb 2007 12:36:35 AM EST        Build Host: localhost
Group : Public Keys Source RPM: (none)
Size : 0                               License: pubkey
Signature : (none)      Summary : gpg(Red Hat, Inc. (release key) <security@redhat.com>)
Description :
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: rpm-4.4.2 (beecrypt-4.1.2)                        
mQGiBEV2EyQRBAD4/SR69qoLzK4HIa6g9iS+baiX0o3NjkLftFHg/xy+IMOMg//i4c5bUpLK
DTMH3+yT0G8qpul/RALUFOESKFkZm3/SlkJKuroXcB8U6s2dh5XX9DDBISqRwL7M5qB8rfDP
KHN+k/XwJ9CNpHMdNxnnc2WhnnmHNp6NrD/bUEH4vwCglMa0rFRXPaN7407DARGHvW/jugsE
ANFaeZsFwos/sajL1XQRfHZUTnvDjJgz31IFY+OLDlOVAOtV/NaECMwIJsMIhoisW4Luwp4m
75Qh3ogq3bwqSWNLsfJ9WFnNqXOgamyDh/F4q492z6FpyIb1JZLABBSH7LEQjHlR/s/Ct5JE
Wc5MyfzdjBi6J9qCh3y/IYL0EbfRA/4yoJ/fH9uthDLZsZRWmnGJvb+VpRvcVs8IQ4aIAcOM
bWu2Sp3U9pm6cxZFN7tShmAwiiGj9UXVtlhpj3lnqulLMD9VqXGF0YgDOaQ7CP/99OEEhUjB
j/8o8udFgxc1i2WJjc7/sr8IMbDv/SNToi0bnZUxXa/BUjj92uaQ6/LupbQxUmVkIEhhdCwg
SW5jLiAocmVsZWFzZSBrZXkpIDxzZWN1cml0eUByZWRoYXQuY29tPohfBBMRAgAfBQJFdhMk
AhsDBgsJCAcDAgQVAggDAxYCAQIeAQIXgAAKCRBTJoEBNwFxhogXAKCDTuYeyQrkYXjg9JmO
dTZvsIVfZgCcCWKJXtfbC5dbv0piTHI/cdwVzJo=
=mhzo
-----END PGP PUBLIC KEY BLOCK-----                          


After importing the key, the signature on the package can be verified with the rpm –K <rpmfile> command. If the package has not been corrupted since it was signed, the output will include the phrase md5 gpg OK. If the package is not signed, the output will include output such as:

NOT OK
If you haven’t imported the corresponding public key, the following message is given:

MISSING KEYS

After verifying that the package is trustworthy, install it with this command:

rpm -Uvh <rpmfile>

The -Uvh arguments tell the rpm command to install the package, display verbose information about the installation, and display the progress of the installation with hash marks.
The output will look similar to

Installing an RPM Package

Preparing... ########################################### [100%]
1:example ########################################### [100%]
Sometimes a package requires additional RPM packages to be installed or updated as shown in Listing.

Dependencies Needed

error: Failed dependencies:
example-core = 1:2.0.0-3.2.1 is needed by example-filters-2.0.0-3.2.1.i386
Download the additional package as well and install all the packages at the same time:
rpm -Uvh <rpmfile1> <rpmfile2>

Additional options to the rpm command can be specified when installing packages. Some of these options are described in Table.

Optional rpm Arguments When Installing or Updating
Argument
Description
--nodeps
Install or upgrade the package without checking for dependencies. The software will most likely not function properly without the software dependencies installed. If you contact Red Hat support with problems, they will most likely ask you to reproduce the problem on a system where all package dependencies have been satisfied.
--noscripts
Do not execute any of the scripts before or after installation, upgrade, or removal.
--excludedocs
Do not install packages marked as documentation files such as man pages.
--oldpackage
Allow a package to be replaced with an older version.
--test
Check for potential conflicts such as package dependencies but do not install the package.

0 comments:

Post a Comment

Powered by Blogger.

Ads

 
Copyright © Redhat Enterprise linux. Original Concept and Design by My Blogger Themes
My name is Abdul Razaq but people call me Raziq. Here is my home page: www.redhatenterpriselinux.blogspot.com I live in Quetta, Pakistan and work as an IT-Engineer.