RPM software package installation and upgrade

Source: Internet
Author: User

How to install and upgrade an RPM package?
Solution: to install an RPM package, you must have an RPM package for the software you want to install. You can download the appropriate RPM package from a website. Of course, the Red Hat Network provides all the software packages in our release. There are two main options to install and upgrade the RPM package:-I is used to install a new package. It is often used for Kernel upgrade and installation.
-U is used to upgrade an RPM package. If this package does not exist in your system's RPM database, it will install this package. You can enter man rpm on the command line to get detailed instructions on usage and options. Here is a description of the-I and-U options. INSTALL AND UPGRADE OPTIONS
The general form of an rpm install command is
Rpm {-I | -- install} [install-options] PACKAGE_FILE...
This installa new package.
The general form of an rpm upgrade command is
Rpm {-U | -- upgrade} [install-options] PACKAGE_FILE...
This install the package or upgrades the package currently installed to a newer version. this is the same as install, should t all other version (s) of the package are removed after the new package is installed. note: These examples assume that these software packages are in a directory of your system. The following RPM command is executed in the current working path where you store the new RPM package. We use the-I option to install an RPM package. As we mentioned above, the kernel upgrade must be installed using-I. The system will have multiple Kernels to prevent the system from accessing the system when the new kernel cannot be started, if the new core cannot be started, you can choose to start the original core. In this example, we first use the ls command to check the name of the new RPM package. Then, query the RPM database to check which core software package has been installed. You do not need to specify the version number when querying. Use: rpm-q <package name> directly. Run the following command to install an RPM package: rpm-ivh <package name>. the "-v" option indicates detailed output, and the "-h" option indicates the well number to indicate the installation progress. Finally, we can run another RPM query command to verify whether the software package exists. # Ls
Kernel-2.4.21-15.0.3.EL.i686.rpm
Kernel-smp-2.4.21-15.0.3.EL.i686.rpm # rpm-q kernel; rpm-q kernel-smp
Kernel-2.4.21-4.0.1.EL
Kernel-2.4.21-15.0.2.EL
Kernel-smp-2.4.21-4.0.1.EL
Kernel-smp-2.4.21-15.0.2.EL # rpm-ivh kernel-2.4.21-15.0.3.EL.i686.rpm
Preparing... ######################################## ### [100%]
1: kernel ####################################### #### [100%]
# Rpm-ivh kernel-smp-2.4.21-15.0.3.EL.i686.rpm
Preparing... ######################################## ### [100%]
1: kernel-smp ##################################### ###### [1, 100%] # rpm-q kernel; rpm-q kernel-smp
Kernel-2.4.21-4.0.1.EL
Kernel-2.4.21-15.0.2.EL
Kernel-2.4.21-15.0.3.EL
Kernel-smp-2.4.21-4.0.1.EL
Kernel-smp-2.4.21-15.0.2.EL
Kernel-smp-2.4.21-15.0.3.EL
We can use the-U option to upgrade an RPM package. In this example, we use the ls command to check the name of the new software package. Run the command rpm-q <Software Package> to check whether the software to be installed exists in the RPM database. Use rpm-Uvh <Software Package> to upgrade the RPM package. The "-v" option indicates detailed output, and the "-h" option indicates the well number to indicate the installation progress. Finally, we can run another RPM query command to verify whether the software package exists. # Ls
Httpd-2.0.46-32.ent.3.i386.rpm
Mod_ssl-2.0.46-32.ent.3.i386.rpm
| # Rpm-q httpd; rpm-q mod_ssl
Httpd-2.0.46-32.ent
Mod_ssl-2.0.46-32.ent # rpm-Uvh httpd-2.0.46-32.ent.3.i386.rpm mod_ssl-2.0.46-32.ent.3.i386.rpmPreparing... ######################################## ### [100%]
1: httpd ####################################### #### [50%]
2: mod_ssl ####################################### #### [2, 100%] # rpm-q httpd; rpm-q mod_ssl
Httpd-2.0.46-32.ent.3
Mod_ssl-2.0.46-32.ent.3
Note: The dependency httpd and mod_ssl must be installed simultaneously. Otherwise you will get the following error: # rpm-Uvh httpd-2.0.46-32.ent.3.i386.rpm
Error: Failed dependencies:
Httpd = 2.0.46-32.ent is needed by (installed) mod_ssl-2.0.46-32.ent
Note: If you have registered your machine through the Red Hat Network, you can use up2date to install a new software package. These software packages are located in the Red Hat Network and can be automatically downloaded and installed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.