Create Oracle OS Management Hub Custom Software Sources From a Package List

Introduction

Custom software sources in OS Management Hub let you control the packages and modules available to your managed instances. OS Management Hub has flexible and powerful options for creating custom software sources. You can apply filters to limit the set of packages and modules or provide a reference package list from an existing Oracle Linux instance. Package dependencies can also be auto-resolved. You can create custom software sources using the Oracle Cloud Console, the OCI CLI, or programmatically with the OCI API/SDK. In this tutorial, you’ll learn how to take a reference package list from an Oracle Linux instance and use Oracle Cloud Console to create a custom or versioned custom software source in OS Management Hub.

Objectives

In this tutorial, you will learn how to:

Prerequisites

For more information about OS Management Hub, see https://docs.oracle.com/iaas/osmh/doc/home.htm.

Get The Package List

First, get the package list from your reference Oracle Linux instance. An expedient way to get the packages is with the rpm -qa command. Log into the reference system and run:

rpm -qa | grep -v gpg-pubkey > /tmp/my-package-list.txt

This command creates a file, /tmp/my-package-list.txt, with all the packages installed on your reference instance. You will use this file when you create the custom software source.

Note that gpg-pubkey packages are filtered. These packages are not from vendor software sources; you cannot add them to a custom software source. If your reference instance has other installed packages that are not from a vendor software source, you should remove those from your package list file.

Get The Vendor Software Sources

Next, gather the vendor software sources used by your referenced instance. OS Management Hub will prompt for these when creating a custom software source.

If you manage your reference instance using OS Management Hub, you can view its attached software sources in the Oracle Cloud Console.

If you do not manage your reference instance using OS Management Hub, use yum repolist or dnf repolist to list the vendor repos in use. Log into the reference system and run:

Oracle Linux 6 or 7:

sudo yum repolist

Oracle Linux 8 or 9:

sudo dnf repolist

Note the Oracle Linux software sources used by the instance. You will use these when you create the custom software source.

Create The Custom Software Source

Finally, use your package list to create the custom software source. In the Oracle Cloud Console:

For more information, see Creating software sources in the OS Management Hub documentation.

Conclusion

OS Management Hub custom and versioned custom software sources give you more control over the content available to your managed instances. This tutorial’s steps showed you how to use a package list from a reference instance to create a custom software source in OS Management Hub. The process for creating a versioned custom software source is very similar. To make a version of a custom software source, you provide an alphanumeric version in the first step of the software source creation workflow in the Oracle Cloud Console. The rest of the steps are the same.

For More Information

See other related resources:

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.