marmar24012 / Bash-Scripts

A Cumulative Of Bash Scripts Made To Make My Job Easier
0 stars 0 forks source link

Oracle Linux Version Lock #13

Open marmar24012 opened 2 weeks ago

marmar24012 commented 2 weeks ago

[root@ociahmcapp1 yum.repos.d]# hostnamectl | grep Operating Operating System: Oracle Linux Server 8.7

  1. With ol8_baseos_latest repository enabled, download newest repository files. Package oraclelinux-release-el8 contains just the new repository info:

[root@ociahmcapp1 yum.repos.d]# rpm -ql oraclelinux-release-el8 /etc/yum.repos.d/oracle-linux-ol8.repo /etc/yum.repos.d/uek-ol8.repo /etc/yum.repos.d/virt-ol8.repo /usr/share/doc/oraclelinux-release-el8 /usr/share/doc/oraclelinux-release-el8/LICENSE

[root@ociahmcapp1 yum.repos.d]# yum repolist | grep -i latest ol8_UEKR6 Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)

[root@ociahmcapp1 yum.repos.d]# yum update oraclelinux-release-el8 Last metadata expiration check: 1:42:11 ago on Wed 29 May 2024 04:34:20 AM PDT. Dependencies resolved.

Package Architecture Version Repository Size

Upgrading: oraclelinux-release-el8 x86_64 1.0-38.el8 ol8_baseos_latest 21 k

Transaction Summary

Upgrade 1 Package

Total download size: 21 k Is this ok [y/N]: y Downloading Packages: oraclelinux-release-el8-1.0-38.el8.x86_64.rpm 17 kB/s | 21 kB 00:01

Total 17 kB/s | 21 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Upgrading : oraclelinux-release-el8-1.0-38.el8.x86_64 1/2 warning: /etc/yum.repos.d/oracle-linux-ol8.repo created as /etc/yum.repos.d/oracle-linux-ol8.repo.rpmnew

Running scriptlet: oraclelinux-release-el8-1.0-38.el8.x86_64 1/2 Cleanup : oraclelinux-release-el8-1.0-28.el8.x86_64 2/2 Verifying : oraclelinux-release-el8-1.0-38.el8.x86_64 1/2 Verifying : oraclelinux-release-el8-1.0-28.el8.x86_64 2/2

Upgraded: oraclelinux-release-el8-1.0-38.el8.x86_64

Complete!

  1. Since yum did not overwrite the main repository file, we need to do it manually: [root@ociahmcapp1 yum.repos.d]# cd /etc/yum.repos.d [root@ociahmcapp1 yum.repos.d]# ls -alt drwxr-xr-x. 2 root root 4096 May 29 06:21 . -rw-r--r--. 1 root root 941 May 23 01:17 uek-ol8.repo -rw-r--r--. 1 root root 243 May 23 01:17 virt-ol8.repo -rw-r--r--. 1 root root 4107 May 22 03:28 oracle-linux-ol8.repo.rpmnew drwxr-xr-x. 132 root root 8192 Apr 23 08:46 .. -rw-r--r--. 1 root root 2020 Feb 15 2023 oracle-linux-ol8.repo -rw-r--r--. 1 root root 252 Feb 15 2023 oracle-epel-ol8.repo -rw-r--r--. 1 root root 530 Mar 28 2022 oracle-epel-ol8.repo.rpmnew -rw-r--r--. 1 root root 694 Jan 14 2022 oraclelinux-developer-ol8.repo.rpmnew -rw-r--r--. 1 root root 495 May 4 2021 ksplice-ol8.repo -rw-r--r--. 1 root root 759 Apr 12 2021 mysql-ol8.repo -rw-r--r--. 1 root root 215 Mar 19 2021 oci-ol8.repo -rw-r--r--. 1 root root 253 Mar 19 2021 oci-included-ol8.repo -rw-r--r--. 1 root root 8662 Mar 19 2021 tictac -rw-r--r--. 1 root root 205 Mar 18 2021 ksplice-uptrack.repo -rw-r--r--. 1 root root 457 Jan 6 2021 oraclelinux-developer-ol8.repo

[root@ociahmcapp1 yum.repos.d]# cp oracle-linux-ol8.repo oracle-linux-ol8.repo.old

[root@ociahmcapp1 yum.repos.d]# cp oracle-linux-ol8.repo.rpmnew oracle-linux-ol8.repo cp: overwrite 'oracle-linux-ol8.repo'? y

  1. Edit the new repo file to disable ol8_baseos_latest repository and enable the repo with desired version. In this example, enabling the repo that will take the OS to 8.9 version:

[root@ociahmcapp1 yum.repos.d]# vi oracle-linux-ol8.repo [ol8_baseos_latest] name=Oracle Linux 8 BaseOS Latest ($basearch) baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/baseos/latest/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1

enabled=1

enabled=0 [ol8_u9_baseos_base] name=Oracle Linux 8.9 BaseOS ($basearch) baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/9/baseos/base/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1

enabled=0

enabled=1

[root@ociahmcapp1 yum.repos.d]# yum repolist repo id repo name ol8_MySQL80 MySQL 8.0 for Oracle Linux 8 (x86_64) ol8_MySQL80_connectors_community MySQL 8.0 Connectors Community for Oracle Linux 8 (x86_64) ol8_MySQL80_tools_community MySQL 8.0 Tools Community for Oracle Linux 8 (x86_64) ol8_UEKR6 Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) ol8_appstream Oracle Linux 8 Application Stream (x86_64) ol8_developer_EPEL Oracle Linux 8 EPEL Packages for Development (x86_64) ol8_ksplice Ksplice for Oracle Linux 8 (x86_64) ol8_oci Oracle Linux 8 OCI Packages (x86_64) ol8_oci_included Oracle Software for OCI users on Oracle Linux 8 (x86_64) ol8_u9_baseos_base Oracle Linux 8.9 BaseOS (x86_64)