2018年11月11日 星期日

How to use Centos repo in RHEL(YUM)


How to use Centos repo in RHEL(YUM)

# vi /etc/yum.repos.d/CentOS.repo
Below is example for Redhat 7 use Centos 7 repo

[CentOS7 base]
name=CentOS-7-Base
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=os
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

[CentOS7 updates]
name=CentOS-7-Updates
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=updates
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

[CentOS7plus]
name=CentOS-7-Plus
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

[centos]
name=CentOS $releasever - $basearch
baseurl=http://ftp.heanet.ie/pub/centos/7/os/$basearch/
enabled=1
gpgcheck=0

--------------------------------------
Centos 8 series use ifself repo
#cd /etc/yum.repos.d/
#sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
#sed -i 's
|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
#yum update
-----------------------------------------
Centos 8  repo (2nd way)
[AppStream]
name=CentOS-$releasever - AppStream
#mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[BaseOS]
name=CentOS-$releasever - Base
#mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
----------------------------------------
Redhat 8 use ifself repo (only can use for 8.6 Beta before,  cannot use on 8.6GA)
#vim /etc/yum/pluginconf.d/subscription-manager.conf   
enabled=0
#dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

----------------------------------------
Redhat 8.6 GA
Need apply an ccount from redhat
https://sso.redhat.com/auth/realms/redhat-external/login-actions/registration?client_id=customer-portal&tab_id=EnZf1yLL63Y
上傳進度:已上傳 75273 個位元組 (共 75273 個位元組)。





You will get mail to active your acount




#subscription-manager register
#subscription-manager attach --auto
#yum update




---------------------------------------------------------------------------------------
If you still meet issue, please try clean old yum register data
# subscription-manager remove --all
# subscription-manager unregister
# subscription-manager clean
# yum clean all
# rm -rf /var/cache/yum/*
# subscription-manager register
# subscription-manager attach --auto



沒有留言:

張貼留言

(TOP)Temp for soulin only

123