云服务器JAVA运行环境搭建(2)-更换服务器中的yum源
在国内,推荐把yum源换成阿里的,具体操作步骤如下
1. 备份原始yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. 下载新的CentOS-Base.repo 到/etc/yum.repos.d/,不同操作系统需要调用不同的命令
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
扫描二维码关注公众号,回复:
311962 查看本文章
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3. 生成缓存
yum makecache
4. yum常用命令,这几个命令后续会用到
搜索 yum search xxx
安装 yum install xxx
卸载 yum remove xxx
相关文章