日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

CentOS6.5 将安装光盘作为yum源

發(fā)布時(shí)間:2024/9/19 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS6.5 将安装光盘作为yum源 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

前言

  • 網(wǎng)上找適合CentOS6.5的yum源很困難了
  • 替代方案,將安裝光盤(pán)作為yum源
  • 我用的是VMware虛擬機(jī)。嗯,虛擬機(jī)還可以?huà)旃獗P(pán),那要是云主機(jī)呢?可以考慮將文件拷貝到云主機(jī)的某個(gè)目錄,將該目錄作為yum源。
  • CentOS6.5 CD: CentOS-6.5-x86_64-bin-DVD1.iso

基本步驟

  • VMware虛擬機(jī)已經(jīng)添加好光驅(qū),光驅(qū)中放上CentOS6.5安裝盤(pán)。
  • mount命令查看是否已經(jīng)掛接了光驅(qū)。如果已掛接,直接看
    未掛接是這樣的:
  • shell> mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

    已掛接是這樣的:

    shell> mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/sr0 on /mnt/cdrom type iso9660 (ro)
  • 創(chuàng)建光驅(qū)掛載點(diǎn)
  • shell> mkdir /mnt/cdrom
  • 掛載光驅(qū)
  • shell> mount /dev/sr0 /mnt/cdrom mount: block device /dev/sr0 is write-protected, mounting read-only shell> mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/sr0 on /mnt/cdrom type iso9660 (ro)
  • 配置yum源
    先備份
  • shell> cd /etc/yum.repos.d/ shell> mv CentOS-Base.repo CentOS-Base.repo.backup shell> mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.backup shell> mv CentOS-Vault.repo CentOS-Vault.repo.backup shell> cp CentOS-Media.repo CentOS-Media.repo.backup shell> ls CentOS-Base.repo.backup CentOS-Media.repo CentOS-Vault.repo.backup CentOS-Debuginfo.repo.backup CentOS-Media.repo.backup

    再修改

    shell> vi /etc/yum.repos.d/CentOS-Media.repo ---------------------------- [c6-media] name=CentOS-$releasever - Media # 掛載的光盤(pán)路徑 baseurl=file:///mnt/cdrom/ gpgcheck=1 # 啟用此yum源 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  • 檢查yum源
  • shell> yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repo id repo name status c6-media CentOS-6 - Media 6,364+3 repolist: 6,364
  • 查看yum源中是否有wget
  • shell> yum info wget Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Available Packages Name : wget Arch : x86_64 Version : 1.12 Release : 1.8.el6 Size : 482 k Repo : c6-media Summary : A utility for retrieving files using the HTTP or FTP protocols URL : http://www.gnu.org/software/wget/ License : GPLv3+ and GFDL Description : GNU Wget is a file retrieval utility which can use either the HTTP or: FTP protocols. Wget features include the ability to work in the: background while you are logged out, recursive retrieval of: directories, file name wildcard matching, remote file timestamp: storage and comparison, use of Rest with FTP servers and Range with: HTTP servers to retrieve files over slow or unstable connections,: support for Proxy servers, and configurability.
  • 安裝 wget
  • shell> yum -y install wget Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Available Packages Name : wget Arch : x86_64 Version : 1.12 Release : 1.8.el6 Size : 482 k Repo : c6-media Summary : A utility for retrieving files using the HTTP or FTP protocols URL : http://www.gnu.org/software/wget/ License : GPLv3+ and GFDL Description : GNU Wget is a file retrieval utility which can use either the HTTP or: FTP protocols. Wget features include the ability to work in the: background while you are logged out, recursive retrieval of: directories, file name wildcard matching, remote file timestamp: storage and comparison, use of Rest with FTP servers and Range with: HTTP servers to retrieve files over slow or unstable connections,: support for Proxy servers, and configurability.[root@localhost yum.repos.d]# ^C [root@localhost yum.repos.d]# yum -y install wget Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package wget.x86_64 0:1.12-1.8.el6 will be installed --> Finished Dependency ResolutionDependencies Resolved==========================================================================================================Package Arch Version Repository Size ========================================================================================================== Installing:wget x86_64 1.12-1.8.el6 c6-media 482 kTransaction Summary ========================================================================================================== Install 1 Package(s)Total download size: 482 k Installed size: 1.8 M Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running TransactionInstalling : wget-1.12-1.8.el6.x86_64 1/1Verifying : wget-1.12-1.8.el6.x86_64 1/1Installed:wget.x86_64 0:1.12-1.8.el6Complete!

    參考

    https://jingyan.baidu.com/article/425e69e6e033aebe15fc162b.html

    總結(jié)

    以上是生活随笔為你收集整理的CentOS6.5 将安装光盘作为yum源的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。