rpm命令的常見選項(xiàng)
rpm命令是RPM軟件包的管理工具诉濒。rpm最初是Red Hat Linux發(fā)行版專用于管理Linux各項(xiàng)套件的開源程序。它可以用于給程序進(jìn)行安裝,升級横辆,卸載狈蚤,查詢和校驗(yàn)等划纽。
語法格式:rpm [OPTIONS] [PACKAGE_FILE]
1. 安裝選項(xiàng)
命令格式:rpm {-i | --install} [install-options] PACKAGE_FILE ...
常見選項(xiàng):
- -v:顯示詳細(xì)信息勇劣;
- -h:安裝時(shí)顯示進(jìn)度條,單個(gè)‘#’表示2%進(jìn)度幻捏;
- --test:測試安裝篡九,此操作只用于模擬安裝榛臼,用于檢查包的依賴關(guān)系集沖突信息等窜司;
- --nodeps:安裝時(shí)忽略依賴關(guān)系;相當(dāng)于強(qiáng)制安裝金刁,不建議此操作胀葱;
- --replacepkgs:重新安裝
- --nosignature:安裝時(shí)不檢查包簽名的信息笙蒙,也就是不檢查包的來源合法性捅位;
- --nodigest:不檢查包的完整性信息搂抒;
- --noscripts:安裝時(shí)不執(zhí)行包的腳本片段求晶;
注意:rpm可以自帶腳本執(zhí)行芳杏;
有四類:
preinstall:安裝過程開始前運(yùn)行的 腳本爵赵,%pre泊脐,--nopre
postinstall:安裝過程完成后運(yùn)行的腳本容客,%post,--nopost
preuninstall:卸載過程真正開始執(zhí)行前運(yùn)行的腳本但两,%preun谨湘,--preun
postuninstall:卸載過程完成后運(yùn)行的腳本士袄,%postun娄柳,--nopostun
示例
[root@elf Packages]# rpm -ivh apr-1.4.8-3.el7.x86_64.rpm
準(zhǔn)備中... ################################# [100%] ‘安裝顯示進(jìn)度條’
軟件包 apr-1.4.8-3.el7_4.1.x86_64 (比 apr-1.4.8-3.el7.x86_64 還要新) 已經(jīng)安裝
file /usr/lib64/libapr-1.so.0.4.8 from install of apr-1.4.8-3.el7.x86_64 conflicts with file from package apr-1.4.8-3.el7_4.1.x86_64
[root@elf Packages]#
2.升級選項(xiàng)
命令格式:
rpm {-U | --upgrade} [install-options] PACKAGE_FILE ...
rpm {-F | --freshen} [install-options] PACKAGE_FILE ...
注意:-U和-F的區(qū)別在于U表示升級或安裝赤拒,在升級過程中挎挖,如果沒有檢測到系統(tǒng)上的舊程序航夺,U會(huì)直接進(jìn)行安裝需要升級的程序阳掐。而F則表示單純的升級冷蚂,若系統(tǒng)上沒有需要升級的舊程序蝙茶,F(xiàn)也并不會(huì)為之安裝隆夯。
常見選項(xiàng)
- -U:對指定程序進(jìn)行升級或安裝蹄衷;
- -F:對指定程序進(jìn)行升級畸肆;
- --oldpackage:對指定程序進(jìn)行降級操作;
- --force:對指定程序強(qiáng)制升級调卑;
注意:
(1).盡量不要對內(nèi)核進(jìn)行升級操作恬涧,Linux支持多內(nèi)核版本并存溯捆,因此厦瓢,建議直接安裝新本的內(nèi)核。
(2).如果某原程序包的配置文件安裝后曾被修改過劳跃,升級時(shí)刨仑,新版本的程序包所提供的同一配置文件不會(huì)覆蓋原有版本程序包的配置文件杉武,新版本程序包配置文件會(huì)重命名提供(FILENAME.rpmnew);
示例
[root@elf Packages]# rpm -Uvh httpd-tools-2.4.6-45.el7.centos.x86_64.rpm
準(zhǔn)備中... ################################# [100%] ‘v和h分別表示顯示詳細(xì)信息與進(jìn)度條’
軟件包 httpd-tools-2.4.6-67.el7.centos.6.x86_64 (比 httpd-tools-2.4.6-45.el7.centos.x86_64 還要新) 已經(jīng)安裝
3.卸載選項(xiàng)
命令格式:
rpm {-e | --erase} [--allmatches] [--nodeps] [--noscripts] [--test]
常見選項(xiàng)
- -e:直接卸載指定程序包轻抱;
- --allmatches:卸載所有匹配到的指定名稱的程序包的各版本旦部;
- --test:測試卸載封拧,模擬卸載操作泽西;
示例
[root@elf Packages]# rpm -evh wireshark-devel-1.10.14-10.el7.i686 --nodeps
準(zhǔn)備中... ################################# [100%]
正在清理/刪除...
1:wireshark-devel-1.10.14-10.el7 ################################# [100%]
4.查詢選項(xiàng)
命令格式:
rpm {-1 | --query } [select-options] [query-options]
常見選項(xiàng)
[select-options]
- -a, --all:查詢所有已經(jīng)安裝過的包捧杉;
- -f, FILE:查詢指定的文件由哪個(gè)程序包安裝生成味抖;
- -p, --package:可對指定的未安裝程序包執(zhí)行查詢操作灰粮;
- --whatprovides CAPABILITY:查詢指定的CAPABILITY由哪個(gè)程序包提供粘舟;
- --whatprovides CAPABILITY:查詢指定的CAPABILITY被哪個(gè)包所依賴;
[query-options]
- --changelog:查詢r(jià)pm包的changlog霞揉;
- -l迈倍, --list:程序安裝生成的所有文件列表吁朦;
- -i阀蒂, --info:程序包的詳細(xì)信息猜旬,包含版本號,包大小胁住,所屬的包組等刊咳;
- -c娱挨,--configfiles:查詢指定程序包所提供的配置文件跷坝;
- -d,--docfiles:查詢指定程序包所提供的幫助文檔淮韭;
- -R贴届,--requires:查詢指定的程序包的依賴關(guān)系毫蚓;
- --provides:列出指定的程序包所提供的所有CAPABILITY;
- --scripts:查看程序包自帶的腳本片段;
示例
[root@elf ~]# rpm -qa '查詢系統(tǒng)上所有已安裝的程序包'
dracut-network-033-463.el7.x86_64
filesystem-3.2-21.el7.x86_64
ebtables-2.0.10-15.el7.x86_64
bind-license-9.9.4-37.el7.noarch
libsoup-2.48.1-6.el7.x86_64
nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64
NetworkManager-1.4.0-12.el7.x86_64
ncurses-libs-5.9-13.20130511.el7.x86_64
libestr-0.1.9-2.el7.x86_64
......
[root@elf ~]# rpm -qi plymouth '查詢指定程序包的詳細(xì)信息’
Name : plymouth
Version : 0.8.9
Release : 0.26.20140113.el7.centos
Architecture: x86_64
Install Date: 2018年03月03日 星期六 07時(shí)43分28秒
Group : System Environment/Base
Size : 232811
License : GPLv2+
Signature : RSA/SHA256, 2016年11月21日 星期一 04時(shí)06分35秒, Key ID 24c6a8a7f4a80eb5
Source RPM : plymouth-0.8.9-0.26.20140113.el7.centos.src.rpm
Build Date : 2016年11月15日 星期二 02時(shí)35分13秒
Build Host : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.freedesktop.org/wiki/Software/Plymouth
Summary : Graphical Boot Animation and Logger
Description :
Plymouth provides an attractive graphical boot animation in
place of the text messages that normally get shown. Text
messages are instead redirected to a log file for viewing
after boot.
[root@elf ~]# rpm -qc plymouth ‘查詢指定程序包的配置文件’
/etc/plymouth/plymouthd.conf
[root@elf ~]# rpm -ql plymouth ‘查詢指定程序包的幫助文檔’
/etc/plymouth
/etc/plymouth/plymouthd.conf
/usr/bin/plymouth
/usr/lib/systemd/system/halt.target.wants
/usr/lib/systemd/system/halt.target.wants/plymouth-halt.service
/usr/lib/systemd/system/initrd-switch-root.target.wants
/usr/lib/systemd/system/initrd-switch-root.target.wants/plymouth-start.service
......
[root@elf ~]# rpm -qf /var/spool/plymouth ‘查詢指定的文件由哪個(gè)程序包所提供’
plymouth-0.8.9-0.26.20140113.el7.centos.x86_64
[root@elf Packages]# rpm -qpl zziplib-utils-0.13.62-5.el7.x86_64.rpm ‘查詢未安裝程序包所提供的所有文件列表’
/usr/bin/unzip-mem
/usr/bin/unzzip
/usr/bin/unzzipcat
/usr/bin/unzzipcat-mem
/usr/bin/unzzipcat-seeko
/usr/bin/unzzipdir
/usr/bin/unzzipdir-mem
/usr/bin/zzcat
/usr/bin/zzdir
/usr/bin/zzxorcat
/usr/bin/zzxorcopy
/usr/bin/zzxordir
5.校驗(yàn)選項(xiàng)
命令格式:
rpm {-V|--verify} [select-options] [verify-options]
[select-options]
- -p:Verify against package file
- -f:校驗(yàn)所屬的軟件包
- -a:校驗(yàn)所有的軟件包
- -g:校驗(yàn)所有屬于組的軟件包
[verify-options]
- --noscripts 不運(yùn)行校驗(yàn)?zāi)_本
- --nodeps 不校驗(yàn)依賴性
- --nofiles 不校驗(yàn)文件屬性
常見參數(shù)
- S file Size differs
- M Mode differs (includes permissions and file type) 5 digest (formerly MD5 sum) differs
- D Device major/minor number mismatch
- L readLink(2) path mismatch
- U User ownership differs
- G Group ownership differs
- T mTime differs
- P caPabilities differ
rpm程序包的合法性驗(yàn)證
通常我們在得到一個(gè)rpm包的時(shí)候,時(shí)常會(huì)去考慮該程序包是否會(huì)對我們的計(jì)算機(jī)造成影響牲距,是否含有hacker植入的病毒呢嗅虏?為了保證我們到手的程序包是安全的皮服,這時(shí)我們就有必要對程序包進(jìn)行合法性驗(yàn)證了参咙,恰好我們的linux上就有這種驗(yàn)證的機(jī)制。
驗(yàn)證兩步驟:
- 獲取并導(dǎo)入程序包制作者的密鑰 (只針對于CentOS)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 - 驗(yàn)證
rpm -K PACKAGE_FILE
rpm包數(shù)據(jù)庫重建
還記得我們的rpm包的查詢命令嗎择同?對敲才,就是我們的‘rpm -q’命令啦择葡。有這樣一個(gè)問題敏储,我們存儲(chǔ)rpm包名稱的地方在哪兒呢,rpm包查詢到的詳細(xì)信息又是從哪兒來呢妥箕?很簡單,我們Linux上有一個(gè)rpm包的數(shù)據(jù)庫坎吻,每當(dāng)我們系統(tǒng)上減少或增加一個(gè)程序包時(shí)宇葱,數(shù)據(jù)庫就會(huì)更新條目并記錄 贝搁,這樣看來,rpm包查詢時(shí)是不是就很方便了呢弦讽?
rpm管理器數(shù)據(jù)庫路徑:/var/lib/rpm/
注意:Centos6和centos7獲取rpm管理器數(shù)據(jù)庫相關(guān)命令手冊的命令不同
CentOS 6:man rpm
CentOS 7:man rpmdb
命令格式:
rpm {--initdb | --rebuilddb} [--dbpath DIRECTORY] [--root DIRECTORY]
*--initdb:初始化數(shù)據(jù)庫往产,當(dāng)前無任何數(shù)據(jù)庫可初始化創(chuàng)建一個(gè)新的某宪;當(dāng)前有時(shí)不執(zhí)行任何操作兴喂;
*--rebuilddb:重新構(gòu)建,通過讀取當(dāng)前系統(tǒng)上所有已經(jīng)安裝過的程序包進(jìn)行重新創(chuàng)建畏鼓;
yum命令的常見選項(xiàng)
yum命令可用于添加云矫,刪除汗菜,更新rpm包,它最大的優(yōu)勢在于可自動(dòng)解決包的依賴問題巡揍,可自行處理包的依賴關(guān)系吼肥。
1.yum倉庫配置
配置文件
- /etc/yum.conf:為所有倉庫提供公共配置
- /etc/yum.repos.d/d*.repo:為倉庫的指向提供配置
配置yum倉庫
[base] #倉庫ID麻车,ID必須保證唯一性;
name #倉庫名稱啤斗,可以隨意命名赁咙;
mirrorlist #此處地址下包含了倉庫地址列表,包含一個(gè)或多個(gè)鏡像站點(diǎn)崔拥,和baseurl選擇其中一個(gè)就行凤覆;
baseurl #倉庫地址。網(wǎng)絡(luò)上的地址寫網(wǎng)絡(luò)地址慈俯,本地地址則寫本地地址拥峦;
gpgcheck #說明是否需要gpg簽名略号,1表示需要,0表示不需要氛琢;
gpgkey #數(shù)字簽名的文件路徑
enable #表示該倉庫是否開啟阳似,1表示開啟,0表示關(guān)閉撮奏;
cost #路徑的開銷畜吊,開銷越高玲献,優(yōu)先級就越低;默認(rèn)為100捌年;
2.yum命令用法
語法格式:
yum [options] [command] [package ...]
命令列表
* help 命令的幫助信息礼预,用法:yum help command;
* clean 清除緩存數(shù)據(jù),如yum clean all;
* makecache 生成元數(shù)據(jù)緩存數(shù)據(jù)褒颈,yum makecache;
* deplist 列出包的依賴關(guān)系励堡;
* erase 卸載包应结;
* fs 為當(dāng)前系統(tǒng)創(chuàng)建快照,或者列出或刪除當(dāng)前已有快照币狠±悖快照非常具有實(shí)用性肛炮,在給程序包進(jìn)行升級或打補(bǔ)丁前做個(gè)快照,就可以安安心心地做快照了碍扔;
* groups 對包組進(jìn)行操作不同;
* history 對yum事務(wù)信息進(jìn)行查看溶耘;
* info 輸出包或包組的詳細(xì)信息;
* install 安裝指定程序包百新;
* list 列出包名饭望,可配合與grep命令一起使用;
* provides 搜索給定的內(nèi)容有誰提供铅辞,可用來搜索來源于哪個(gè)包巷挥;
* reinstall 重新安裝程序包倍宾;
* repolist 列出可用的倉庫列表;
* search 給定字符串搜索相關(guān)包高职,并給出相關(guān)包較為詳細(xì)的信息怔锌;
* update 更新指定包变过;
Options:
-R [minutes], --randomwait=[minutes]:最多等待時(shí)間;
-q, --quiet:安靜模式;
-v岛杀, --verbose:詳細(xì)模式;
-y类嗤,--assumeyes:對安裝過程中出現(xiàn)的所有問題都回答為yes;
--assumeno:對安裝過程中出現(xiàn)的所有問題都回答為no辨宠;
--enablerepo=[repo]:啟用一個(gè)多個(gè)倉庫嗤形;
--disablerepo=[repo]:禁用一個(gè)或多個(gè)倉庫赋兵;
-x [package], --exclude=[package]:通配要排除的包;
--nogpgcheck:禁用gpgcheck拓轻;
--color=COLOR:高亮顯示扶叉,選其指定顏色;
--downloadnoly:僅下載包枣氧,不安裝或升級。默認(rèn)下載在yum的緩存目錄中张弛,默認(rèn)為/var/cache/yum/$basearch/$releasever
--downloaddir=DLDIR:指定下載目錄吞鸭;
示例
[root@elf ~]# yum repolist all '列出所有倉庫'
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: centos.ustc.edu.cn
* updates: mirrors.aliyun.com
源標(biāo)識 源名稱 狀態(tài)
base/7/x86_64 CentOS-7 - Base 啟用: 9,911
centosplus/7/x86_64 CentOS-7 - Plus 禁用
epel/x86_64 epel 啟用: 12,503
extras/7/x86_64 CentOS-7 - Extras 啟用: 258
local local 啟用: 9,363
updates/7/x86_64 CentOS-7 - Updates 啟用: 143
repolist: 32,178
[root@elf ~]# yum install httpd '安裝程序包刻剥,并自動(dòng)解決包的依賴關(guān)系'
已加載插件:fastestmirror
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 3.4 kB 00:00:00
local | 3.6 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): epel/x86_64/updateinfo | 779 kB 00:00:03
(2/4): base/7/x86_64/primary_db | 5.9 MB 00:00:10
(3/4): epel/x86_64/primary_db | 6.0 MB 00:00:11
(4/4): base/7/x86_64/group_gz | 166 kB 00:00:16
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: centos.ustc.edu.cn
* updates: mirrors.aliyun.com
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 httpd.x86_64.0.2.4.6-80.el7.centos 將被 安裝
--> 正在處理依賴關(guān)系 httpd-tools = 2.4.6-80.el7.centos,它被軟件包 httpd-2.4.6-80.el7.centos.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 httpd-tools.x86_64.0.2.4.6-67.el7.centos.6 將被 升級
---> 軟件包 httpd-tools.x86_64.0.2.4.6-80.el7.centos 將被 更新
--> 解決依賴關(guān)系完成
依賴關(guān)系解決
==================================================================================================
Package 架構(gòu) 版本 源 大小
==================================================================================================
正在安裝:
httpd x86_64 2.4.6-80.el7.centos base 2.7 M
為依賴而更新:
httpd-tools x86_64 2.4.6-80.el7.centos base 89 k
事務(wù)概要
==================================================================================================
安裝 1 軟件包
升級 ( 1 依賴軟件包)
總下載量:2.8 M
Is this ok [y/d/N]: y
00:00:55
[root@elf ~]# yum update vim '更新程序包'
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: centos.ustc.edu.cn
* updates: mirrors.aliyun.com
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 vim-enhanced.x86_64.2.7.4.160-2.el7 將被 升級
---> 軟件包 vim-enhanced.x86_64.2.7.4.160-4.el7 將被 更新
--> 正在處理依賴關(guān)系 vim-common = 2:7.4.160-4.el7漓藕,它被軟件包 2:vim-enhanced-7.4.160-4.el7.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 vim-common.x86_64.2.7.4.160-2.el7 將被 升級
......
[root@elf ~]# yum update vim
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: centos.ustc.edu.cn
* updates: mirrors.aliyun.com
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 vim-enhanced.x86_64.2.7.4.160-2.el7 將被 升級
---> 軟件包 vim-enhanced.x86_64.2.7.4.160-4.el7 將被 更新
--> 正在處理依賴關(guān)系 vim-common = 2:7.4.160-4.el7撵术,它被軟件包 2:vim-enhanced-7.4.160-4.el7.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 vim-common.x86_64.2.7.4.160-2.el7 將被 升級
[root@elf ~]# yum update vim
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: centos.ustc.edu.cn
* updates: mirrors.aliyun.com
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 vim-enhanced.x86_64.2.7.4.160-2.el7 將被 升級
---> 軟件包 vim-enhanced.x86_64.2.7.4.160-4.el7 將被 更新
--> 正在處理依賴關(guān)系 vim-common = 2:7.4.160-4.el7嫩与,它被軟件包 2:vim-enhanced-7.4.160-4.el7.x86_64 需要
--> 正在檢查事務(wù)
---> 軟件包 vim-common.x86_64.2.7.4.160-2.el7 將被 升級
[root@elf ~]# yum remove httpd '卸載程序包’
已加載插件:fastestmirror
正在解決依賴關(guān)系
--> 正在檢查事務(wù)
---> 軟件包 httpd.x86_64.0.2.4.6-80.el7.centos 將被 刪除
--> 解決依賴關(guān)系完成
依賴關(guān)系解決
==================================================================================================
Package 架構(gòu) 版本 源 大小
==================================================================================================
正在刪除:
httpd x86_64 2.4.6-80.el7.centos @base 9.4 M
事務(wù)概要
==================================================================================================
移除 1 軟件包
安裝大薪慌拧:9.4 M
是否繼續(xù)埃篓?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在刪除 : httpd-2.4.6-80.el7.centos.x86_64 1/1
驗(yàn)證中 : httpd-2.4.6-80.el7.centos.x86_64 1/1
刪除:
httpd.x86_64 0:2.4.6-80.el7.centos
完畢!
[root@elf ~]# yum info zziplib '查看指定程序包的詳細(xì)信息'
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: centos.ustc.edu.cn
* updates: mirrors.aliyun.com
可安裝的軟件包
名稱 :zziplib
架構(gòu) :i686
版本 :0.13.62
發(fā)布 :5.el7
大小 :82 k
源 :base/7/x86_64
簡介 : Lightweight library to easily extract data from zip files
網(wǎng)址 :http://zziplib.sourceforge.net/
協(xié)議 : LGPLv2+ or MPLv1.1
描述 : The zziplib library is intentionally lightweight, it offers the ability to
: easily extract data from files archived in a single zip file. Applications
: can bundle files into a single zip archive and access them. The implementation
: is based only on the (free) subset of compression with the zlib algorithm
: which is actually used by the zip/unzip tools.
yum命令操作包組
命令格式
yum [ group( list | info | summary | install | upgrade | remove | mark ) ] [GROUP]
示例
[root@elf ~]# yum groupinfo Haskell '查看指定包組的信息‘
已加載插件:fastestmirror
沒有安裝組信息文件
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
組:Haskell
組編號:haskell
描述:對用 Haskell 編程語言開發(fā)程序的支持同窘。
默認(rèn)的軟件包:
+darcs
+ghc
+ghc-rpm-macros
+haskell-platform
+hscolour
可能的軟件包:
+ghc-gtk-devel
[root@elf ~]# yum groupinstall haskell ’安裝指定程序包組‘
已加載插件:fastestmirror
沒有安裝組信息文件
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
......
[root@elf ~]# yum groupremove haskell '移除指定的程序包組’
已加載插件:fastestmirror
沒有安裝組信息文件
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
No environment named haskell exists
Maybe run: yum groups mark remove (see man yum)
......
3.案例
使用光盤用作本地倉庫
[root@elf Packages]# mount -r -t iso9660 /dev/sr0 /mnt/cdrom '掛載光盤‘
[root@elf ~]# cd /etc/yum.repos.d/
[root@elf yum.repos.d]# vim cd.repo '配置yum倉庫'
[CDROM]
name=cd
baseurl=file:///mnt/cdrom
gpgcheck=0
enabled=1
[root@elf yum.repos.d]# yum clean all '清楚緩存'
已加載插件:fastestmirror
正在清理軟件源: CDROM base epel extras local updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@elf yum.repos.d]# yum makecache '再建立緩存'
[root@elf yum.repos.d]# yum repolist all '查看創(chuàng)建的倉庫是否生成'
[已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: mirrors.163.com
源標(biāo)識 源名稱 狀態(tài)
CDROM cd 啟用: 9,363
base/7/x86_64 CentOS-7 - Base 啟用: 9,911
centosplus/7/x86_64 CentOS-7 - Plus 禁用
epel/x86_64 epel 啟用: 12,505
extras/7/x86_64 CentOS-7 - Extras 啟用: 291
local local 啟用: 9,363
updates/7/x86_64 CentOS-7 - Updates 啟用: 539
repolist: 41,972