柠檬 发表于 2021-8-20 01:33:38

CentOS 5.8 yum源无法安装mysql的解决方法

本帖最后由 柠檬 于 2022-1-24 02:41 编辑

由于centos 5 已经停更。于是导致yum源也不能用了
例如安装mysql的时候提示以下信息。
由于默认的yum源地址是mirrorlist=http://mirrorlist.centos.org/,已失效。
我们可以通过更新baseurl来解决。


安装WinSCP软件,并新建站点进行访问
etc/yum.repos.d/CentOS-Base.repo文件。





双击打开“CentOS-Base.repo”这个文件。



将原mirrorlist行注释掉,并在原baseurl下分别添加新的源地址。例如:替换成5.11的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.
#
#


name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates

name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://vault.centos.org/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://vault.centos.org/5.11/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages

name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users

name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://vault.centos.org/5.11/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


点击“保存”。



文件修改完毕后,执行Linux命令
yum clean all
清空yum源缓存后即可正常使用yum命令了。



执行Linux命令:
yum -y install mysql mysql-server mysql-devel
开始安装mysql数据库。








maoyl 发表于 2021-8-20 01:37:53

我只是路过打酱油的。

jdflfl87 发表于 2021-8-24 05:19:34

真是难得给力的帖子啊。

thtyhust 发表于 2021-8-24 14:30:30

真是难得给力的帖子啊。

calmsolemn 发表于 2021-8-24 14:39:39

淡定,淡定,淡定……

blfxdsh 发表于 2021-8-27 06:04:07

真是被感动的痛哭流涕……

ruocan 发表于 2021-8-31 21:19:00

淡定,淡定,淡定……

liushuich 发表于 2021-9-1 01:52:59

无回帖,不论坛,这才是人道。

heeb0957 发表于 2021-9-1 04:22:22

感恩无私的分享与奉献 :)

jhc 发表于 2021-9-5 13:07:11

无回帖,不论坛,这才是人道。
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: CentOS 5.8 yum源无法安装mysql的解决方法