RPM Common Commands
Installation
-IVH: Installing the RPM Package
--nodeps: Forced installation with ignore dependencies
--REPLACEPKG: The package is forcibly installed regardless of whether the package has been installed
Unloading
-E: Unload RPM Package
--nodeps: Ignore dependency forced uninstallation
Upgrade
-UVH: Upgrade Package--update
-FVH: Only packages installed on the system will be upgraded
--nodeps: Ignore dependency escalation
Inquire
-Q: View the installation package name
-QA: Check to see if the specified RPM package is installed
-QF: Find out which RPM package the specified file belongs to
-qi: View details of the installation package
-QC: View the configuration file for the installation package
Check
-V: Verifying the installation package
Database rebuild
--initdb,--rebuilddb
Yum Package management tool
Yum Repository: Stores a large number of RPM packages, as well as metadata files for related packages, placed in a specific directory: Repodata
Yum provides client access methods
ftp://
/HTTP
nfs://
file:///
Yum Client configuration file
/etc/yum.conf #为所有仓库提供公共配置
/etc/yum.repos.d/*.repo #为仓库指向提供配置
/etc/yum.conf configuration [main]cachedir=/var/cache/yum/$basearch/$releasever #yum缓存路径keepcache =0 #是否保存缓存文件, 1 means cache, 0 means no cache debuglevel=2 # Debug level logfile=/var/log/yum.log #日志文件exactarch =1 #是否做严格的平台匹配obsoletes =1 gpgcheck=1 #是否检查来源合法, 1 for inspection, 0 for not checking plugins=1 # Support Plug-in mechanism is not supported, 1 is supported, 0 is not supported installonly_limit=3 ............# put your repos here or in separate files named file.repo# in / etc/yum.repos.d #定义仓库指向文件
#仓库配置 [Updates] #repository idname=centos-$releasever-updates-yum.dalegames.com #仓库名称failovermethod =priority #mi rrorlist= #以镜像方式只想baseurl baseurl= #仓库访问路径, can be multiple. Gpgcheck=1 #在安装前是否检查来源信息enabled =0 #是否启用此仓库, 1 means enabled, 0 for shutdown. Can omit gpgkey= #秘钥文件访问路径failovermerhod ={roundrobin|priority} #baseurl轮询方式, the default is Roundrobin random polling, priority is to sequentially poll cost=1 #开销, the default is 1000
Yum command
Yum repolist {enabled|disabled}: List all {enable | hide} warehouses
Yum list: Show RPM Package
All: Show All
Rpm_name: Query Package name display, you can use wildcard characters
Yum install: Through the Yum installation package, you can install multiple
Yum Reinstall Package1 [Package2]: Reinstall package
Yum Update: Upgrade the installation package
Yum downgrade Package1 [Package2]: Downgrade RPM Package
Yum check-update: Checking the upgrade package
Yum Remove: Uninstalling the specified package
Yum Info: View package information
Yum Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]: cleanup local Yum Cache
Yum makecache: Generate cache manually
Yum search string1 [string2]: Search for related packages based on string
Yum deplist package1 [package2]: View dependencies for a specified package
Yum history: View Historical Yum transactions
Yum grouplist: View package groups for warehouses
Yum Groupinstall group1 [group2]: Installing a specified package group
Yum groupupdate group1 [group2]: Upgrade specified package group
Yum Groupremove group1 [group2]: Deleting a package group
Yum Life Make row Options
Yum--nogpgcheck: Prohibit Gpgcheck
Yum-y: Auto Answer Yes
Yum-q: Silent mode
Yum--disablerepo=repoidglob: Specifies that a warehouse is not used
Yum--enablerepo=repoidglob: Temporarily enable a specified warehouse
Yum--noplugins: Disable all plugins
such as: http://mirror.centos.org/centos/$releasever/updates/$basearch/
The variables in the Yum repo configuration file
$releasever: Major version number of the current OS release
$basearch: Base Platform
$arch: Platform, i386,x86_64, etc.
$YUM 0-YUM9: Customizing yum variables
Configure local Yum Source
1, hanging on the local CD
[Email protected] ~]# Mount/dev/cdrom/media/cdrom/mount:block device/dev/sr0 is write-protected, mounting read-only
2. Add Repo file
[Email protected] ~]# cd/etc/yum.repos.d/[[email protected] yum.repos.d]# vim Liangstudy.repo[base]name=centos 6.6baseurl=file:///media/cdromenabled=1gpgcheck=0
3. View Repolist
[[email protected] yum.repos.d]# yum repolistloaded plugins: fastestmirrordetermining fastest mirrorsbase | 4.0 kB 00:00 ... base/primary_db | 4.5 MB 00:00 ... repo id repo name statusbase centos 6.6 6,518repolist: 6,518
4. Install a package group
[email protected] yum.repos.d]# yum Groupinstall "Development tools"
Create a Yum repository
1. Install the Warehouse Management Pack
[Email protected] ~]# yum-y install Createrepo
2, ready to customize the warehouse use of the package
[[email protected] liang-repo]# pwd/home/liang-repo[[ email protected] liang-repo]# lsglusterfs-3.6.3-1.el6.x86_64.rpm glusterfs-cli-3.6.3-1.el6.x86_64.rpm glusterfs-fuse-3.6.3-1.el6.x86_64.rpm glusterfs-rdma-3.6.3-1.el6.x86_64. rpmglusterfs-api-3.6.3-1.el6.x86_64.rpm glusterfs-devel-3.6.3-1.el6.x86_64.rpm Glusterfs-geo-replication-3.6.3-1.el6.x86_64.rpm glusterfs-server-3.6.3-1.el6.x86_64. rpmglusterfs-api-devel-3.6.3-1.el6.x86_64.rpm glusterfs-extra-xlators-3.6.3-1.el6.x86_64.rpm glusterfs-libs-3.6.3-1.el6.x86_64.rpm[[email protected] liang-repo]#
3. Create a Yum repository
[Email protected] ~]# createrepo/home/liang-repo/
This article from "Liang Childe" blog, please be sure to keep this source http://iyull.blog.51cto.com/4664834/1887398
Linux Basics-Package management tools Yum Detailed