Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

CentOS 6.0 手动升级至 6.2:替换 163 源与 yum update 实战

編輯:關於 Linux

CentOS 6.x 版本间升级仅需替换为高速镜像源并执行 yum update。本文记录将默认源替换为网易 163 镜像、清理缓存、执行升级、处理 GPG Key 导入与验证版本全过程。

一、备份并替换为 163 镜像源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget https://mirrors.163.com/.help/CentOS6-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
# 或手动编辑 baseurl 指向 mirrors.163.com/centos/

二、生成缓存并升级

yum clean all
yum makecache
yum update -y
# 过程中提示导入 GPG Key,输入 y 确认
# 若报 Key 错误,重新执行 yum update 即可自动导入

三、重启验证版本

reboot
uname -r
# 2.6.32-220.7.1.el6.x86_64
cat /etc/redhat-release
# CentOS release 6.2 (Final)

四、常见问题处理

  • GPG Key 导入失败:rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6。
  • 内核升级后无法启动:进入 Grub 选择旧内核,检查 /boot 空间、grub.conf 配置。
  • 第三方源冲突:暂时禁用 epel、remi 等源升级核心包,升级完成后再启用。

CentOS 升级示意图

替换为 163 镜像源执行 yum update 即可将 CentOS 6.0 无缝升级至 6.2。生产环境建议先在测试机验证,升级前备份关键数据与配置。

Copyright © Windows教程網 All Rights Reserved