Get the App
SLTechnology News&Howtos  ›  Servers  › 

Redhat7.2 configure yum Feed

Shulou Source: shulou.com Published: 2022-06-02 05:14:53 10月03日 Update

Redhat update package only works for registered users, so we manually change it to CentOS update package. CentOS is almost the same as redhat, so there is no need to worry about whether the package can be installed or whether there are problems after installation.

1. First delete the original yum of redhat, because the original yum of redhat is not registered as redhat users.

rpm -aq|grep yum|xargs rpm -e --nodeps

rpm -aq|grep python-iniparse|xargs rpm -e --nodeps

2. Download the yum installation package for 163

# 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. Install the downloaded rpm package

rpm -ivh *.rpm

4. Create the file/etc/yum.repos.d/rhel-debuginfo.repo and write it. If there is no vim, use the following method to create the rhel-debuginfo.repo file.

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=http://mirrors.163.com/centos/7/os/x86_64/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=http://mirrors.163.com/centos/7/os/x86_64/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=http://mirrors.163.com/centos/7/os/x86_64/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

Yum update test.

8. Install epel source

# yum install epel-release

Tags: File user update original manual method software software package problem test configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Docker Shulou Information Shulou Tech Info Huawei