CentOS 本地yum源配置

來源:互聯網
上載者:User

標籤:設定檔   enabled   media   file   光碟片   

載本地光碟片到系統:把Cent6.2安裝光碟片放入光碟機,在終端命令列下操作
      mkdir /mnt  #建立掛載目錄
      mount /dev/cdrom  /mnt#掛載光碟片到/mnt目錄下
      cd  /mnt #進入掛載目錄

Ls 查看掛載目錄,

650) this.width=650;" style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border-top:#ddd 1px solid;border-right:#ddd 1px solid;" src="/e/u261/themes/default/images/spacer.gif" width="553" height="318" alt="spacer.gif" />

配置本地yum源
      cd /etc/yum.repos.d/   #進入yum配置目錄
      vi  CentOS-Media.repo   #編輯設定檔,添加以下內容:

1.1 [GuangPan]  

2.2 name=CentOS-$releasever - Media #自訂名稱  

3.3 baseurl=file:///mnt/ #本地光碟片掛載路徑  

4.4 gpgcheck=0 #檢查GPG-KEY,0為不檢查,1為檢查  

5.5 enabled=1 #啟用yum源,0為不啟用,1為啟用 

如:

650) this.width=650;" style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border-top:#ddd 1px solid;border-right:#ddd 1px solid;" src="/e/u261/themes/default/images/spacer.gif" width="557" height="311" alt="spacer.gif" />

注意:CentOS需要將/etc/yum.rpos. d/目錄下的CentOS-Base.repo  CentOS-Debuginfo.repo檔案進行改名,這樣就可以繞過網路進行本地源的安裝。
具體命令如下:

1. cd /etc/yum.repos.d/  

2.2 mv CentOS-Base.repo CentOS-Base.repo123  

3.3 mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo123 

測試本地yum源是否配置成功:

CentOS 本地yum源配置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.