系统相关
首页 > 系统相关> > 001 centos6、redhat6 安装yum

001 centos6、redhat6 安装yum

作者:互联网

问题

centos6被废弃了,网易的镜像(http://mirrors.163.com)不提供了

查看并卸载以前安装包

# 查看
rpm -qa | grep yum

# 卸载所有相关的yum包,直到用查看命令查看时没有yum相关包
rpm -e --nodeps yum-package

安装

查看系统版本
cat /etc/system-release

在这里插入图片描述
我的版本是redhat 6.7

进入对应的目录下载以下几个文件
wget https://vault.centos.org/6.7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
wget https://vault.centos.org/6.7/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget https://vault.centos.org/6.7/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
wget https://vault.centos.org/6.7/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
安装下载的文件
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
修改源文件

没找到https://vault.centos.org中的CentOS-Base.repo,我们用阿里云的,然后修改下

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.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-6.7 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=https://vault.centos.org/6.7/os/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6.7 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=https://vault.centos.org/6.7/updates/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6.7 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=https://vault.centos.org/6.7/extras/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.7 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=https://vault.centos.org/6.7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.7 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=https://vault.centos.org/6.7/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-6
清理并重新加载缓存
yum clean all
yum makecache

看到下面的情形就是配置好了
在这里插入图片描述

标签:centos,6.7,centos6,001,yum,https,org,vault
来源: https://blog.csdn.net/xiangsimoyinjiu/article/details/114694057