1. RPM Package Management
RPM Full name is Redhat Package Manager and can only be used for Redhat series system packages management, such as Rhel, Centos, Fedora
The disc image in this article is mounted under/MNT.
System comes with RPM package stored under./mnt/packages, LS | Wc-l can find out the number of RPM packages the system comes with.
(1) Install RPM package
rpm-ivh/mnt/packages/xxx.rpm
If a relationship has occurred since, you can force the ignore:
rpm-ivh/mnt/packages/xxx.rpm
(2) RPM related parameters
Zsh whether to install
Rpm-q zsh
Whether the software containing multiple RPM packages is installed:
Rpm-qa | grep zsh
Zsh installed into those files:
RPM-QL zsh
Zsh which software is installed for this file:
Zsh which package is installed:
RP-QF ' which zsh '
These files are generated when the query is installed before the software is installed:
rpm-qpl/mnt/packages/zshxxx.rpm
To upgrade a specified package:
rpm-uvh/mnt/packahges/zshxxx.rpm
Uninstalling the Software:
Rpm-e zsh
Force uninstall, even if there is a dependency, there may be a problem:
RPM-E zsh--nodeps
Verify the integrity of the RPM package:
rpm--import /etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
2. Yum Software Management
Using RPM to install the software, users need to handle their own dependencies, Yum can solve the problem, that is, Yum will automatically solve the software management process encountered in the dependency problem.
Yum will automatically download the package and install it, yum based on the C/S architecture, this article uses the local Yum source.
(1) Configure local Yum source
To back up the Yum source configuration file:
Cp/etc/yum.repos.d/rhel-source.repo/etc/yum.repod/rhel-source.repo.bak #配置文件在修改前都需要进行备份.
Clear existing information:
echo >/etc/yum.repos.d/rhel-source.repo
To write new configuration information:
[Rhel-yum] #yum源名称, this name is unique and is used to differentiate between different yum sources.
Name=rhel-source #对本yum源的描述
Baseurl=file:///mnt #yum源的路径, the directory where the Repodata directory is located, repodata the dependencies between packages
Enabled=1 # 1: Start yum source, 0: Off
Gpgcheck=0 #不进行公钥检查.
(2) Subsequent configuration
Flush yum Cache, update yum source
Yum Clean All
Generate a new list
Yum List
This local Yum source configuration is complete
(3) Verification
Installing ZSH
Yum Install-y zsh
(4) Install a set of packages
Yum Groupinstall "Development tools"-Y
Yum Grouplist
(5) Enquiry
Yum List z*
Yum Search zsh
Query the role of a package:
Rpm-qpi/mnt/packages/zshxxx
(6) Delete
Yum Remove zsh-y
3. SOURCE installation Package
Source installation due to the way the software varies, the source package comes with the main instructions.
(1) General source code installation is to install three axes:
./configure #检查环境
Make #编译, make-j 4 4 thread compilation for faster compilation
Make install #安装 and make install-j 4 4 thread installation.
(2) Uninstall
Make uninstall #此种方法有时会删不干净, so it is recommended to find the installation directory directly to remove the installation directory.
(3) When compiling again
Make clean
./configure--prefix=xxx (Installation path)
Make-j 4
Mkae Install-j 4
4. Comparison of RPM Yum and source installation
Rpm+yum: Convenient, low software version. Good stability, easy to manage. Performance is slightly worse.
SOURCE manual: Trouble, software version new. The stability is slightly poor, the management is slightly poor. Good performance.
5. Install the SRC.RPM package
The src.rpm is because the RPM package can only be installed in the Redhat series, so the src.rpm is provided by the user to install according to their needs.
Rpmbuild--rebuild lrzszXXX.src.rpm
/root/rpmbuild/rpms/x86_64/to generate the corresponding RPM file, the above method can be installed.
Linux Basics (11)--Package management--rhel6.5