redhat6.7 yum network source configuration

The yum source provided by RedHat can only be used after the current system has registered RHN. If there is no registration, when using yum, you will be prompted to register RHN

If RHN is not registered, it means that we cannot use the yum source of RedHat. At this time, we can use the yum source of CentOS system. Here, take configuring Netease 163yum source as an example.

1. First uninstall the yum program of RedHat resources

[root@Oracle12CDB yum.repos.d]# rpm -qa|grep yum|xargs rpm -e --nodeps
[root@Oracle12CDB yum.repos.d]# rpm -aq|grep python-iniparse|xargs rpm -e --nodeps

2. Delete the source of RedHat yum

[root@Oracle12CDB ~]# cd /etc/yum.repos.d/
[root@Oracle12CDB yum.repos.d]# ls
redhat.repo  rhel-source.repo
[root@Oracle12CDB yum.repos.d]# rm -rf *

3. Install the CentOS source. rpm package requires the installation sequence. I successfully installed it in the following sequence.

rpm -ivh                      
rpm -ivh                  
rpm -ivh -nodeps --force    

#The following two packages failed to be installed separately, and they were installed together
rpm -ivh \    
Here, install yum plugin fastestmirror first, which indicates that the package change depends on yum package, and when installing yum package, it indicates that the package depends on yum plugin fastestmirror package, so two packages are installed together directly

4. Create repo file

[root@Oracle12CDB yum.repos.d]# pwd
[root@Oracle12CDB yum.repos.d]# ls
centos6.repo  redhat.repo

Here are two files

redhat.repo has no content, don't worry. centos6.repo is as follows:

name=CentOS-$releasever - Base

#released updates
name=CentOS-$releasever - Updates

name=CentOS-$releasever - Extras

#additional packages that extend functionality of existing packages
name=CentOS-$releasever - Plus

5. Clear cache, re cache, update

[root@Oracle12CDB yum.repos.d]# yum clean all
[root@Oracle12CDB yum.repos.d]# yum makecache
[root@Oracle12CDB yum.repos.d]# yum update



Tags: PHP yum CentOS RPM Python

Posted on Mon, 04 Nov 2019 14:02:25 -0500 by drag0n