redhat7.2配置yum源-创新互联
redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题。
1、首先删除redhat原有的yum ,因为redhat 原本的yum 没有注册为redhat用户是用不了的。
rpm -aq|grep yum|xargs rpm -e --nodeps
rpm -aq|grep python-iniparse|xargs rpm -e --nodeps
2、下载163的yum 安装包
# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm
# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
# wget http://mirrors.163.com/centos/7/os/x86_64/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
3、安装下载的rpm包
rpm -ivh *.rpm
4、创建文件/etc/yum.repos.d/rhel-debuginfo.repo并写入,若没有vim时使用下面方法创建rhel-debuginfo.repo文件
echo '[base]' >rhel-debuginfo.repo
echo 'name=CentOS-$releasever - Base' >>rhel-debuginfo.repo
echo 'baseurl=http://mirrors.163.com/centos/7/os/$basearch/' >>rhel-debuginfo.repo
echo 'gpgcheck=1' >>rhel-debuginfo.repo
echo 'gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-7' >>rhel-debuginfo.repo
echo '#released updates' >>rhel-debuginfo.repo
echo '[updates]' >>rhel-debuginfo.repo
echo 'name=CentOS-$releasever - Updates' >>rhel-debuginfo.repo
echo 'baseurl=http://mirrors.163.com/centos/7/updates/$basearch/' >>rhel-debuginfo.repo
echo 'gpgcheck=1' >>rhel-debuginfo.repo
echo 'gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-7' >>rhel-debuginfo.repo
echo '[extras]' >>rhel-debuginfo.repo
echo 'name=CentOS-$releasever - Extras' >>rhel-debuginfo.repo
echo 'baseurl=http://mirrors.163.com/centos/7/extras//$basearch/' >>rhel-debuginfo.repo
echo 'gpgcheck=1' >>rhel-debuginfo.repo
echo 'gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-7' >>rhel-debuginfo.repo
echo '[centosplus]' >>rhel-debuginfo.repo
echo 'name=CentOS-$releasever - Plus' >>rhel-debuginfo.repo
echo 'baseurl=http://mirrors.163.com/centos/7/centosplus//$basearch/' >>rhel-debuginfo.repo
echo 'gpgcheck=1' >>rhel-debuginfo.repo
echo 'enabled=0' >>rhel-debuginfo.repo
6、 yum clean all
7、 yum update 测试。
8、 安装 epel 源
# yum install epel-release
标题名称:redhat7.2配置yum源-创新互联
网站链接:http://pwwzsj.com/article/dhigoo.html