How to install rpm package for Linux system

  
 

How to install the rpm package

The installation of the rmp package can be done using the program rpm. Execute the following command:

rpm -i your-package.rpm

where your-package.rpm is the file name of the rpm package you want to install, usually placed in the current directory.

The following warnings or tips may appear during the installation process:

... conflict with ...

There may be some files in the package to be installed that may be overwritten Existing files, by default, cannot be installed correctly. You can use rpm --force -i to force installation.

... is needed by ...

... is not installed ... Some software required for this package you have not installed can use

rpm --nodeps -i to ignore this information, that is, rpm -i --force --nodeps All dependencies and file issues can be ignored, and any packages can be installed, but such forced installations are not guaranteed to be fully functional.

2. How to install the .src.rpm package

Some packages end with .src.rpm. These packages are rpm packages containing source code during installation. Need to compile. There are two installation methods for this type of package. Method 1:

1. Execute rpm -i your-package.src.rpm

2. cd /usr/src/redhat/SPECS < Br>

3. rpmbuild -bp your-package.specs A specs file with the same name as your package

4. cd /usr/src/redhat/BUILD/your-package/One and you The same name of the package

5. ./configure This step is the same as compiling ordinary source software, you can add the parameters

6. make

7. make install

Method 2

1. Execute rpm -i you-package.src.rpm

2. cd /usr/src/redhat/SPECS

The first two steps are the same as the method one.

3. rpmbuild -bb your-package.specs A specs file with the same name as your package. At this time, in /usr/src/redhat/RPM/i386/(depending on the specific package, it may be i686, noarch, etc.) In this directory, there is a new rpm package, this is a compiled binary file. . Execute rpm -i new-package.rpm to complete the installation.

3. How to uninstall rpm package

Use the command rpm -e package name, package name can contain version number and other information, but can not have suffix.rpm such as uninstall package proftpd-1.2 .8-1, the following format can be used:

rpm -e proftpd-1.2.8-1

rpm -e proftpd-1.2.8

rpm -e proftpd -

rpm -e proftpd

Cannot be in the following format:

rpm -e proftpd-1.2.8-1.i386.rpm

rpm -e proftpd-1.2.8-1.i386

rpm -e proftpd-1.2

rpm -e proftpd-1

Sometimes there are some errors or warnings: < Br>

... is needed by ... This means that this software is needed by other software and cannot be uninstalled. You can force uninstallation with rpm -e --nodeps.

4. How to not install but get the files in the rpm package

Using the tools rpm2cpio and cpio

rpm2cpio xxx.rpm

Copyright © Windows knowledge All Rights Reserved