網路配置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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- redhat 5.5 配置網路yum源Redhat
- yum 配置源
- 配置yum源
- centos同步yum源到本地,建立本地網路yum源CentOS
- yum本地源和外網源的配置方法
- CentOS 配置yum源CentOS
- yum源配置大全
- Centos-Stream 配置本地yum源和配置阿里雲yum源CentOS阿里
- Linux yum源配置以及yum命令講解Linux
- CentOS6.9配置yum源CentOS
- oel 7 本地yum源配置
- Centos 7 常用yum源配置CentOS
- Centos系統配置yum源CentOS
- CentOS6.8配置yum源CentOS
- centos7.5配置yum源CentOS
- RHEL7 yum源配置
- CentOS7--配置yum源CentOS
- Redhat 7使用CentOS 7的Yum網路源RedhatCentOS
- 小知識:CentOS配置yum源/解決yum源失效問題CentOS
- Centos7配置阿里epel源|yum源CentOS阿里
- centos7實現上網和管理網路yum源CentOS
- Linux系統配置本地yum源Linux
- centos-7.6配置本地yum源CentOS
- CentOS7 配置 163 yum 源CentOS
- CentOS 7 配置 阿里雲 yum源CentOS阿里
- 02_2__配置本地YUM源
- linux配置本地ISO的yum源Linux
- RedHat8 配置本地yum源Redhat
- RHEL6搭建網路yum源軟體倉庫
- CentOS7配置yum國內源CentOS
- CentOS8配置阿里雲YUM源CentOS阿里
- Centos8.x yum 源配置 解決 yum 不可用CentOS
- Vmware配置Centos7配置yum源(新手小白福音)CentOS
- linux6 聯網yum 源Linux
- Linux網路-Yum倉庫Linux
- CentOS7 yum源修改為阿里,配置阿里epel源CentOS阿里
- centos系統配置yum的國內映象源CentOS
- CentOS6配置清華大學yum源CentOS
- linux配置本地yum源 centos7.9為例LinuxCentOS