CentOS6.x 升级 CentOS7.1

买了个香港的VPS
系统提供最新的版本为Centos6.4 所有想使用最新版的 CentOS 7.1
风来了.fox

系统版本磁盘等查看

cat /etc/issue
uname -a
uname -r
cat /proc/version
df -lhT

先安装 screen (主要为了网络会掉线的同学使用)

网络速度非常棒的可以忽略

yum install -y screen

安装完成后运行:

screen -S lanmps

注意:此步为了防止SSH登陆超时或掉线,中断安装(lanmps 为自定义名称)。
如果掉线了,执行 screen -r lanmps ,即可恢复 掉线前的执行界面,如果忘记名字了,执行 screen -ls 会列出所有会话列表,其中 数字.lanmps 即为刚才的会话

设置软件源

vi /etc/yum.repos.d/upgrade.repo

内容如下

[upgrade] 
name=upgrade 
baseurl=http://dev.centos.org/centos/6/upg/x86_64/ 
enable=1 
gpgcheck=0

安装软件

yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant

升级前检查

preupg

系统会提示这一句:

Do you want to continue? y/n

直接输入 y 回车即可

检查完成后运行

preupg --riskcheck --verbose 

设置安装版本,下载更新包

centos-upgrade-tool-cli --network 7 --instrepo=http://mirrors.163.com/centos/7/os/x86_64/

更新包下载错误情况

Downloading failed: Errors were encountered while downloading packages.
  python-libs-2.7.5-16.el7.x86_64: failure: Packages/python-libs-2.7.5-16.el7.x86_64.rpm from cmdline-instrepo: [Errno 12] Timeout on http://mirrors.163.com/centos/7.1.1503/os/x86_64/Packages/python-libs-2.7.5-16.el7.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')

类似于以上的错误,重新执行 该命令(设置安装版本,下载更新包)

下载成功

testing upgrade transaction
rpm transaction 100% [=================================================================================================]
rpm install 100% [=====================================================================================================]
setting up system for upgrade
Finished. Reboot to start upgrade.

设置仓库KEY

rpm --import http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

直接执行 reboot 命令,系统开始自动更新

reboot

本文出自:http://blog.csdn.net/fenglailea/article/details/46763941

参考:http://huangfuff.blog.51cto.com/2632203/1602913

你可能感兴趣的:(centos6,CentOS7)