A,配置国内源------>>>>阿里yum源
<1>,vi /etc/yum.repos.d/XXX.repo
------------(自定义repo是名字可随意,但后缀一定要遵守格式XXX.repo)
[AppStream]
name=CentOS-$releasever-AppStream
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
># a,(若系统是centos系,则对应的gpgkey指向就要改变
>#可设置为------>>>gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial )
># b,gpgkey 会在命令yum makecache运行后同步到本地系统的/etc/pki/rpm-gpg/目录下
[BaseOS]
name=CentOS-$releasever-Base
baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
># c,(若系统是centos系,则对应的gpgkey指向就要改变
># 可设置为------>>>gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
> )
[epel]
name=CentOS-$releasever-Epel
baseurl=http://mirrors.aliyun.com/epel/8/Everything/$basearch
enabled=1
gpgcheck=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
># d,(若系统是centos系,则对应的gpgkey指向就要改变
>#可设置为------>>>gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
> )
2,yum clean all -------清理yum包
3, yum makecache --------重新缓存yum包
yum 可能用到的命令:
####### yum remove xxx(wget) -----------卸载某个命令(示例卸载的是wget)
####### yum -y install epel-release ---------- 下载第三方 epel源
####### yum provides semanage ----------查看semanage这个命令所属的安装包
####### yum provides netstat ---------查看netstat这个命令所属的安装包
< ####### yum provides semanage
policycoreutils-python-utils-2.9-9.el8.noarch : SELinux policy core python utilities
Repo : BaseOS
Matched from:
Filename : /usr/sbin/semanage< ####### yum provides netstat
net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools
B, centos 8 快速配置阿里yum源
wget -O /etc/yum.repos.d/aliyuan.repo http://mirrors.aliyun.com/repo/Centos-8.repo
C, centos7 使用阿里的epel源:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
D,centos7 更换阿里yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i 's#enabled=1#enabled=0#g' /etc/yum.repos.d/CentOS-Media.repo
yum clean all && yum makecache