Linux ---各種yum源配置詳解
yum,是Yellow dog Updater, Modified 的簡稱,是杜克大學為了提高RPM 軟體包安裝性而開發的一種軟體包管理器。yum 的理念是使用一箇中心倉庫(repository)管理一部分甚至一個distribution 的應用程式相互關係,根據計算出來的軟體依賴關係進行相關的升級、安裝、刪除等等操作,減少了Linux 使用者一直頭痛的dependencies 的問題。這一點上,yum 和apt 相同。apt 原為debian 的deb 型別軟體管理所使用,但是現在也能用到RedHat 門下的rpm 了。
yum 主要功能是更方便的新增/刪除/更新RPM 包,自動解決包的倚賴性問題,便於管理大量系統的更新問題。
yum 可以同時配置多個資源庫(Repository),簡潔的配置檔案(/etc/yum.conf),自動解決增加或刪除rpm 包時遇到的依賴性問題,保持與RPM 資料庫的一致性。
(一)yum的安裝與解除安裝
1,檢視該系統是否安裝yum:
[[email protected] ~]# rpm -qa|grep yum
yum-3.2.29-69.el6.centos.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-fastestmirror-1.1.30-30.el6.noarch
2,這表示已安裝,如果沒有安裝的話,可以使用系統自帶的ISO包來進行安裝,一下操作為:
[[email protected] ~]# mount /dev/cdrom /mnt
[[email protected] ~]# ll /mnt/Packages/ |grep yum*
-r--r--r--. 3 root root 1019540 Feb 24 2013 yum-3.2.29-40.el6.centos.noarch.rpm
-r--r--r--. 3 root root 27224 Sep 26 2011 yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
-r--r--r--. 3 root root 28220 Jun 25 2012 yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[[email protected] ~]# rpm -v
3,解除安裝的步驟為:
[root@localhost ~]# rpm -e yum-3.2.29-40.el6.centos.noarch.rpm | yum-metadata-parser-1.1.2-16.el6.x86_64.rpm | yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[root@localhost ~]# rpm -qa|grep yum
[root@localhost ~]#
(二)yum的配置檔案的詳解:
yum 的配置檔案分為兩部分:main 和repository
main 部分定義了全域性配置選項,整個yum 配置檔案應該只有一個main。常位於/etc/yum.conf 中。
repository 部分定義了每個源/伺服器的具體配置,可以有一到多個。常位於/etc/yum.repo.d 目錄下的各檔案中。
[[email protected] ~]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
//yum 快取的目錄,yum 在此儲存下載的rpm 包和資料庫,預設設定為/var/cache/yum
keepcache=0
//安裝完成後是否保留軟體包,0為不保留(預設為0),1為保留
debuglevel=2
//Debug 資訊輸出等級,範圍為0-10,預設為2
logfile=/var/log/yum.log
//yum 日誌檔案位置。使用者可以到/var/log/yum.log 檔案去查詢過去所做的更新。
pkgpolicy=newest
//包的策略。一共有兩個選項,newest 和last,這個作用是如果你設定了多個repository,而同一軟體在不同的repository 中同時存在,yum 應該安裝哪一個,如果是newest,則yum 會安裝最新的那個版本。如果是last,則yum 會將伺服器id 以字母表排序,並選擇最後的那個伺服器上的軟體安裝。一般都是選newest。
distroverpkg=redhat-release
//指定一個軟體包,yum 會根據這個包判斷你的發行版本,預設是redhat-release,也可以是安裝的任何針對自己發行版的rpm 包。
tolerant=1
//有1和0兩個選項,表示yum 是否容忍命令列發生與軟體包有關的錯誤,比如你要安裝1,2,3三個包,而其中3此前已經安裝了,如果你設為1,則yum 不會出現錯誤資訊。預設是0。
exactarch=1
//有1和0兩個選項,設定為1,則yum 只會安裝和系統架構匹配的軟體包,例如,yum 不會將i686的軟體包安裝在適合i386的系統中。預設為1。
retries=6
//網路連線發生錯誤後的重試次數,如果設為0,則會無限重試。預設值為6.
obsoletes=1
//這是一個update 的引數,具體請參閱yum(8),簡單的說就是相當於upgrade,允許更新陳舊的RPM包。
plugins=1
//是否啟用外掛,預設1為允許,0表示不允許。我們一般會用yum-fastestmirror這個外掛。
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h
installonly_limit = 5
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
除了上述之外,還有一些可以新增的選項,如:
exclude=selinux* // 排除某些軟體在升級名單之外,可以用萬用字元,列表中各個專案要用空格隔開,這個對於安裝了諸如美化包,中文補丁的朋友特別有用。 gpgcheck=1 // 有1和0兩個選擇,分別代表是否是否進行gpg(GNU Private Guard) 校驗,以確定rpm 包的來源是有效和安全的。這個選項如果設定在[main]部分,則對每個repository 都有效。預設值為0。
(三)配置本地的yum源
1,掛載安裝光碟或ISO映象
[[email protected] ~]# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
mount: /dev/sr0 already mounted or /mnt/ busy
mount: according to mtab, /dev/sr0 is already mounted on /mnt
[[email protected] ~]# ll /mnt/
total 82
-r--r--r--. 1 root root 14 Nov 29 2013 CentOS_BuildTag
dr-xr-xr-x. 3 root root 2048 Nov 29 2013 EFI
-r--r--r--. 1 root root 212 Nov 28 2013 EULA
-r--r--r--. 1 root root 18009 Nov 28 2013 GPL
dr-xr-xr-x. 3 root root 2048 Nov 29 2013 images
dr-xr-xr-x. 2 root root 2048 Nov 29 2013 isolinux
dr-xr-xr-x. 2 root root 40960 Nov 29 2013 Packages
-r--r--r--. 1 root root 1354 Nov 28 2013 RELEASE-NOTES-en-US.html
dr-xr-xr-x. 2 root root 4096 Nov 29 2013 repodata
-r--r--r--. 1 root root 1706 Nov 28 2013 RPM-GPG-KEY-CentOS-6
-r--r--r--. 1 root root 1730 Nov 28 2013 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r--. 1 root root 1730 Nov 28 2013 RPM-GPG-KEY-CentOS-Security-6
-r--r--r--. 1 root root 1734 Nov 28 2013 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r--. 1 root root 3380 Nov 29 2013 TRANS.TBL
2,配置本地的yum源:
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 24
-rw-r--r--. 1 root root 1991 Aug 4 00:13 CentOS-Base.repo
-rw-r--r--. 1 root root 647 Aug 4 00:13 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 289 Aug 4 00:13 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Aug 4 00:13 CentOS-Media.repo
-rw-r--r--. 1 root root 6259 Aug 4 00:13 CentOS-Vault.repo
[root@localhost yum.repos.d]# vim CentOS-Media.repo
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt/Packages/ #####改成掛載的地址
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=1 #####啟用本地的yum源
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
-- INSERT --
3,禁用預設的yum網路源,否則會現在網路中尋找合適的包,改名後直接從本地源進行讀取
[[email protected] yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
[[email protected] yum.repos.d]#
4,執行yum源更新命令:
[[email protected] ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base c6-media extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[[email protected] ~]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.btte.net
* c6-media:
* extras: mirrors.btte.net
* updates: mirrors.nwsuaf.edu.cn
base | 3.7 kB 00:00
base/group_gz | 219 kB 00:00
base/filelists_db | 6.3 MB 00:00
base/primary_db | 4.6 MB 00:00
base/other_db | 2.8 MB 00:00
[[email protected] ~]# yum update
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* c6-media:
* extras: mirrors.btte.net
* updates: mirrors.nwsuaf.edu.cn
[[email protected] ~]#
備註:關於repo 檔案的格式
所有repository 伺服器設定都應該遵循如下格式:
[
serverid] name=Some name for this server baseurl=url://path/to/repository/
serverid 是用於區別各個不同的repository,必須有一個獨一無二的名稱;
name 是對repository 的描述,支援像basearch這樣的變數;
baseurl 是伺服器設定中最重要的部分,只有設定正確,才能從上面獲取軟體。它的格式是:
baseurl=url://server1/path/to/repository/ url://server2/path/to/repository/ url://server3/path/to/repository/
其中url 支援的協議有 http:// ftp:// file:// 三種。baseurl 後可以跟多個url,你可以自己改為速度比較快的映象站,但baseurl 只能有一個,也就是說不能像如下格式:
baseurl=url://server1/path/to/repository/ baseurl=url://server2/path/to/repository/ baseurl=url://server3/path/to/repository/
其中url 指向的目錄必須是這個repository header 目錄的上一級,它也支援basearch 這樣的變數。 url 之後可以加上多個選項,如gpgcheck、exclude、failovermethod 等,比如:
(四)配置國內yum源
系統預設的是國外的yum源,速度較慢,如何使用國內的yum源,以國內網易的163yum源為例: 1,下載repo檔案
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# wget http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
2,備份並替換repo檔案
[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost ~]# mv CentOS7-Base-163.repo CentOS-Base.repo
3,執行yum源更新命令
[root@localhost ~]# yum clean all
root@localhost ~]# yum makecache
[root@localhost ~]# yum update
4,匯入GPG KEY
yum 可以使用gpg 對包進行校驗,確保下載包的完整性,所以我們先要到各個repository 站點找到gpg key(由於我們使用的是163,可以在163官網上下載然後匯入即可,下圖),一般都會放在首頁的醒目位置,一些名字諸如RPM-GPG-KEY-CentOS-5 之類的純文字檔案,把它們下載下來,然後用rpm –import RPM-GPG-KEY-CentOS-7命令將key 匯入
[[email protected] yum.repos.d]# wget http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
--2015-12-24 13:59:16-- http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
Resolving mirrors.163.com... 123.58.173.185, 123.58.173.186
Connecting to mirrors.163.com|123.58.173.185|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1706 (1.7K) [application/octet-stream]
Saving to: “RPM-GPG-KEY-CentOS-7”
100%[==========================================================>] 1,706 --.-K/s in 0s
2015-12-24 13:59:23 (118 MB/s) - “RPM-GPG-KEY-CentOS-6” saved [1706/1706]
[[email protected] yum.repos.d]# rpm --import RPM-GPG-KEY-CentOS-7
[[email protected] yum.repos.d]#
或者直接把該檔案複製到/etc/pki/rpm-gpg/目錄下即可
[[email protected] yum.repos.d]# cp RPM-GPG-KEY-CentOS-6 /etc/pki/rpm-gpg/
備註:以下是相關的配置檔案的解釋
[[email protected] yum.repos.d]# more CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
關於變數
- $releasever:代表發行版的版本,從[main]部分的distroverpkg獲取,如果沒有,則根據redhat-release包進行判斷。
- $arch:cpu體系,如i686,athlon等
- $basearch:cpu的基本體系組,如i686和athlon同屬i386,alpha和alphaev6同屬alpha
其他國內yum源列表如下:
(五)使用第三方軟體庫
Centos/RHEL預設的yum軟體倉庫非常有限,僅僅限於發行版本那幾張盤裡面的常規包和一些軟體包的更新,利用RpmForge,可以增加非常多的第三方rpm軟體包。RpmForge庫現在已經擁有超過10000種的CentOS的軟體包,被CentOS社群認為是最安全也是最穩定的一個第三方軟體庫。
1、安裝yum-priorities外掛
這個外掛是用來設定yum在呼叫軟體源時的順序的。因為官方提供的軟體源,都是比較穩定和被推薦使用的。因此,官方源的順序要高於第三方源的順序。如何保證這個順序,就需要安裝yum-priorities這外掛了。
[[email protected] yum.repos.d]# yum install yum-priorities
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-priorities.noarch 0:1.1.30-30.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
yum-plugin-priorities noarch 1.1.30-30.el6 base 25 k
Transaction Summary
====================================================================================================
Install 1 Package(s)
Total download size: 25 k
Installed size: 28 k
Is this ok [y/N]: y
Downloading Packages:
yum-plugin-priorities-1.1.30-30.el6.noarch.rpm | 25 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : yum-plugin-priorities-1.1.30-30.el6.noarch 1/1
Verifying : yum-plugin-priorities-1.1.30-30.el6.noarch 1/1
Installed:
yum-plugin-priorities.noarch 0:1.1.30-30.el6
Complete!
[[email protected] yum.repos.d]#
2、安裝完yum-priorities外掛後需要設定/etc/yum.repos.d/ 目錄下的.repo相關檔案(如CentOS-Base.repo),在這些檔案中插入順序指令:priority=N (N為1到99的正整數,數值越小越優先)
一般配置[base], [addons], [updates], [extras] 的priority=1,[CentOSplus], [contrib] 的priority=2,其他第三的軟體源為:priority=N (推薦N>10)
以CentOS-Base.repo 為例:
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
3、下載與安裝相應rpmforge的rpm檔案包
# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
[[email protected] yum.repos.d]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
Resolving tree.repoforge.org... 78.46.17.228
Connecting to tree.repoforge.org|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
--2015-12-24 14:28:26-- http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
Resolving apt.sw.be... 193.1.193.67
Connecting to apt.sw.be|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12680 (12K) [application/x-redhat-package-manager]
Saving to: “rpmforge-release-0.5.2-2.el5.rf.i386.rpm”
100%[==========================================================>] 12,680 --.-K/s in 0s
2015-12-24 14:28:26 (400 MB/s) - “rpmforge-release-0.5.2-2.el5.rf.i386.rpm” saved [12680/12680]
[[email protected] yum.repos.d]# ll
total 48
-rw-r--r--. 1 root root 2017 Dec 24 14:21 CentOS-Base.repo
-rw-r--r--. 1 root root 1991 Aug 4 00:13 CentOS-Base.repo.bak
-rw-r--r--. 1 root root 647 Aug 4 00:13 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 289 Aug 4 00:13 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 641 Dec 24 14:22 CentOS-Media.repo
-rw-r--r--. 1 root root 6259 Aug 4 00:13 CentOS-Vault.repo
-rw-r--r--. 1 root root 12680 Nov 13 2010 rpmforge-release-0.5.2-2.el5.rf.i386.rpm
-rw-r--r--. 1 root root 1706 Jul 10 2011 RPM-GPG-KEY-CentOS-7
4、安裝DAG的PGP Key
# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
[[email protected] yum.repos.d]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
[[email protected] yum.repos.d]#
5、驗證rpmforge的rpm檔案包
# rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
[[email protected] yum.repos.d]# rpm -K rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpmforge-release-0.5.2-2.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK
[[email protected] yum.repos.d]#
6、安裝rpmforge的rpm檔案包
# rpm -i rpmforge-release-0.5.2-2.el5.rf.i386.rpm
[[email protected] yum.repos.d]# rpm -i rpmforge-release-0.5.2-2.el5.rf.i386.rpm
[[email protected] yum.repos.d]#
7、設定/etc/yum.repos.d/rpmforge.repo檔案中源的級別
[[email protected] yum.repos.d]# cat /etc/yum.repos.d/rpmforge.repo
### Name: RPMforge RPM Repository for RHEL 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/extras
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/testing
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-testing
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
[[email protected] yum.repos.d]#
8、測試安裝
# yum install htop
[[email protected] yum.repos.d]# yum install htop
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
* rpmforge: ftp.riken.jp
rpmforge | 1.9 kB 00:00
rpmforge/primary_db | 7.0 MB 00:01
2507 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.3-1.el5.rf will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
htop x86_64 1.0.3-1.el5.rf rpmforge 97 k
Transaction Summary
====================================================================================================
Install 1 Package(s)
Total download size: 97 k
Installed size: 207 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.3-1.el5.rf.x86_64.rpm | 97 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : htop-1.0.3-1.el5.rf.x86_64 1/1
Verifying : htop-1.0.3-1.el5.rf.x86_64 1/1
Installed:
htop.x86_64 0:1.0.3-1.el5.rf
Complete!
[[email protected] yum.repos.d]#
(六)yum自建倉庫
1, 準備材料: N個rpm包,比如我把CENTOS7安裝映象中的Packages目錄複製到指定的目錄
[[email protected] Packages]# mkdir /home/repo
[[email protected] Packages]# cp de* /home/repo/
[[email protected] Packages]