CentOS8 yum/dnf configuration method of domestic sources

CentOS 8 changed the installation program of the software package, cancelled the yum configuration method, and used dnf as the installation program instead. Although the installation method of the software package has been changed, dnf is still compatible with the use of yum configuration files and commands. However, I don't know how long this compatible configuration will last and whether the path of the domestic mirror (Alibaba Cloud mirror is used here) will be modified, so I added a temporary logo to the title.

There is not much to explain here, just upload the file:

# file:/etc/yum.repos.d/CentOS-AppStream.repo
[ AppStream]
name=CentOS-$releasever - AppStream
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Copy
# file:/etc/yum.repos.d/CentOS-Base.repo
[ BaseOS]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Copy
# file:/etc/yum.repos.d/CentOS-Epel.repo
[ epel]
name=CentOS-$releasever - Epel
baseurl=http://mirrors.aliyun.com/epel/8/Everything/$basearch
enabled=1
gpgcheck=0
Copy
# file:/etc/yum.repos.d/CentOS-Media.repo
[ c8-media-BaseOS]
name=CentOS-BaseOS-$releasever - Media
baseurl=file:///media/CentOS/BaseOS/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial[c8-media-AppStream]
name=CentOS-AppStream-$releasever - Media
baseurl=file:///media/CentOS/AppStream/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

Note: The CentOS-Media configuration needs to mount the CD to the /media/CentOS path, otherwise an error will be reported during use.

Then execute the following command:

dnf clean all #Clear all cache files
dnf makecache #Make metadata cache

to sum up

The above is the method of CentOS8 yum/dnf configuration domestic source introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message to me. The editor will reply to you in time!

Recommended Posts

CentOS8 yum/dnf configuration method of domestic sources
Ubuntu17.04 configuration method to replace domestic sources
Implementation of CentOS8.0 Network Configuration
Centos7 installation and configuration of Jenkins
CentOS configuration swap exchange area method
CentOS deployment method of flask project
Installation and configuration of redis under centos7
Linux CentOS regularly run script configuration method
Installation and configuration of JDK in CentOS 7 system
Summary of CentOS method to set static IP
CentOS 7.0 network configuration
CentOS7 basic configuration
Installation and configuration of CentOS 7 in VMware Workstation
Centos MySQL8 configuration
Explain the implementation of Centos8 static IP configuration
Distributed deployment of Apollo configuration center under CentOS8
Detailed explanation of static DNS configuration method in Ubuntu
Centos8 (minimal installation) a new installation of Python3.8+pip method tutorial
Example of how to replace domestic sources on Ubuntu 18.04
Environment configuration of JDK, mysql and tomcat under Centos7
Xfs configuration on centos7
Ubuntu18.04 replaces domestic sources
Graphical installation of CentOS8
Mysql8.0.15 installation configuration (centos7)
Docker CentOS installation method
Detailed explanation of Spark installation and configuration tutorial under centOS7