Mastering Oracle Linux Updates and Repos
In this post I want to show how we can manage updates and repositories in Oracle Linux, to demonstrate this I will use an Oracle Linux 8.10 virtual machine running in Azure.
Oracle Linux is a high-performance, enterprise-class Linux distribution developed and maintained by Oracle Corporation.
Based on the open-source Red Hat Enterprise Linux (RHEL) codebase, Oracle Linux is designed to provide a secure, reliable, and scalable operating system tailored for mission-critical workloads in both on-premises and cloud environments.
It is widely adopted by organizations for its compatibility, advanced features, and support for Oracle’s database, middleware, and application software.
Repositories in Linux
In Linux, a repository or just repo is a centralized storage location that contains software packages, updates, and related metadata for a specific distribution.
Repositories are essential for package management systems like apt (Debian/Ubuntu), dnf/yum (RHEL/CentOS/Fedora/Oracle Linux), or zypper (openSUSE), as they allow users to install, update, and manage software directly from trusted sources.
Update Commands
Because Oracle Linux is based on the open-source Red Hat Enterprise Linux (RHEL) codebase, we can use to manage updates and installing packages by using either the dnf or still the yum command-line utilities.
Pleas note that today the default package management utility for Red Hat Enterprise Linux, Fedora and CentOS is the dnf utility and yum has been deprecated as the default package manager in the Red Hat family of distributions, so while yum commands currently work, it’s best to use just dnf.
Both dnf and yum are command-line utilities that work with RPM packages.
Red Hat originally released and depended on yum, which is an acronym for Yellowdog Updater, Modified.
dnf, an abbreviation for dandified yum, is the follow-up technology based on yum, as the name implies.
Run the dnf or yum command to update or install packages. As mentioned, it’s best to use just dnf.
# dnf update # dnf install [package-name] # yum update # yum install [package-name]


To check for available updates in Oracle Linux 8, you can use the dnf or yum command-line utilities, as both are supported on Oracle Linux 8. As mentioned, it’s best to use just dnf.
# dnf check-update or # yum check-update
Both commands will list the available package updates, displaying the package name, version, and repository.

Determine and Manage configured Repositories and their Connectivity
We can use the below commands to determine the repositories and if they are enabled or not.
# cd /etc/yum.repos.d # la -la # cat oracle-linux-o18.repo or by using the dnf or yum command List enabled repositories: # dnf repolist List all repositories (enabled and disabled): # dnf repolist all List enabled repositories: # yum repolist List all repositories (enabled and disabled): # yum repolist all Enable or Disable a Repository: To enable: # dnf config-manager --set-enabled <repo_id> To disable: # dnf config-manager --set-disabled <repo_id>
To see the final repository URLs, so called Repo-baseurl we can use the following command.
# dnf repolist -v -v, --verbose
This will show all enabled repositories and their Repo-baseurl.

To show all configured repositories (enabled and disabled) and their Repo-baseurl, we can use the following command.
# dnf repolist all -v

In case we directly look into the configured repos in the /etc/yum.repos.d folder, we first need to resolve the following placeholders there to determine the real repository URL which is finally used.
$ociregion
$ocidomain
$basearch

Determine placehoders $ociregion and $ocidomain in the repo URLs.
# cd /etc/yum/vars # ls -la # cat ocidomain # cat ociregion

The same for /etc/dnf/vars.

Determine the $basearch placeholder in the repo URLs.

The uname command can be used to print certain system information.

First list enabled repositories and then all (enabled and disabled):

Check Network Connectivity for the enabled Repositories
To check if our system can connect to its configured and enabled software repositories we can user either the Ncat utility (reimplementation of Netcat) or of course the good old telnet tool.
The original Netcat was released by Hobbit in 1995, but it hasn’t been maintained despite its popularity. It can sometimes even be hard to find a copy of the v1.10 source code.
The flexibility and usefulness of this tool prompted the Nmap Project to produce Ncat, a modern reimplementation which supports SSL, IPv6, SOCKS and http proxies, connection brokering, and more.
Other takes on this classic tool include the amazingly versatile Socat, OpenBSD’s nc, Cryptcat, Netcat6, pnetcat, SBD, and so-called GNU Netcat. For downloads and more information, visit the Netcat homepage.
# nc -v <repo fqdn> <port> # nc -v yum.oracle.com 443 -v for verbose output to see the connection status or by using telnet if installed # telnet <repo fqdn> <port> # telnet yum.oracle.com 443
By using Ncat (nc command).

By using telnet.

Installing Basic Tools on Oracle Linux
Ncat (Reimplementation of Netcat)
# yum install nc or # dnf install nc

Telnet
# yum install telnet or # dnf install telnet

Nano Editor
# dnf install nano or # yum install nano

Linux
Using Yum from the Command Line
https://docs.oracle.com/en/operating-systems/oracle-linux/6/adminsg/ol_creating_yum_repo.htmlManaging software with the DNF tool
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/managing_software_with_the_dnf_tool/index#assembly_distribution-of-content-in-rhel-9_managing-software-with-the-dnf-toolNetcat
https://sectools.org/tool/netcat/Moving from apt to dnf package management
https://developers.redhat.com/articles/2022/10/07/move-apt-dnf-package-management