默认仓库位置:
# cd /etc/yum.repos.d/
//查看所有的源
# ll -h
------------------------------------------------
-rw-r--r--. 1 root root 2.5K 6月 16 2018 CentOS-Base.repo
-rw-r--r--. 1 root root 1.7K 11月 23 2018 CentOS-Base.repo.bak
-rw-r--r--. 1 root root 1.3K 11月 23 2018 CentOS-CR.repo
-rw-r--r--. 1 root root 649 11月 23 2018 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 11月 23 2018 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 11月 23 2018 CentOS-Media.repo
-rw-r--r-- 1 root root 998 12月 11 2018 CentOS-SCLo-scl.repo
-rw-r--r-- 1 root root 971 10月 29 2018 CentOS-SCLo-scl-rh.repo
-rw-r--r--. 1 root root 1.3K 11月 23 2018 CentOS-Sources.repo
-rw-r--r--. 1 root root 5.6K 11月 23 2018 CentOS-Vault.repo
-rw-r--r-- 1 root root 1.1K 9月 18 2019 epel.repo
-rw-r--r-- 1 root root 1.2K 9月 18 2019 epel-testing.repo
-rw-r--r--. 1 root root 261 8月 10 2019 MariaDB.repo
-rw-r--r-- 1 root root 2.1K 4月 25 2019 mysql-community.repo
-rw-r--r-- 1 root root 2.1K 4月 25 2019 mysql-community-source.repo
-rw-r--r--. 1 root root 113 7月 15 2014 nginx.repo
-rw-r--r-- 1 root root 5.1K 4月 17 2019 pgdg-redhat-all.repo
-rw-r--r--. 1 root root 446 3月 8 2019 remi-glpi91.repo
-rw-r--r--. 1 root root 446 3月 8 2019 remi-glpi92.repo
-rw-r--r--. 1 root root 446 3月 8 2019 remi-glpi93.repo
-rw-r--r--. 1 root root 446 3月 8 2019 remi-glpi94.repo
-rw-r--r--. 1 root root 855 3月 8 2019 remi-modular.repo
-rw-r--r--. 1 root root 456 3月 8 2019 remi-php54.repo
-rw-r--r--. 1 root root 1.3K 3月 8 2019 remi-php70.repo
-rw-r--r--. 1 root root 1.3K 3月 8 2019 remi-php71.repo
-rw-r--r--. 1 root root 1.3K 3月 8 2019 remi-php72.repo
-rw-r--r--. 1 root root 1.3K 3月 8 2019 remi-php73.repo
-rw-r--r--. 1 root root 2.6K 3月 8 2019 remi.repo
-rw-r--r--. 1 root root 750 3月 8 2019 remi-safe.repo
-rw-r--r-- 1 root root 853 7月 3 22:52 zabbix.repo
查看yum的包有多少个
# yum repolist all //所有
# yum repolist //启用中的
删除yum的仓库文件
# rm -rf xxxx.repo
刷新yum的仓库文件
# yum clean all
# yum makecache
使用国内的仓库
#更换国内镜像
#cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
#使用的是阿里巴巴开源镜像站,文件地址:
https://developer.aliyun.com/mirror/
#wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
#yum makecache
我们将在 EOL 后的六个月内继续提供 Centos 8,并将很快将 Centos 8 发行版标记为已弃用,以免造成进一步的混乱。
CentOS-Linux-BaseOS.repo
#baseurl=http://mirrors.linode.com/$contentdir/$releasever/BaseOS/$basearch/os/
CentOS-Linux-AppStream.repo
#baseurl=http://mirrors.linode.com/$contentdir/$releasever/AppStream/$basearch/os/
将以下行添加到每个相应的文件:
CentOS-Linux-BaseOS.repo
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
CentOS-Linux-AppStream.repo
baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/