Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure domestic sources for yum/dnf in CentOS8

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to configure domestic sources in yum/dnf in CentOS8". The content is simple and easy to understand, and the organization is clear. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "how to configure domestic sources in yum/dnf in CentOS8".

CentOS 8 changed the installer for packages, removing the yum configuration method and using dnf instead. Although this changes the way packages are installed, dnf is compatible with the configuration files and commands used with yum. However, I don't know how long this compatible configuration will last and whether the path of the domestic mirror (here used is Alibaba Cloud Mirror) will be modified, so I added a temporary flag to the title.

There is no need to explain too much here, directly on the file:

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

Note: CentOS-Media configuration needs to mount the CD 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 The above is "CentOS8 yum/dnf how to configure domestic sources" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report