升级centos正确姿势
sudo yum makecache wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum upgrade
经过试验,前几篇稿子和网上写的都不怎么准确。正确做法如上。
因为地址变化,以下面为准:
sudo yum makecache wget -O /etc/yum.repos.d/CentOS-Base.repo 更改为稳定的源 yum upgrade
参考如下:
更新缓存 sudo yum makecache wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum upgrade 进入仓库配置文件目录 cd /etc/yum.repos.d/ 创建仓库配置文件 vim Tuna.repo 输入仓库配置文本 [Tuna] name=Tsinghua Tuna - $releasever - $basearch baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/6/os/x86_64/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 导入GPG公钥 rpm --import https://mirrors.tuna.tsinghua.edu.cn/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6 生成缓存 yum makecache 更新升级 yum upgrade