RPM Package Manager
RPM installation Package
Binary packages (binary) and source code packages (sources) are two types. Binary packages can be installed directly on the computer, and the source code package will be automatically compiled and installed by RPM. Source code packages often use src.rpm as the suffix name.
Common Command combinations:
-IVH: Installation shows installation progress--install--verbose--hash
-UVH: Upgrade package--update;
-QPL: Lists the file information in the RPM package [Query packages list];
-QPI: Lists the description information for RPM packages [Query Package Install pack (s)];
-QF: Find which rpm package the specified file belongs to [Query file];
-va: Check all RPM packages to find the missing files [View Lost];
-E: Remove Package
Example: Querying whether Samba programs are installed
[[email protected] ~]# Rpm-q Samba does not install package Samba
Install and show progress by path, dependencies between packages during installation, and needs to be installed together with interdependent RPM packages.
[Email protected] packages]# find-name ' samba* './samba-winbind-modules-4.1.12-21.el7_1.x86_64.rpm./ Samba-4.1.12-21.el7_1.x86_64.rpm./samba-client-4.1.12-21.el7_1.x86_64.rpm./samba-common-4.1.12-21.el7_1.x86_ 64.rpm./samba-libs-4.1.12-21.el7_1.x86_64.rpm./samba-python-4.1.12-21.el7_1.x86_64.rpm./ Samba-winbind-4.1.12-21.el7_1.x86_64.rpm[[email protected] packages]# rpm-ivh/mnt/cdrom/packages/ samba-4.1.12-21.el7_1.x86_64.rpm
RPM-IVH--relocate/= Specify the RPM installation directory
RPM-QL httpd [Search rpm package]--list All files installation directory
RPM-E RPM Package Name Delete RPM Package
Yum Application
Check what updates are available for RPM packages
[[email protected] packages]# yum check-update Loaded Plugin:fastestmirror, langpacksloading mirror speeds from cached hostfilenetworkmanager.x86_64 1:1.0.0-16.git20150121.b4ea599c.el7_1 NetworkManager-libnm.x86_64 1:1.0.0-16.git20150121.b4ea599c.el7_1 NetworkManager-team.x86_64 1:1.0.0-16.git20150121.b4ea599c.el7_1 NetworkManager-tui.x86_64 1:1.0.0-16.git20150121.b4ea599c.el7_1 abrt.x86_64 2.1.11-22.el7.centos.0.1 abrt-addon-ccpp.x86_64 2.1.11-22.el7.centos.0.1
Installing httpd
[[Email protected] packages]# yum install httpd Loaded plugin:fastestmirror, Langpacksloading mirror speeds from cached hostfile is resolving dependencies--> checking Transactions---> Package httpd.x86_64.0.2.4.6-31.el7.centos.1 will be install--> to resolve dependencies to complete the dependency relationship resolution ================= ================================================================================== package Architecture version Source size ================================================================================================ = = = Installing: httpd x86_64 2.4.6-31.el7.centos.1 updates 2.7 m Transaction Summary ============================================================================== ===================== installs 1 packages total Downloads: 2.7 m installation size: 9.4 mis this ok [y/d/n]:
uninstall httpd
[[Email protected] packages]# yum remove httpd Loaded plugin:fastestmirror, LangPacks is resolving dependencies--> checking transactions---> packages httpd.x86_64.0.2.4.6-31.el7.centos.1 will be Remove--> Resolve Dependency Completion dependency resolution ================================================================================== ================= package Architecture version Source size ====================================================== ============================================= is deleting: httpd X86_64 2.4.6-31.el7.centos.1 @updates 9.4 m Transaction Summary ========================================== ========================================================= Removal 1 Package Installation size: 9.4 m Do you want to continue? [y/n]:
Yum configuration file
[[email protected] packages]# cat /etc/yum.conf [main]cachedir=/var/cache/yum/$ basearch/$releasever //yum Cache directory,yum This store downloaded rpm packages and databases, which are set by default to/var/cache/ yumkeepcache=0//If the package is retained after installation is complete, 0 is not reserved (default is 0), 1 is reserved debuglevel=2//debug information output level, the range is 0-10, the default is 2logfile=/var/log/ Yum.log//yum log file location. Users can go to the/var/log/yum.log file to check for updates made in the past. exactarch=1 //is set to 1, which means that Yum will only install packages that match the system architecture OBSOLETES=1GPGCHECK=1  //GPG authentication is turned on, and 1 means open Plugins=1 //is set to 1 to enable plug-ins installonly_limit=5bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23 &ref=http://bugs.centos.org/bug_report_page.php?category=yumdistroverpkg=centos-release# this is the default, if you make this bigger yum won ' T see if the metadata# is newer on the remote and so you ' ll "Gain" the bandwidth of not having to# download the new metadata and "Pay" for it by yum not having correct# information.# it is esp. important, to Have correct metadata, for distributions like# fedora which don ' t keep old packages around. if you don ' t like this checking# interupting your command line usage, it ' s much better to have something# manually check the metadata once an hour ( yum-updatesd will do this). # metadata_expire=90m# put your repos here or in separate files named file.repo# in /etc/yum.repos.d
1. Enter the folder where the source configuration is stored
Cd/etc/yum.repos.d
2. Back up the default source
mv./centos-base.repo./centos-base.repo.bak
3, use wget download 163 source http://mirrors.163.com/.help/centos.html
wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo
4. Set the downloaded file Centos-base-163.repo as the default source
MV Centos6-base-163.repo Centos-base.repo
Run the Yum Makecache build cache
Yum Makecache
1. build local disc YUM Source
Create a CD-ROM mount directory and mount the disc.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/26/wKioL1X2o4ehu2GzAAFTwFx1-Mg703.jpg "title=" 1.jpg " alt= "Wkiol1x2o4ehu2gzaaftwfx1-mg703.jpg"/>
Switch to YUM Configure the directory, the original files are packaged backup, delete the original file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/29/wKiom1X2oZCBnCVvAAE9PKWgTFQ520.jpg "title=" 2.jpg " alt= "Wkiom1x2ozcbncvvaae9pkwgtfq520.jpg"/>
Configure the disc source file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/26/wKioL1X2pAOw2-SnAAB2AmD8QuY023.jpg "title=" 3.jpg " alt= "Wkiol1x2paow2-snaab2amd8quy023.jpg"/>
Verify
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/29/wKiom1X2oejgGrulAAUcOlvWNt4257.jpg "title=" 4.jpg " alt= "Wkiom1x2oejggrulaaucolvwnt4257.jpg"/>
Yum and rpm Summary