What we bring to you today is the management of RPM packages and the application of Yum. (Introduction of relatively simple, master do not spray)
Managing packages with the RPM command
The RPM command is a management tool for RPM packages. Rpm:redhat Packages Manager or RPM is the package managerpm. Originally a red Hat Linux distribution program designed to manage Linux packages, it is popular because it complies with the GPL rules and is powerful and convenient. is gradually being adopted by other distributions. RPM Suite Management mode, so that Linux easy to install, upgrade, indirectly improve the applicability of Linux, to obtain the RPM package path: 1, the release of the packages provided, 2, Fedora-epel 3, the official site of the project 4, search engines such as Http://rpmfind.net , Http://rpm.pbone.net, http://pkgs.org.
RPM Command Syntax:
RPM {-i|--install} [install-options] package_file ...
Installation options
-I: Show related information
-V: Show detailed procedure,-VV,-VVV
-H: Displays the installation process with "#".
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/14/wKiom1Xz6HqiIqFcAAEQNyoPPFg441.jpg "title=" Qq20150912165858.png "alt=" Wkiom1xz6hqiiqfcaaeqnyoppfg441.jpg "/>
Upgrade options
-UVH: If there is an older version of the package, upgrade it, or if not, install it;
-FVH: If there is an older version of the package, upgrade it, if not, do not install;
--nodeps ignores dependencies.
--oldpackage: downgrade;
--force: Forced installation.
Prompt for Php-common package when installing Php-mysql
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/14/wKiom1Xz6QyxIAQfAAEuQz6A9_s151.jpg "title=" 1.png " alt= "Wkiom1xz6qyxiaqfaaeuqz6a9_s151.jpg"/>
Plus--nodeps directly ignore the dependent installation Php-mysql, although installed, but prompted that this package may not work properly.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/11/wKioL1Xz7AWwY056AAKjVXzzpj0549.jpg "title=" 2.png " alt= "wkiol1xz7awwy056aakjvxzzpj0549.jpg"/> Uninstall option:
rpm {-e|--erase} [--nodeps] [--noscripts] [--notriggers] [--test] package_name ...
I then uninstall the package I just installed, because there are dependencies to ignore the--nodeps option, no hint is a successful uninstall.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/14/wKiom1Xz6lyj3kVjAACCb1msJ-A485.jpg "title=" 3.png " alt= "Wkiom1xz6lyj3kvjaaccb1msj-a485.jpg"/>
To query the package options that have been installed:
-qa: Query All packages that have been installed on this machine;
-qf/path/to/somefile: Query the file here is generated by which package installation;
-QC: query Specifies the configuration file that the package installation generates
-qd: Query the specified package to install the generated document
-qi: Query The information about the specified package;
-QL: A list of all files generated by the query package installation;
-Q--scripts: Query package-related scripts:
Preinstall: Pre-installation script
Postinstall: Post-installation script
Preuninstall: Pre-uninstall script
Postuninstall: Post-uninstallation script
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/11/wKioL1Xz7XeyFNx7AAHtge3Rm6Q571.jpg "title=" 4.png " alt= "Wkiol1xz7xeyfnx7aahtge3rm6q571.jpg"/>
Query option Plus-P: query against the package files that are not installed;
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/11/wKioL1Xz7cPAKk6lAAICpieC5Is663.jpg "title=" 5.png " alt= "Wkiol1xz7cpakk6laaicpiec5is663.jpg"/>
Verify that the integrity of the package requires import:
Import Key: RPM--import/path/to/key_file
Yum:yellowdog Updater Modified, the Yum command is a RPM-based package manager in Fedora and Redhat and SuSE that enables system administrators to interact and automate finer and more granular management of RPM packages, Ability to automatically download RPM packages from specified servers and install them, automatically handle dependencies, and install all dependent software packages at once, without the hassle of downloading, installing
configuration files for the Yum program: /etc/yum.conf
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/16/wKiom1Xz8naxbb0GAANOo4lVXr4140.jpg "title=" 7.png " alt= "Wkiom1xz8naxbb0gaanoo4lvxr4140.jpg"/>
[main]cachedir=/var/cache/yum/$basearch/$releasever #yum缓存的目录, yum stores downloaded RPM packages and databases, typically/var/cache/yum. Keepcache=0//Whether to keep the package after the installation is complete, 0 is not reserved (default is 0), 1 is reserved debuglevel=2//debug level, 0──10, default is 2logfile=/var/log/yum.log #日志文件exactarc H=1//There are two options 1 and 0, which represents whether only upgrade and you install package CPU system consistent package, if set to 1, if you installed a i386 rpm, Yum will not use 1686 package to upgrade Obsoletes=1//This is an update parameter, Please refer to Yum (8), which is simply equivalent to upgrade, allowing the updating of stale RPM packages. Gpgcheck=1//There are 1 and 2 choices, which represent whether or not GPG verification is performed, and if not, the default seems to be checked. Plugins=1//Whether the plug-in is enabled, default 1 is allowed, and 0 means disallowed. We usually use yum-fastestmirror this plugin. installonly_limit=5bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http:// Bugs.centos.org/bug_report_page.php?category=yumdistroverpkg=centos-releas
YUM.REPOS.D directory The files that end with the. Repo are configuration files.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/13/wKioL1Xz9P7zfEVbAAEpXXtHQyo792.jpg "title=" 6.png " alt= "Wkiol1xz9p7zfevbaaepxxthqyo792.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/16/wKiom1Xz8yfDQvMgAAKEJP81mDo163.jpg "title=" 8.png " alt= "Wkiom1xz8yfdqvmgaakejp81mdo163.jpg"/>
[base] #起一个仓库的名字唯一name =centos-$releasever - Base #一个别名描述mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch & repo=os #镜像的方式指定文件服务器从那里来获取包的信息, there are two variables $releasever: reference the major version number of the current system; $ basearch: the basic architecture of the current system: i386, i486, i586, i686: i386#baseurl=http://mirror.centos.org/ centos/$releasever/os/$basearch/ #网页的方式指定文件服务器从那里来获取包的信息 http://mirror.centos.org/centos/$releasever/os/$basearch #多个这样写. ftp://hostname/path/to/repo # Support ftp file:///path/to/repo #本机, local gpgcheck=1 #验证, check 0 is off gpgkey=file:///etc /pki/rpm-gpg/rpm-gpg-key-centos-6 # Checksum file
Yum command syntax:
Yum [options] [command] [package ...]
Command options:
Yum Install #全部安装
Yum Install Package1 #安装指定的安装包package1
Yum Groupinsall group1 #安装程序组group1
Yum Update #全部更新
Yum Update Package1 #更新指定程序包package1
Yum Check-update #检查可更新的程序
Yum Upgrade Package1 #升级指定程序包package1
Yum groupupdate group1 #升级程序组group1
Yum Info package1 #显示安装包信息package1
Yum List #显示所有已经安装和可以安装的程序包
Yum List Package1 #显示指定程序包安装情况package1
Yum GroupInfo group1 #显示程序组group1信息
Yum search string finds the installation package based on the keyword string
Yum Remove | Erase Package1 #删除程序包package1
Yum groupremove group1 #删除程序组 group1
Yum deplist package1 #查看程序package1依赖情况
Yum Clean Packages #清除缓存目录下的软件包
Yum Clean headers #清除缓存目录下的headers
Yum Clean oldheaders #清除缓存目录下旧的 headers
The Yum command upgrades the HTTP service installation:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/16/wKiom1Xz9Z3ToHXCAAOJdal0K2Y887.jpg "title=" 12.png "alt=" Wkiom1xz9z3tohxcaaojdal0k2y887.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/13/wKioL1Xz-AOii-dLAAPLG2SDHw8788.jpg "title=" 11.png "alt=" Wkiol1xz-aoii-dlaaplg2sdhw8788.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/16/wKiom1Xz9fLRMW7ZAAIKuzUR4l4602.jpg "title=" 13.png "alt=" Wkiom1xz9flrmw7zaaikuzur4l4602.jpg "/>
Yum cannot run two, the following situation occurs.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/13/wKioL1Xz94jAgduZAAH-NmY3to8260.jpg "title=" 9.png " alt= "Wkiol1xz94jagduzaah-nmy3to8260.jpg"/>
Introduction of relatively simple, master do not spray.
Introduction to RPM package management and Yum commands