1,配置yum源
1. cd /etc/yum.repos.d/
2. 备份 cp CentOS-Linux-AppStream.repo CentOS-Linux-AppStream.repo-bak
cp CentOS-Linux-Base.repo CentOS-Linux-Base.repo-bak
cp CentOS-Linux-Extras.repo CentOS-Linux-Extras.repo-bak
3.编辑各个文件内容
注释mirrorlist
修改baseurl
[AppStream]
name=CentOS-$releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[BaseOS]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
4. dnf -y install epel-release
5. dnf clean all
6. dnf makecache
7. dnf repolist
2,安装开发工具包
默认的CentOS存储库包含一个名为“Development Tools”的软件包组,其中包括GNU编译器集合,GNU调试器以及编译软件所需的其他开发库和工具。
要安装开发工具包,请以root或具有sudo特权的用户身份运行以下命令:
yum groupinstall -y "Development Tools"
3,安装python 的pip
1)yum -y install epel-release
2)centos 8 中 执行 yum install python-pip 为找不到匹配参数
yum install python3-pip
3)查看版本