在Centos7 系统上安装阿里云镜像源的操作
wget命令下载: wget [options] [url]# curl命令下载: curl [options] [url]2.2 下载阿里云Centos-7.repo文件。# 下载阿里云Centos-7.repo文件。1 .验证网络是否可以连接阿里云镜像。# 验证网络是否可以连接阿里云镜像。4 .安装lrzsz进行验证。# 创建shell脚本文件。# 赋予脚本可执行的权限。# yum安装lrzs
1 .验证网络是否可以连接阿里云镜像
# 验证网络是否可以连接阿里云镜像
ping mirrors.aliyun.com
2 手动配置
2.1 删除原yum源
# 删除原yum源
rm -rf /etc/yum.repos.d/*
2.2 下载阿里云Centos-7.repo文件
# wget命令下载: wget [options] [url]
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# curl命令下载: curl [options] [url]
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2.3 清除及生成缓存
# 清除yum缓存
yum clean all
# 缓存阿里云镜像
yum makecache
3 脚本配置
# 创建shell脚本文件
vi /opt/aliyun_yum.sh
插入以下内容:
#!/bin/bash
# 删除原yum源
rm -rf /etc/yum.repos.d/*
# 下载阿里云Centos-7.repo文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 清除yum缓存
yum clean all
# 缓存阿里云镜像
yum makecache
# 赋予脚本可执行的权限
chmod +x /opt/aliyun_yum.sh
# 执行脚本
sh /opt/aliyun_yum.sh
4 .安装lrzsz进行验证
# yum安装lrzsz
yum install lrzsz
更多推荐
所有评论(0)