How to configure domestic sources in CentOS8 yum/dnf

How to configure domestic sources in CentOS8 yum/dnf

CentOS 8 changed the software package installation program, canceled 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 configuration files and commands used by yum. However, I don’t know how long this compatible configuration will last and whether the path of the domestic image (Alibaba Cloud image is used here) will be modified, so I added a temporary sign in the title.

There is no need to explain too much here, just go to 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 requires the CD to be mounted to the /media/CentOS path, otherwise an error will be reported when using it.

Then execute the following command:

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

Summarize

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

You may also be interested in:
  • Detailed tutorial on configuring local yum source in CentOS8
  • How to configure local YUM on CentOS 6.5
  • How to build YUM in Centos7 environment

<<:  Summary of MySQL slow log practice

>>:  Analysis of uniapp entry-level nvue climbing pit record

Recommend

Install Tomcat on Linux system and configure Service startup and shutdown

Configure service startup and shutdown in Linux s...

How to add configuration options to Discuz! Forum

Discuz! Forum has many configuration options in th...

Detailed explanation of mktemp, a basic Linux command

mktemp Create temporary files or directories in a...

vue.js downloads pictures according to picture url

Recently, when I was working on a front-end vue.j...

Detailed graphic explanation of sqlmap injection

Table of contents 1. We found that this website m...

Implementing parameter jump function in Vue project

Page Description:​ Main page: name —> shisheng...

Detailed description of the function of meta name="" content="

1. Grammar: <meta name="name" content...

JavaScript implements password box verification information

This article example shares the specific code of ...

Let's talk about the difference between containers and images in Docker

What is a mirror? An image can be seen as a file ...

CocosCreator Skeleton Animation Dragon Bones

CocosCreator version 2.3.4 Dragon bone animation ...

Native js encapsulation seamless carousel function

Native js encapsulated seamless carousel plug-in,...

js tag syntax usage details

Table of contents 1. Introduction to label statem...

Document Object Model (DOM) in JavaScript

Table of contents 1. What is DOM 2. Select elemen...