How to update OS packages
-
Please check the latest version for CentOS/RHEL 7.4 on the web site http://mirror.centos.org/centos-7/. The below steps assume the latest version is 7.4.1708.
Prepare packages
For Red Hat Enterprise Linux, if you have subscribed Red Hat Enterprise Linux, you should update package repository from Red Hat.
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
Update packages
$ sudo mkdir -p /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
-
Prepare packages
For SLES, you need subscribe from SUSE to get package repository.
Update packages
$ 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