如何升级操作系统
请在 http://mirror.centos.org/centos-7/ 网址查看 CentOS/RedHat7.4 的最新版本。下面步骤基于最新版本是 7.4.1708 进行演示。
准备更新包
对于 RedHat,如果你付费并订够了 RedHat 服务,你可以从 RedHat 官方得到更新包
对于 CentOS ,你需要准备一个可以访问 Internet 的 CentOS 7.4 节点,然后您可以运行如下命令创建更新包centos7_4_latest_version=7.4.1708 $ sudo cat << eof > /etc/yum.repos.d/centos7_4_update.repo [centos7_4_update] name=centos7_4_update baseurl=http://mirror.centos.org/centos/$centos7_4_latest_version/updates/x86_64/ mirrorlist=http://mirrorlist.centos.org/?release=$centos7_4_latest_version&arch=x86_64&repo=updates gpgcheck=0 enabled=1 eof $ sudo yum -y install createrepo $ sudo yum -y install yum-utils $ sudo mkdir -p /opt/update $ sudo cd /opt/update $ sudo reposync --download-metadata -r centos7_4_update -e ./cache -n -a x86_64 -d $ sudo createrepo . $ sudo rm -rf cache $ sudo tar -zcf update.tgz centos7_4_update repodata
升级系统包
请在管理节点上运行如下命令:$ sudo mkdir -p /install/custom/update
上传update.tgz
文件到管理节点的/install/custom/update
的目录下,然后在管理节点上运行如下命令:$ sudo tar -xf update.tgz -C /install/custom/update $ sudo cat << eof > /etc/yum.repos.d/centos7_4_update.repo [centos7_4_update] name=centos7_4_update baseurl= http://${sms_name}/install/custom/update gpgcheck=0 enabled=1 eof $ sudo xdcp all /etc/yum.repos.d/centos7_4_update.repo /etc/yum.repos.d/centos7_4_update.repo
请在管理节点上运行如下命令升级操作系统:$ sudo yum -y update $ sudo psh all yum -y update
准备更新包
对于 SLES , 你需要通过购买来获取您的最新的更新包。
升级系统包
上传您购买的 SLES 最新更新包到管理节点的/install/custom
路径下,我们假定这个存储库的目录名称是update
。然后在管理节点上运行下面的命令$ sudo cat << eof > /etc/zypp/repos.d/sles12_3_update.repo [sles12_3_update] name= sles12_3_update baseurl= http://${sms_name}/install/custom/update gpgcheck=0 enabled=1 eof $ sudo xdcp all /etc/zypp/repos.d/sles12_3_update.repo /etc/zypp/repos.d/sles12_3_update.repo $ sudo zypper -y dup $ sudo psh all zypper -y dup