CentOS6.6升级到CentOS7

edhat提供了一个redhat-upgrade-tool的升级工具;

[1]配置软件源(网上有些教程把这一步省了,当时升级试了很多次都不成功)


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

[upgrade]

name=upgrade

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

enable=1

gpgcheck=0

[2]安装软件工具


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

[3]升级前检查潜在问题(如果此处有显示报错之类的提示,建议可以先卸载)


# preupg

Preupg tool doesn‘t do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
 that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:01s)
All changed files      : 02/11 ...finished (time 04:40s)
Changed config files   : 03/11 ...finished (time 00:00s)
All users              : 04/11 ...finished (time 00:00s)
All groups             : 05/11 ...finished (time 00:00s)
Service statuses       : 06/11 ...finished (time 00:00s)
All installed files    : 07/11 ...finished (time 00:03s)
All local files        : 08/11 ...finished (time 00:12s)
All executable files   : 09/11 ...finished (time 00:01s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/096 ...done    (Configuration Files to Review)
002/096 ...done    (File Lists for Manual Migration)
003/096 ...done    (Bacula Backup Software)
004/096 ...done    (MySQL configuration)
005/096 ...done    (Migration of the MySQL data stack)
006/096 ...done    (Changes related to moving from MySQL to MariaDB)
007/096 ...done    (PostgreSQL upgrade content)
008/096 ...running (GNOME Desktop Environment underwent several design modificatdone    (GNOME Desktop Environment underwent several design modifications in CentOS 7 release)
009/096 ...running (KDE Desktop Environment underwent several design modificatiodone    (KDE Desktop Environment underwent several design modifications in CentOS 7 release)
010/096 ...done    (several graphic drivers not supported in CentOS 7)
011/096 ...done    (several input drivers not supported in CentOS 7)
012/096 ...done    (several kernel networking drivers not available in CentOS 7)
013/096 ...done    (several kernel storage drivers not available in CentOS 7)
014/096 ...done    (Names, Options and Output Format Changes in arptables)
015/096 ...done    (BIND9 running in a chroot environment check.)
016/096 ...done    (BIND9 configuration compatibility check)
017/096 ...running (Move dhcpd/dhcprelay arguments from /etc/sysconfig/* to *.sedone    (Move dhcpd/dhcprelay arguments from /etc/sysconfig/* to *.service files)
018/096 ...done    (DNSMASQ configuration compatibility check)
019/096 ...done    (Dovecot configuration compatibility check)
020/096 ...done    (Compatibility Between iptables and ip6tables)
021/096 ...done    (Net-SNMP check)
022/096 ...done    (Squid configuration compatibility check)
023/096 ...done    (Reusable Configuration Files)
024/096 ...done    (VCS repositories)
025/096 ...done    (Added and extended options for BIND9 configuration)
026/096 ...done    (Added options in DNSMASQ configuration)
027/096 ...done    (Packages not signed by CentOS)
028/096 ...done    (Obsoleted rpms)
029/096 ...done    (w3m not available in CentOS 7)
030/096 ...running (report incompatibilities between CentOS 6 and 7 in qemu-guesdone    (report incompatibilities between CentOS 6 and 7 in qemu-guest-agent package)
031/096 ...done    (Removed options in coreutils binaries)
032/096 ...done    (Removed options in gawk binaries)
033/096 ...done    (Removed options in netstat binary)
034/096 ...done    (Removed options in quota tools)
035/096 ...done    (Removed rpms)
036/096 ...done    (Replaced rpms)
037/096 ...done    (GMP library incompatibilities)
038/096 ...done    (package downgrades)
039/096 ...done    (restore custom selinux configuration)
040/096 ...done    (General)
041/096 ...done    (samba shared directories selinux)
042/096 ...done    (CUPS Browsing/BrowsePoll configuration)
043/096 ...done    (CVS Package Split)
044/096 ...done    (FreeRADIUS Upgrade Verification)
045/096 ...done    (httpd configuration compatibility check)
046/096 ...done    (bind-dyndb-ldap)
047/096 ...done    (Identity Management Server compatibility check)
048/096 ...done    (IPA Server CA Verification)
049/096 ...done    (NTP configuration)
050/096 ...done    (Information on time-sync.target)
051/096 ...done    (OpenLDAP /etc/sysconfig and data compatibility)
052/096 ...done    (OpenSSH sshd_config migration content)
053/096 ...done    (OpenSSH sysconfig migration content)
054/096 ...done    (Configuration for quota_nld service)
055/096 ...running (Disk quota netlink message daemon moved into quota-nld packadone    (Disk quota netlink message daemon moved into quota-nld package)
056/096 ...done    (SSSD compatibility check)
057/096 ...done    (Luks encrypted partition)
058/096 ...done    (Clvmd and cmirrord daemon management.)
059/096 ...done    (State of LVM2 services.)
060/096 ...done    (device-mapper-multipath configuration compatibility check)
061/096 ...done    (Removal of scsi-target-utils)
062/096 ...done    (Configuration for warnquota tool)
063/096 ...running (Disk quota tool warnquota moved into quota-warnquota packagedone    (Disk quota tool warnquota moved into quota-warnquota package)
064/096 ...done    (Architecture Support)
065/096 ...done    (Binary rebuilds)
066/096 ...done    (Debuginfo packages)
067/096 ...done    (Cluster and High Availability)
068/096 ...done    (Quorum implementation)
069/096 ...done    (fix krb5kdc config file)
070/096 ...done    (File Systems, Partitions and Mounts Configuration Review)
071/096 ...done    (Read Only FHS directories)
072/096 ...done    (Sonamebumped libs)
073/096 ...done    (SonameKept Reusable Dynamic Libraries)
074/096 ...done    (Removed .so libs)
075/096 ...done    (In-place Upgrade Requirements for the /usr/ Directory)
076/096 ...done    (CA certificate bundles modified)
077/096 ...done    (Developer Tool Set packages)
078/096 ...done    (Hyper-V)
079/096 ...running (Content for enabling and disabling services based on CentOS done    (Content for enabling and disabling services based on CentOS 6 system)
080/096 ...done    (Check for ethernet interface naming)
081/096 ...done    (User modification in /etc/rc.local and /etc/rc.d/rc.local)
082/096 ...done    (cgroups configuration compatibility check)
083/096 ...done    (Plugable authentication modules (PAM))
084/096 ...done    (Foreign Perl modules)
085/096 ...done    (Python 2.7.5)
086/096 ...done    (Ruby 2.0.0)
087/096 ...done    (SCL collections)
088/096 ...done    (System kickstart)
089/096 ...done    (YUM)
090/096 ...done    (Check for usage of dangerous range of UID/GIDs)
091/096 ...done    (Incorrect usage of reserved UID/GIDs)
092/096 ...done    (NIS ypbind config files back-up)
093/096 ...done    (NIS Makefile back-up)
094/096 ...done    (NIS server maps check)
095/096 ...done    (NIS server MAXUID and MAXGID limits check)
096/096 ...done    (NIS server config file back-up)
Assessment finished (time 04:02s)
Result table with checks and their results for main contents:
---------------------------------------------------------------------------------------------------------------
|Bacula Backup Software                                                                    |notapplicable     |
|MySQL configuration                                                                       |notapplicable     |
|Migration of the MySQL data stack                                                         |notapplicable     |
|Changes related to moving from MySQL to MariaDB                                           |notapplicable     |
|PostgreSQL upgrade content                                                                |notapplicable     |
|Names, Options and Output Format Changes in arptables                                     |notapplicable     |
|BIND9 running in a chroot environment check.                                              |notapplicable     |
|BIND9 configuration compatibility check                                                   |notapplicable     |
|Move dhcpd/dhcprelay arguments from /etc/sysconfig/* to *.service files                   |notapplicable     |
|Dovecot configuration compatibility check                                                 |notapplicable     |
|Net-SNMP check                                                                            |notapplicable     |
|Squid configuration compatibility check                                                   |notapplicable     |
|Added and extended options for BIND9 configuration                                        |notapplicable     |
|w3m not available in CentOS 7                                                             |notapplicable     |
|report incompatibilities between CentOS 6 and 7 in qemu-guest-agent package               |notapplicable     |
|restore custom selinux configuration                                                      |notapplicable     |
|FreeRADIUS Upgrade Verification                                                           |notapplicable     |
|httpd configuration compatibility check                                                   |notapplicable     |
|bind-dyndb-ldap                                                                           |notapplicable     |
|Identity Management Server compatibility check                                            |notapplicable     |
|IPA Server CA Verification                                                                |notapplicable     |
|OpenLDAP /etc/sysconfig and data compatibility                                            |notapplicable     |
|SSSD compatibility check                                                                  |notapplicable     |
|Clvmd and cmirrord daemon management.                                                     |notapplicable     |
|Removal of scsi-target-utils                                                              |notapplicable     |
|Quorum implementation                                                                     |notapplicable     |
|fix krb5kdc config file                                                                   |notapplicable     |
|Ruby 2.0.0                                                                                |notapplicable     |
|NIS ypbind config files back-up                                                           |notapplicable     |
|NIS Makefile back-up                                                                      |notapplicable     |
|NIS server maps check                                                                     |notapplicable     |
|NIS server MAXUID and MAXGID limits check                                                 |notapplicable     |
|NIS server config file back-up                                                            |notapplicable     |
|several graphic drivers not supported in CentOS 7                                         |pass              |
|several input drivers not supported in CentOS 7                                           |pass              |
|several kernel networking drivers not available in CentOS 7                               |pass              |
|several kernel storage drivers not available in CentOS 7                                  |pass              |
|DNSMASQ configuration compatibility check                                                 |pass              |
|Compatibility Between iptables and ip6tables                                              |pass              |
|NTP configuration                                                                         |pass              |
|Information on time-sync.target                                                           |pass              |
|OpenSSH sshd_config migration content                                                     |pass              |
|Configuration for quota_nld service                                                       |pass              |
|Disk quota netlink message daemon moved into quota-nld package                            |pass              |
|Luks encrypted partition                                                                  |pass              |
|Configuration for warnquota tool                                                          |pass              |
|Architecture Support                                                                      |pass              |
|Debuginfo packages                                                                        |pass              |
|Cluster and High Availability                                                             |pass              |
|Read Only FHS directories                                                                 |pass              |
|In-place Upgrade Requirements for the /usr/ Directory                                     |pass              |
|CA certificate bundles modified                                                           |pass              |
|Developer Tool Set packages                                                               |pass              |
|Hyper-V                                                                                   |pass              |
|Check for ethernet interface naming                                                       |pass              |
|User modification in /etc/rc.local and /etc/rc.d/rc.local                                 |pass              |
|Plugable authentication modules (PAM)                                                     |pass              |
|SCL collections                                                                           |pass              |
|System kickstart                                                                          |pass              |
|Incorrect usage of reserved UID/GIDs                                                      |pass              |
|VCS repositories                                                                          |informational     |
|Added options in DNSMASQ configuration                                                    |informational     |
|Removed options in coreutils binaries                                                     |informational     |
|Removed options in gawk binaries                                                          |informational     |
|Removed options in netstat binary                                                         |informational     |
|Removed options in quota tools                                                            |informational     |
|GMP library incompatibilities                                                             |informational     |
|samba shared directories selinux                                                          |informational     |
|CVS Package Split                                                                         |informational     |
|Disk quota tool warnquota moved into quota-warnquota package                              |informational     |
|File Systems, Partitions and Mounts Configuration Review                                  |informational     |
|SonameKept Reusable Dynamic Libraries                                                     |informational     |
|YUM                                                                                       |informational     |
|Reusable Configuration Files                                                              |fixed             |
|Replaced rpms                                                                             |fixed             |
|package downgrades                                                                        |fixed             |
|CUPS Browsing/BrowsePoll configuration                                                    |fixed             |
|OpenSSH sysconfig migration content                                                       |fixed             |
|State of LVM2 services.                                                                   |fixed             |
|device-mapper-multipath configuration compatibility check                                 |fixed             |
|Configuration Files to Review                                                             |needs_inspection  |
|File Lists for Manual Migration                                                           |needs_inspection  |
|Obsoleted rpms                                                                            |needs_inspection  |
|Binary rebuilds                                                                           |needs_inspection  |
|Foreign Perl modules                                                                      |needs_inspection  |
|Python 2.7.5                                                                              |needs_inspection  |
|Check for usage of dangerous range of UID/GIDs                                            |needs_inspection  |
|KDE Desktop Environment underwent several design modifications in CentOS 7 release        |needs_action      |
|Packages not signed by CentOS                                                             |needs_action      |
|Removed rpms                                                                              |needs_action      |
|General                                                                                   |needs_action      |
|Sonamebumped libs                                                                         |needs_action      |
|Removed .so libs                                                                          |needs_action      |
|Content for enabling and disabling services based on CentOS 6 system                      |needs_action      |
|cgroups configuration compatibility check                                                 |needs_action      |
|GNOME Desktop Environment underwent several design modifications in CentOS 7 release      |fail              |
---------------------------------------------------------------------------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-150112163646.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Summary information:
We found some critical issues. In-place upgrade is not advised.
Read the file /root/preupgrade/result.html for more details.
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .

[4]开始升级


# rpm --import http://centos.excellmedia.net/7.0.1406/os/x86_64/RPM-GPG-KEY-CentOS-7

正常的运行以上命令可以升级完成;


# redhat-upgrade-tool --network 7.0 --instrepo http://centos.excellmedia.net/7.0.1406/os/x86_64/

这强制的就显得有点不友好了,生产环境慎用;

更新到这一步:


setting up repos...

.treeinfo                                                                                                | 1.1 kB     00:00

getting boot images...

vmlinuz-redhat-upgrade-tool                                                                              | 4.7 MB     01:38

initramfs-redhat-upgrade-tool.img                                                                        |  32 MB     14:45

setting up update...

finding updates 100% [=====================================================================================================]

(1/272): acl-2.2.51-12.el7.x86_64.rpm                                                                    |  81 kB     00:00

(2/272): attr-2.4.46-12.el7.x86_64.rpm                                                                   |  66 kB     00:00

(3/272): audit-2.3.3-4.el7.x86_64.rpm                                                                    | 223 kB     00:01

(4/272): audit-libs-2.3.3-4.el7.x86_64.rpm                                                               |  77 kB     00:00

(5/272): authconfig-6.2.8-8.el7.x86_64.rpm                                                               | 399 kB     00:08

(6/272): basesystem-10.0-7.el7.centos.noarch.rpm                                                         | 5.0 kB     00:00

(7/272): bash-4.2.45-5.el7.x86_64.rpm                                                                    | 1.0 MB     00:17

(270/272): yum-plugin-fastestmirror-1.1.31-24.el7.noarch.rpm                                             |  28 kB     00:03

(271/272): zlib-1.2.7-13.el7.x86_64.rpm                                                                  |  89 kB     00:06

(272/272): zlib-devel-1.2.7-13.el7.x86_64.rpm                                                            |  49 kB     00:01

setting up system for upgrade

Finished. Reboot to start upgrade.


# reboot

[5]升级完成:


# cat /etc/redhat-release

CentOS Linux release 7.0.1406 (Core)

时间: 2024-10-14 00:56:04

CentOS6.6升级到CentOS7的相关文章

centos6.5升级到centos7

redhat提供了一个redhat-upgrade-tool的升级工具: [1]配置软件源 # vim /etc/yum.repos.d/upgrade.repo [upgrade] name=upgrade baseurl= enable=1 gpgcheck=0 [2]安装软件工具 yum -y install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant [3]升级前检查潜在问题 # preup

CentOS6.x 升级到 CentOS7.x

博文来源:http://leyewen.blog.163.com/ 官方升级教程:http://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool 以下是我的升级步骤: 仅在测试机中运行,请勿用于实际环境,操作前整盘备份!!! 以下只为了在纯minimal环境下做测试,建议全新安装. 1.在“/etc/yum.repos.d/”目录中创建文件upgradetool.repo # cd /etc/yum.repos.d/ # touch upgradet

centos6.5升级gcc 4.4.7为最新版4.9.1(不建议!!!)

=====================本方法切实可行======不建议用======================================== 1.下载源码包 我的下载  gcc-4.9.1.tar.bz2 解压:tar -jxvf gcc-4.9.1.tar.bz2 2.下载编译所需依赖库 cd gcc-4.9.1 ./contrib/download_prerequisites   此命令会自动安装依赖包,直接安装到本目录下,并且自动解压,make时会用到 cd .. 3.建立

centos6.3升级python至2.7.5

centos6.3自带的python版本是2.6.6,有时候需要升级到2.7.这里记录一下升级过程,方便查阅.实际上是转载自http://flyingdutchman.iteye.com/blog/1885564. 1.安装gcc. yum install gcc gcc-c++ 2.下载python-2.7.5.tar.xz. wget https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.xz 3.解压安装 xz -d python

CentOS6.X升级Python

CentOS6.X升级Python CentOS6.X升级默认Python2.6.6到python2.7 在centos下直接输入python即可进入python,能看到当前版本信息 [[email protected] ~]# pythonPython 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2Type "help", "copyright

CentOS6.5升级内核到4.0.0

4月12日,Linux内核4.0正式发布 主要更新内容如下:新增“实时内核补丁”.无需重启,实时修补内核.该特性由 Red Hat的Kpatch 和 SUSE 的 kGraft 合并形成.改进硬件支持.新增对Intel Quark SoC 以及更多 ARM设备的支持,改进对IBM z13的支持. 为(xian)了(de)尝(dan)鲜(teng),将CentOS6.5升级内核到4.0.0. 1. 准备工作 确认内核及版本信息 [[email protected] send]# uname -r2

CentOS-6.9升级到Python-3.5

CentOS-6.9升级Python到3.5 下载Python-3.5 wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz 解压 tar zxvf Python-3.5.0.tgz 进入Python-3.5.0目录 cd Python-3.5.0 指定安装位置 ./configure --prefix=/usr/local/python3.5 编译安装 make && make install 下载并安装setupto

从centos6升级到centos7步骤

1. 备份 2. 安装依赖列表 yum源文件/etc/yum.repos.d/upgrade.repo,内容为 [upgrade] name=upgrade baseurl=http://dev.centos.org/centos/6/upg/x86_64/ enabled=1 gpgcheck=0 安装依赖包 yum install preupgrade-assistant-contents redhat-upgrade-tool preupgrade-assistant 3. 校验升级 执行

CentOS6.5升级手动安装gcc4.8.2

一.简易安装 操作环境 CentOS6.5 64bit,原版本4.4.7,不能支持C++11的特性~,希望升级到4.8.2 不能通过yum的方法升级,需要自己手动下载安装包并编译 1.1 获取安装包并解压 wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2 tar -jxvf gcc-4.8.2.tar.bz2 当然,http://ftp.gnu.org/gnu/gcc 里面有所有的gcc版本供下载,最新版本已经有4.9.2啦.