溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

做一個公共的網(wǎng)絡(luò)yum源

發(fā)布時間:2020-07-04 16:33:14 來源:網(wǎng)絡(luò) 閱讀:1068 作者:冰山劍客 欄目:安全技術(shù)

  一、網(wǎng)絡(luò)YUM源   使用163 yum源  

  1.進(jìn)入http://mirrors.163.com/.help/centos.html網(wǎng)站下載相對應(yīng)的yum文件(

  • CentOS7

  • CentOS6

  • CentOS5)CentOS-Base-163.repo, 放入/etc/yum.repos.d/
     
     2.運(yùn)行yum makecache生成緩存

 

  3.yum search softwarename 查找軟件

 

  4.yum list softwarename 列出已裝軟件

 

  5.yum install softwarename 安裝軟件

 

  6.yun remove softwarename 卸載軟件

 

  (sohu yum源: http://mirrors.shou.com,使用方法相同)

 

  二、本地yum源   使用光盤yum源  

 

  1.掛載光盤
 mount -t iso9660 -o loop /dev/cdrom /media/CentOS
 2.移除/etc/yum.repos.d目錄原有的repo文件
 3.創(chuàng)建新repo文件
 vi /etc/yum.repos.d/CentOS-Media.repo
 加入如下字段:
 [c5-media]
 name=CentOS-$releasever - Media
 baseurl=file:///media/CentOS/
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
 4.刷新repos
 yum makecache

 

  參考 /etc/yum.repos.d/CentOS-Media.repo文件
 # CentOS-Media.repo
 #
 # This repo is used to mount the default locations for a CDROM / DVD on
 # CentOS-5. You can use this repo and yum to install items directly off the
 # DVD ISO that we release.
 #
 # To use this repo, put in your DVD and use it with the other repos too:
 # yum --enablerepo=c5-media [command]
 #
 # or for ONLY the media repo, do this:
 #
 # yum --disablerepo=\* --enablerepo=c5-media [command]
 
 [c5-media]
 name=CentOS-$releasever - Media
 baseurl=file:///media/CentOS/
          file:///media/cdrom/
          file:///media/cdrecorder/
 gpgcheck=1
 enabled=0

 

  ================================================================

 

  另外一種: redhat linux下配置yum源  

   

  使用redhat linux系統(tǒng)自帶的yum源好像要授權(quán),需要費(fèi)用,用CentOS的源免費(fèi),配置簡單

 

  1.#cd /etc/yum.repos.d/     #打開源路徑

 

  2.#wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo #下載CentOS的源

 

  3.#yum install softwarename

 

  附:CentOS使用的yum源是在/etc/yum.repos.d/目錄下的兩個文件中進(jìn)行配置的,其中:

 

  CentOS-Base.repo是配置網(wǎng)絡(luò)yum源

 

  CentOS-Media.repo是配置本地yum源






配置網(wǎng)絡(luò)yum源7:

一 wget -O /etc/yum.repos.d/centos.repo  http://mirrors.aliyun.com/repo/Centos-7.repo


二  sed -i 's/$releasever/7/g' /etc/yum.repos.d/centos.repo

三、清除yum緩存,yum clean all


四、更新一下yum網(wǎng)絡(luò)列表,“yum list”










向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI