centos6.4配置本地源yum

來源:互聯網
上載者:User

centos6.4配置本地源yum  在當我們安裝centos6.4而又不能連網時,那麼我們的yum命令是用不了的,這是我們可以配置本地源使用yum命令   1.配置repo檔案,   cd /etc/yum.repos.d   備份好原有的設定檔   mv CentOS-Base.repo CentOS-Base.repo.bak   mv  CentOS-Debuginfo.repo  CentOS-Debuginfo.repo.bak   mv  CentOS-Vault.repo CentOS-Vault.repo.bak   mv  CentOS-Media.repo CentOS-Media.repo.bak    建立新的設定檔 vim CentOS-Debuginfo.repo [debug]name=centosbaseurl=file:///mntenabled=1gpgcheck=0gpgkey=file:///mnt/RPM-GPG-KEY-redhat-release    :wq 儲存   2.配置yumRepo.py檔案,      cd /usr/lib/python2.6/site-packages/yum   vim yumRepo.py   將   remote = url + ‘/’ + relative    改為   remote = "/mnt" + '/' + relative   :wq 儲存修改   3 配置iso掛載檔案   mount /dev/cdrom /mnt    4 驗證測試(使用vsftpd)  rpm -qa |grep vsftpd  yum list |grep vsftpd [root@hsj2 yum]# yum list |grep vsftpdvsftpd.i686                              2.2.2-11.el6_3.1                  @debug   yum install  vsftpd.i686   [root@hsj2 yum]# yum install vsftpd.i686Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfileSetting up Install ProcessResolving DependenciesThere are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.--> Running transaction check---> Package vsftpd.i686 0:2.2.2-11.el6_3.1 will be installed--> Finished Dependency Resolution Dependencies Resolved ================================================================================================================= Package                 Arch                  Version                              Repository              Size=================================================================================================================Installing: vsftpd                  i686                  2.2.2-11.el6_3.1                     debug                  157 k Transaction Summary=================================================================================================================Install       1 Package(s) Total download size: 157 kInstalled size: 344 kIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum.** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:glibc-2.12-1.107.el6_4.4.i686 is a duplicate with glibc-2.12-1.107.el6.i686glibc-common-2.12-1.107.el6_4.4.i686 is a duplicate with glibc-common-2.12-1.107.el6.i686  Installing : vsftpd-2.2.2-11.el6_3.1.i686                                                                  1/1  Verifying  : vsftpd-2.2.2-11.el6_3.1.i686                                                                  1/1 Installed:  vsftpd.i686 0:2.2.2-11.el6_3.1 Complete!   驗證ok,成功  

聯繫我們

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