yum源使用出现问题
- CentOS-Base.repo
- The mirror system uses the connecting IP address of the client and the
- update status of each mirror to pick mirrors that are updated to and
- geographically close to the client. You should use this for CentOS updates
- unless you are manually picking other mirrors.
- If the mirrorlist= does not work for you, as a fall back you can try the
- remarked out baseurl= line instead.
yum源不能用?想换yum源?比如,换成清华的?
CentOS-Base.repo
The mirror system uses the connecting IP address of the client and the
update status of each mirror to pick mirrors that are updated to and
geographically close to the client. You should use this for CentOS updates
unless you are manually picking other mirrors.
If the mirrorlist= does not work for you, as a fall back you can try the
remarked out baseurl= line instead.
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/ r e l e a s e v e r / o s / releasever/os/ releasever/os/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/ r e l e a s e v e r / u p d a t e s / releasever/updates/ releasever/updates/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/ r e l e a s e v e r / e x t r a s / releasever/extras/ releasever/extras/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/ r e l e a s e v e r / c e n t o s p l u s / releasever/centosplus/ releasever/centosplus/basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=KaTeX parse error: Expected 'EOF', got '&' at position 11: releasever&̲arch=basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
换完之后,你发现还是不能用,出现如下报错:
https://mirrors.tuna.tsinghua.edu.cn/centos/
r
e
l
e
a
s
e
v
e
r
/
o
s
/
x
8
6
6
4
/
r
e
p
o
d
a
t
a
/
r
e
p
o
m
d
.
x
m
l
:
[
E
r
r
n
o
14
]
H
T
T
P
S
E
r
r
o
r
404
−
N
o
t
F
o
u
n
d
这个时候你是不是可能觉得
y
u
m
源地址出现了问题?你可以把这个地址用浏览器打开,你会发现,这个网页同样是
404
但你把
releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found 这个时候你是不是可能觉得yum源地址出现了问题? 你可以把这个地址用浏览器打开,你会发现,这个网页同样是404 但你把
releasever/os/x8664/repodata/repomd.xml:[Errno14]HTTPSError404−NotFound这个时候你是不是可能觉得yum源地址出现了问题?你可以把这个地址用浏览器打开,你会发现,这个网页同样是404但你把releasever这个变量换成值就行了,比如centos7就填个7,这样就能正常访问了。那就说明,这个网址是没问题的,问题是出在centos解析不了releasever这个变量,把repo文本里的变量全部替换成相应的数值就行了。