(注:部分资料来自网络)
CentOS官方早已停止对CentOS6的支持,官方mirror下面的文件已经被移除:
需要通过修改yum源来解决yum报错的问题
修复CentOS6 yum源
打开终端,执行以下命令:
cat >> /etc/yum.repos.d/CentOS-aliyun-lhr.repo <<"EOF"
[base]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
[updates]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.comm/centos-vault/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/epel-archive/RPM-GPG-KEY-EPEL-6
EOF
cat >> /etc/yum.repos.d/CentOS-neusoft-lhr.repo <<"EOF"
[base]
name=CentOS-6-Base
baseurl=http://mirrors.neusoft.edu.cn/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[updates]
name=CentOS-6-Updates
baseurl=http://mirrors.neusoft.edu.cn/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-6-Extras
baseurl=http://mirrors.neusoft.edu.cn/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[centosplus]
name=CentOS-6-Plus
baseurl=http://mirrors.neusoft.edu.cn/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[contrib]
name=CentOS-6-Contrib
baseurl=http://mirrors.neusoft.edu.cn/centos/6/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.neusoft.edu.cn/epel/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.neusoft.edu.cn/epel/RPM-GPG-KEY-EPEL-6
EOF
然后执行yum clean all
和yum makecache
,待执行完成后即可正常使用yum。
解决configure报错
运行./configure
报错一般可能是缺少C/C++环境,执行yum install -y gcc-c++
即可。
编译安装MySQL时报错
编译安装MySQL时出现:
checking for termcap functions library… configure: error: No curses/termca
解决方法:执行下列代码
yum list|grep ncurses
yum -y install ncurses-devel
yum install ncurses-devel
然后重新执行./configure
即可。
声明:
本文采用
BY-NC-SA
协议进行授权,如无注明均为原创,转载请注明转自
Eric · 梦曦
本文地址: 修复CentOS6的yum & 解决configure报错
本文地址: 修复CentOS6的yum & 解决configure报错