001 centos6、redhat6 安装yum
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了001 centos6、redhat6 安装yum,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2811字,纯文字阅读大概需要5分钟。
内容图文
问题
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
- http://mirrors.aliyun.com/centos替换成https://vault.centos.org
- $releasever替换成6.7
- 删除releasever
修改后的文件如下
#
# 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
看到下面的情形就是配置好了
内容总结
以上是互联网集市为您收集整理的001 centos6、redhat6 安装yum全部内容,希望文章能够帮你解决001 centos6、redhat6 安装yum所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。