將光碟片設定為yum源相關教程

來源:互聯網
上載者:User

我們都知道yum在centos下需要連網才可以使用,而且受到網速的限制,另外RHEL更加是需要購買紅帽訂閱賬戶才能正常線上進行yum安裝軟體和更新系統。如果使用本地光碟片作為yum的源,速度會更加的快,而且RHEL也可以使用。

1、在光碟機中插入光碟片,也可以掛載iso檔案

2、以root使用者登陸終端

3、執行以下命令,掛載光碟片

[root@centos6 ~]# mkdir /mnt/cdrom[root@centos6 ~]# mount -o ro /dev/cdrom /mnt/cdrom

4、在/etc/yum.repos.d 下建立文字檔server.repo

[root@centos6 ~]# vim /etc/yum.repos.d/server.repo

加入以下內容:

[server]name=serverbaseurl=file:///mnt/cdrom/Workstationenabled=1

其中baseurl的位置取決於光碟片掛載的位置和linux發布的版本。

5、測試yum

[root@centos6 ~]#yum clean[root@centos6 ~]#yum list

可以看到可以安裝的軟體包了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.