CentOS6.5 upgrade to CentOS7

This tutorial will introduce how to upgrade CentOS 6.4 x86_64 to CentOS 7.2; ( Note: Because the version after CentOS 7 is only 64-bit system, the CentOS 6.x version can only upgrade the 64-bit version; and the version before CentOS 5 does not support large versions Upgrade: Instructions )

Note: Before starting to upgrade the server system version, please make sure that you have fully backed up your system data to the local or other remote server. If the system fails to start normally or the system data is lost during the upgrade process, the customer shall be responsible for it .

System version and kernel view

# uname -r

# lsb_release -a

Note: If the prompt lsb_release does not exist, then you need to install the redhat-lsb-core package

# yum install -y redhat-lsb-core

run the following command

# screen -S upgrade

Note: In order to prevent ssh remote connection timeout or network disconnection, interrupt the installation (upgrade is a custom name); if it is disconnected, execute screen -r upgrade to restore the execution interface before the disconnection, if the name is forgotten, execute screen -ls will list a list of all sessions, where the number .upgrade is the session just now

Set up software sources

# vim /etc/yum.repos.d/upgrade.repo

The content is as follows:

[upgrade]

name=upgrade

baseurl=http://dev.centos.org/centos/6/upg/x86_64/

enable=1

gpgcheck=0

Install related software

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

Check before upgrading

# preupg

The system will prompt this sentence: Do you want to continue? y/n ; just enter y and press Enter

run after checking

# preupg --riskcheck --verbose

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

# centos-upgrade-tool-cli --network 7 --instrepo=http://mirrors.aliyun.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.aliyun.com/centos/7/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')

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

运行过程中会有提示是否继续升级:Continue with the upgrade [Y/N]? ;直接输入 y 回车即可

下载过程中提示以下截图提示/boot空间不足,需清理下/boot目录中比较大的文件,如内核文件()

下载成功

设置仓库KEY

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

之后执行 reboot 命令,系统开始重启自动更新。

 https://www.niaoyun.com/help/server/567.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326244739&siteId=291194637