Basic tutorial on flexible use of RPM tools under Linux

  
 

0: How to check the installation path of the rpm installation package rpm -qpl xxxxxx.rpm

1. 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 prompts may appear during the installation process: ... conflict with ... There may be some files in the package to be installed that may overwrite the existing files. By default, this may not be installed correctly. Use rpm --force -i to force the installation... is needed by ... ... is not installed ... Some software needed for this package you have not installed can use rpm --nodeps -i to ignore this information In other words, rpm -i --force --nodeps can ignore all dependencies and file problems, and any packages can be installed, but this forced installation does not guarantee full functionality. 2. How to install .src.rpm Some packages are terminated with .src.rpm. These packages are rpm packages that contain source code and need to be compiled during installation. There are two ways to install this type of package, Method 1: 1. Execute rpm -i your-package.src.rpm 2. cd /usr/src/redhat/SPECS 3. rpmbuild -bp your-package.specs One and you The package with the same name specs file 4. cd /usr/src/redhat/BUILD/your-package/A directory with the same name as your package 5. ./configure This step is the same as compiling ordinary source software. Parameter 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 method 1. 3. rpmbuild -bb your-package .specs A specs file with the same name as your package. At /usr/src/redhat/RPM/i386/(depending on the package, it may be i686, noarch, etc.) In this directory, there is a The new rpm package, this is a compiled binary. Execute rpm -i new-package.rpm to complete the installation. 3. How to uninstall the rpm package using the command rpm -e package name, the package name can contain the version number and other information, but can not have the suffix .rpm For example, uninstall the package proftpd-1.2.8-1, you can use the following format: 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: ... is needed by ... This means that this software is needed by other software, you can not just uninstall it. Rpm -e --nodeps forced uninstall 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