centos8 配置阿里云yum源
本地yum源配置方法
备份/etc/yum.repos.d中的文件
cd /etc/yum.repos.d
touch CentOS-Base.repo
vim CentOS-Base.repo
mnt /dev/cdrom /mnt/cdrom 挂载镜像文件
[BaseOS]
name=CentOS-BaseOS
baseurl=file:///mnt/cdrom/BaseOS
gpgcheck=0
enabled=1
[APP]
name=CentOS-APP
baseurl=file:///mnt/cdrom/AppStream
gpgcheck=0
enabled=1
阿里云yum源配置方法 (要有网)
- cd /etc/yum.repo.d
- touch CentOS-AppStream.repo CentOS-BaseOS.repo CentOS-Extras.repo
- 编辑各个文件内容
CentOS-AppStream.repo
[aliyun-AppStream]
name=CentOS-$releasever - AppStream
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
CentOS-BaseOS.repo
[aliyun-BaseOS]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
CentOS-Extras.repo
[aliyun-extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
- dnf -y install epel-release
- dnf clean all
- dnf makecache
- dnf repolist
屌屌屌
帅帅帅