CentOS8 配置CentOS-Base.repo文件内容
时间: 2024-06-13 10:06:02 浏览: 480
以下是配置CentOS-Base.repo文件内容的步骤:
1. 进入/etc/yum.repos.d/目录。
2. 备份原有的CentOS-Base.repo文件,以防操作失误。
3. 创建一个新的CentOS-Base.repo文件并打开编辑器。
4. 将以下内容复制到文件中:
```
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
#additional packages that extend functionality of existing packages
[appstream]
name=CentOS-$releasever - AppStream
baseurl=http://mirror.centos.org/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
```
5. 保存并关闭文件。
6. 运行以下命令更新缓存:
```
sudo yum makecache
```
阅读全文