upgrade from CentOS6 i386 to CentOS6 x86_64
今晚搞了个no zuo no die的操作, 有台生产环境的vps还是centos6.8 i386的, 想在上边搞点新鲜货,各种受限。
一气之下准备搞成amd64的,但是吧又不想data和prog都重搞一遍, 货是在太多,也懒得重配置,
想了个偏门,记录一下: 第0步,先搞个全盘snapshot 先 在target上执行yum upgrade,确保rpm都是最新的, 防止蛋疼,可以继续第二个snapshot, 然后找个amd64的kernel rpm,cp过去,执行,
rpm -Uhv --force --ignorearch kernel-2.6.32-642.el6.x86_64.rpm
会有一堆warning,忽略, reboot,
这时候会起来amd64的kernel,跑着i386的userspace,
然后呢就要去把所有i386的rpm搞成amd64的,
rpm -qa| grep 86| sed 's/.i686//'| xargs yumdownloader
这个时候,如果有的yum repo挂掉了,或者木有支持,
[root@vultr x64]# rpm -qa| grep 86| sed 's/.i686//'| xargs yumdownloader Loaded plugins: fastestmirror Repository nodesource is listed more than once in the configuration Repository nodesource-source is listed more than once in the configuration APItools_monitor/signature | 836 B 00:00 Retrieving key from https://packagecloud.io/APItools/monitor/gpgkey Importing GPG key 0xD59097AB: Userid: "packagecloud ops (production key) <ops@packagecloud.io>" From : https://packagecloud.io/APItools/monitor/gpgkey APItools_monitor/signature | 1.0 kB 00:00 ... https://packagecloud.io/APItools/monitor/el/6/x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo APItools_monitor Trying other mirror. Cannot retrieve repository metadata (repomd.xml) for repository: APItools_monitor. Please verify its path and try again
会报个错误,继续不下去,把报错的disable掉,
这样amd64的rpm就都下载下来了,当然有些会没有对应的, 按自己实际情况处理,忽略或者找能下载到的cp,
我的情况是这样:
[root@vultr x64]# rpm -qa| grep 86| sed 's/.i686//'| xargs yumdownloader Loaded plugins: fastestmirror Repository nodesource is listed more than once in the configuration Repository nodesource-source is listed more than once in the configuration Loading mirror speeds from cached hostfile * base: mirrors.ocf.berkeley.edu * elrepo: ftp.yz.yamagata-u.ac.jp * epel: mirrors.cat.pdx.edu * extras: mirrors.ocf.berkeley.edu * ius: hkg.mirror.rackspace.com * nux-dextop: mirror.li.nux.ro * updates: mirrors.ocf.berkeley.edu No Match for argument kernel-2.6.32-642.el6.x86_64 No Match for argument kernel-devel-2.6.32-696.13.2.el6 No Match for argument kernel-ml-4.12.4-1.el6.elrepo
有几个kernel相关的,无关紧要,到时候再去搞,
同理还是搞个snapshot保险一点,
然后删掉不用的i386,
rm -f *.i686.rpm
全部安装,
rpm -iv --force *.rpm
reboot
搞定收工,目测没发现大问题, 先用着看看