(三)配置虚拟机yum源 1.移除源文件yum源配置 2.配置阿里云yum源 3.清除源,查看yum源列表,并建立缓存 4.按配置阿里云epel-7源
时间: 2024-02-22 22:52:25 浏览: 114
linux下的yum 阿里源配置
以下是配置CentOS虚拟机yum源的步骤:
1. 移除源文件yum源配置:
```shell
sudo rm -rf /etc/yum.repos.d/*.repo
```
2. 配置阿里云yum源:
```shell
sudo tee /etc/yum.repos.d/aliyun.repo <<-'EOF'
[aliyun]
name=Aliyun Yum Repository
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=0
enabled=1
EOF
```
3. 清除源,查看yum源列表,并建立缓存:
```shell
sudo yum clean all
sudo yum repolist
sudo yum makecache
```
4. 安装配置阿里云epel-7源:
```shell
sudo yum install epel-release -y
sudo sed -i 's|^#baseurl=https://download.fedoraproject.org/pub/epel/|baseurl=https://mirrors.aliyun.com/epel/|' /etc/yum.repos.d/epel.repo
sudo sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel.repo
```
阅读全文