CentOS配置本地yum源

來源:互聯網
上載者:User

標籤:mirror   release   repo   pip   shm   光碟機   register   ack   log   

配置本地yum源的方法    1.利用光碟機掛載鏡像配置    1.1首先把光碟片放在光碟機中,若此時光碟機已經掛載請用umount命令先把光碟機umount掉    1.2建立相關目錄,建立local.repo 檔案  [[email protected] ~]# mkdir /mnt/yum/  [[email protected] ~]# mount  /dev/hdc  /mnt/yum[[email protected] ~]# vi /etc/yum.repos.d/local.repo    #添加以下內容    [iso]name=CentOS-$releasever - isobaseurl=file:///mnt/yumgpgcheck=0enabled=1   1.3 查看配置的yum源  [[email protected] ~]# yum  clean all [[email protected] ~]# yum repolistLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfilerepo id                                                          repo name                                                               statusiso                                                              CentOS-5 - iso                                                          2,791repolist: 2,791[[email protected] ~]# yum  list   Loaded plugins: rhnplugin, security  This system is not registered with RHN.  RHN support will be disabled.  base                                                                       | 1.3 kB     00:00       base/primary            ####################################                                                   這樣 yum倉庫就建好了        2.利用本地檔案目錄建立yum 倉庫    2.1把光碟片放入光碟機  mount  /dev/hdc  /mnt  [[email protected] ~]# mount /dev/hdc  /mnt/  mount: block device /dev/hdc is write-protected, mounting read-only    注意:存放YUM源的目錄必須有可寫入權限,不然在createrepo時會報錯。    2.2將光碟片檔案複製到YUM目錄  [[email protected] ~]# umount /dev/hdc  [[email protected] ~]# mount /dev/hdc  /mnt/  mount: block device /dev/hdc is write-protected, mounting read-only  [[email protected] ~]# mount  /dev/sda1 on / type ext3 (rw)  proc on /proc type proc (rw)  sysfs on /sys type sysfs (rw)  devpts on /dev/pts type devpts (rw,gid=5,mode=620)  /dev/sda2 on /home type ext3 (rw)  tmpfs on /dev/shm type tmpfs (rw)  none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)  sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)  /dev/hdc on /mnt type iso9660 (ro)    [[email protected] ~]# cd /mnt/  [[email protected] mnt]# ls -ld Server/  dr-xr-xr-x 3 root root 217088 05-19 05:11 Server/    2.2 拷貝Server目錄  [[email protected] mnt]# cp -r Server/ /yum/    2.3安裝createrepo  [[email protected] ~]# cd /yum/Server/  [[email protected] Server]# rpm  -ivh createrepo-0.4.11-3.el5.noarch.rpm   warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186  Preparing...                ########################################### [100%]          package createrepo-0.4.11-3.el5.noarch is  installed    2.4建立本地源  # createrepo  -g  /yum/Server/repodata/comps-rhel5-server-core.xml  /yum/Server    [[email protected] ~]# vi /etc/yum.repos.d/local.repo     [base]  name=local  baseurl=file:///yum/Server  gpgcheck=0  enabled=1      [[email protected] ~]# yum  list  Loaded plugins: rhnplugin, security  This system is not registered with RHN.  RHN support will be disabled.  base                                                                       | 1.3 kB     00:00       base/primary            ####################################                           以同樣的方式建立VT,CLUSTER,CLUSTERSTORAGE的yum源  要注意baseurl後為file:/// “三個斜杠”  

 

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.