網路配置yum源
1,備份repo
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak
cd /etc/yum.repos.d/
2,下載repo
[root@node1 yum.repos.d]# wget
--2016-09-18 16:13:12--
Resolving mirrors.sohu.com... 221.236.12.140
Connecting to mirrors.sohu.com|221.236.12.140|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2299 (2.2K) [application/octet-stream]
Saving to: `CentOS-Base-sohu.repo'
100%[======================================================>] 2,299 --.-K/s in 0.06s
2016-09-18 16:13:12 (38.1 KB/s) - `CentOS-Base-sohu.repo' saved [2299/2299]
[root@node1 yum.repos.d]# ll
total 16
-rw-r--r-- 1 root root 2299 Dec 31 2009 CentOS-Base-sohu.repo
-rw-r--r-- 1 root root 561 Sep 18 16:00 rhel-debuginfo.repo.bk
-rw-r--r-- 1 root root 561 Mar 10 2010 rhel-debuginfo.repo.repo.bak
3,修改名字
[root@node1 yum.repos.d]# mv CentOS-Base-sohu.repo rhel-debuginfo.repo
4,yum makecache報錯
[root@node1 yum.repos.d]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@node1 yum.repos.d]# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
[Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again
5,替換$releasever 5/6是os版本
[root@node1 yum.repos.d]# vi rhel-debuginfo.repo
$releasever 替換為 5
使用如下命令
:%s/$releasever/5/g
6,再次yum makecache
[root@node1 yum.repos.d]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@node1 yum.repos.d]# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
addons | 1.9 kB 00:00
addons/filelists_db | 574 B 00:00
addons/other_db | 550 B 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/filelists | 3.1 MB 00:05
base/other | 11 MB 00:23
base/group | 1.1 MB 00:03
base/primary | 996 kB 00:09
extras | 2.1 kB 00:00
extras/filelists_db | 212 kB 00:03
extras/other_db | 432 kB 00:08
extras/group | 9.7 kB 00:00
extras/primary_db | 164 kB 00:00
updates | 1.9 kB 00:00
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak
cd /etc/yum.repos.d/
2,下載repo
[root@node1 yum.repos.d]# wget
--2016-09-18 16:13:12--
Resolving mirrors.sohu.com... 221.236.12.140
Connecting to mirrors.sohu.com|221.236.12.140|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2299 (2.2K) [application/octet-stream]
Saving to: `CentOS-Base-sohu.repo'
100%[======================================================>] 2,299 --.-K/s in 0.06s
2016-09-18 16:13:12 (38.1 KB/s) - `CentOS-Base-sohu.repo' saved [2299/2299]
[root@node1 yum.repos.d]# ll
total 16
-rw-r--r-- 1 root root 2299 Dec 31 2009 CentOS-Base-sohu.repo
-rw-r--r-- 1 root root 561 Sep 18 16:00 rhel-debuginfo.repo.bk
-rw-r--r-- 1 root root 561 Mar 10 2010 rhel-debuginfo.repo.repo.bak
3,修改名字
[root@node1 yum.repos.d]# mv CentOS-Base-sohu.repo rhel-debuginfo.repo
4,yum makecache報錯
[root@node1 yum.repos.d]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@node1 yum.repos.d]# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
[Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again
5,替換$releasever 5/6是os版本
[root@node1 yum.repos.d]# vi rhel-debuginfo.repo
$releasever 替換為 5
使用如下命令
:%s/$releasever/5/g
6,再次yum makecache
[root@node1 yum.repos.d]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@node1 yum.repos.d]# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
addons | 1.9 kB 00:00
addons/filelists_db | 574 B 00:00
addons/other_db | 550 B 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/filelists | 3.1 MB 00:05
base/other | 11 MB 00:23
base/group | 1.1 MB 00:03
base/primary | 996 kB 00:09
extras | 2.1 kB 00:00
extras/filelists_db | 212 kB 00:03
extras/other_db | 432 kB 00:08
extras/group | 9.7 kB 00:00
extras/primary_db | 164 kB 00:00
updates | 1.9 kB 00:00
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29108064/viewspace-2125102/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- yum本地源及網路源配置
- redhat 5.5 配置網路yum源Redhat
- CentOS 6 網路yum源配置CentOS
- Linux 網路yum源配置Linux
- 配置yum源
- centos同步yum源到本地,建立本地網路yum源CentOS
- CentOS 配置yum源CentOS
- yum源配置大全
- Centos-Stream 配置本地yum源和配置阿里雲yum源CentOS阿里
- linux 配置yum 源Linux
- Redhat 7使用CentOS 7的Yum網路源RedhatCentOS
- Centos系統配置yum源CentOS
- linux yum源配置方法Linux
- Linux 本地yum源配置Linux
- CentOS6.9配置yum源CentOS
- centos7.5配置yum源CentOS
- Linux yum源配置以及yum命令講解Linux
- 小知識:CentOS配置yum源/解決yum源失效問題CentOS
- Centos7配置阿里epel源|yum源CentOS阿里
- centos7實現上網和管理網路yum源CentOS
- RedHat8 配置本地yum源Redhat
- Linux下配置本地yum源Linux
- RedHat 6下配置本地及網路yum倉庫Redhat
- CentOS配置Nginx官方的Yum源及yum安裝phpCentOSNginxPHP
- RHEL6搭建網路yum源軟體倉庫
- Linux系統配置本地yum源Linux
- linux配置本地ISO的yum源Linux
- ▲▲▲▲▲▲▲▲▲▲▲yum源的配置(本地和ftp)▲▲▲▲▲▲▲▲▲▲▲▲▲vFTP
- redhat6.6配置光碟為yum源Redhat
- CentOS 7 配置 阿里雲 yum源CentOS阿里
- Centos8.x yum 源配置 解決 yum 不可用CentOS
- 【YUM】Redhat5和6YUM源配置的區別Redhat
- Vmware配置Centos7配置yum源(新手小白福音)CentOS
- CentOS8配置阿里雲YUM源CentOS阿里
- [Linux7] HA Package Yum源配置LinuxPackage
- redhat6.5 配置使用centos的yum源RedhatCentOS
- redhat 6 配置 yum 源的兩種方法Redhat
- CentOS7 yum源修改為阿里,配置阿里epel源CentOS阿里