CentOS 8更改了安裝程序,改而使用了dnf 做爲安裝程序。雖然新增了軟件包的安裝方式,可是 yum命令仍是能夠正常使用。
centos8 配置阿里源vim
一、備份CentOS-Base.repo文件 cd /etc/yum.repos.d cp CentOS-Base.repo CentOS-Base.repo.bak 二、配置文件vim tOS- CentOS-Base.repo # CentOS-Base.repo The mirror system uses the connecting IP address of the client and the #update status of each mirror to pick mirrors that are updated to and #eographically close to the client. You should use this for CentOS updates #nless you are manually picking other mirrors. [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [PowerTools] name=CentOS-$releasever - PowerTools - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [AppStream] name=CentOS-$releasever - AppStream - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
最後執行命令:centos
dnf clean all # 清除全部的緩存文件 dnf makecache # 製做元數據緩存