wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
阿里源
yum install epel-release
epel-release是一个软件包,它包含了安装EPEL软件仓库所需的文件。当你在CentOS等系统中使用yum或dnf命令安装软件时,如果发现官方仓库中没有你需要的软件包,那么安装epel-release就变得非常有用。安装了epel-release之后,你的系统将会添加一个第三方的软件仓库,从而可以访问到更多的软件包。
centos7,初始化操作 (minglelu.cn)
阿里源
net-tools 是 Linux 下的一个网络配置和监控工具包包含了很多用于网络管理的命令行工具,比如 ifconfig、route、netstat 等。这些工具对于诊断网络问题、配置网络接口和路由表非常有用。
yum install epel-release 软件集合
scl软件仓库用不了
问题原因由于centos7 2024年6月30号停止维护
yum -y install centos-release-scl SCL 是一个软件集合仓库
yum install centos-release-scl-rh 也可以使用这个。
也可以直接手动添加,内容如下
vim CentOS-SCLo-rh.repo
[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
检查软件源
dnf repolist
添加 CentOS Vault 仓库(作为备用):
创建一个 .repo 文件,例如 /etc/yum.repos.d/centos-vault.repo,内容如下:
[centos-vault]
name=CentOS Vault
baseurl=http://vault.centos.org/7.9.2009/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7
ssh-keygen -R 192.168.1.34
清楚密钥。服务器ssh连接变化时