升级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

  

posted @ 2022-05-18 17:09  飞雪飘鸿  阅读(74)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL