Reader small image

You're reading from  Oracle Linux Cookbook

Product typeBook
Published inJan 2024
Reading LevelBeginner
PublisherPackt
ISBN-139781803249285
Edition1st Edition
Languages
Tools
Right arrow
Authors (3):
Erik Benner
Erik Benner
author image
Erik Benner

Erik Benner is the VP of Enterprise Transformation and an Oracle ACE director. He is an expert strategist for customers across the United States. His customer engagements range from enterprise cloud transformations to data center consolidation and modernization. He frequently presents at conferences such as Oracle CloudWorld, ASCEND, BLUEPRINT 4D, and FOSSY. Having worked with Oracle and Sun Systems since the mid-90s, Erik is well-versed in most of the core Oracle technologies, including Oracle Cloud, Oracle Linux, and Oracle Database. When not flying to far points of the country from the Metro Atlanta area, he enjoys spending time with his family at their observatory, where the telescopes outnumber the people.
Read more about Erik Benner

Erik B. Thomsen
Erik B. Thomsen
author image
Erik B. Thomsen

Erik B. Thomsen is a Principal Sales Consultant passionate about Linux, cloud-native technologies, and “Everything as Code.” He is an innovative strategist with extensive experience working in multiple facets of IT, including DevSecOps, product management for databases and Linux, and platform engineering, where he led the development of an enterprise Kubernetes container platform. He has many years of consulting experience working for numerous Fortune 500 companies. Often described as a “visionary” or “thought leader” by his peers, Erik leverages his expertise in technology with his creative development and automation skills to help customers design, deploy, and manage cutting-edge IT solutions.
Read more about Erik B. Thomsen

Jonathan Spindel
Jonathan Spindel
author image
Jonathan Spindel

Jonathan Spindel is a highly skilled and experienced technology leader and evangelist with a strong emphasis on Oracle ecosystems cloud infrastructure and automation. With over 23 years in the industry, he possesses a comprehensive understanding of managing, designing, and deploying multi-tenant enterprise systems and cloud solutions to address business needs and enhance operational processes. Jonathan excels in providing end-to-end management and technical turnkey cloud solutions that drive increased business productivity and reduce operational costs, ultimately delivering timely returns on investment. His hands-on approach and deep expertise in Oracle and mainstream infrastructure and cloud technologies enable him to optimize performance and streamline operations, while his proficiency in automation ensures efficient and error-free processes.
Read more about Jonathan Spindel

View More author details
Right arrow

Software Management with DNF

Without packages, a fresh Linux installation is about as useful as a car with no tires! You need to be able to add software to the system to make it useful. This can be done in several ways. Back in the old days (hey, I am a true gray-bearded Unix/Linux guy), you used to download the source files and then build and install them manually. On occasion, you could get prebuilt packages but, often, the dependencies that were required would take hours to run down manually. Then, in 1997, along came Red Hat Package Manager (RPM) files. These really simplified the process, as all you needed to do was track down all the RPM files needed to install an application, and off you went.

Then, the applications started getting more complex; an example is the Apache HTTP server – all of its optional features went from 2-3 RPMs to a dozen, plus all the required dependencies. Tracking down all the RPMs and their dependencies became a chore… and due to mismatched...

What have they done to YUM, moving to DNF?

YUM was good – it worked and it allowed admins to easily install and patch software. You could even use it to roll back a bad installation. So, what happened to it? Why was DNF released? What is DNF and how hard will it be to learn a new tool?

First, DNF stands for Dandified YUM and is a rewrite of the YUM software. It was released in 2013 in Fedora 18 and was built to address many issues that YUM was starting to face.

The two most common problems with YUM were performance and RAM usage:

  • Poor performance: YUM had performance issues. A lot of this was caused by dependency resolution, the process in which all the packages and their dependencies are put together. This process could take as long as 10 minutes. DNF moved to libsolv, which significantly decreased the time to resolve complex dependencies. This is now more common that ever, with some applications requiring 30+ RPMs.
  • High RAM usage: YUM uses a lot of RAM; this...

Using the DNF time machine

DNF has a time machine built into it! This isn’t just a way to look back through the cosmos; it actually allows you to see the history of what was installed and also allows you to roll back a single change, or all changes up to a point.

Getting ready

To do this, you will need a test system, running Oracle Linux 8, with access to an RPM repo.

How to do it…

When DNF installs software, it keeps a history of all the actions performed. This includes upgrades to the software, installed software, and removal of the software. The dnf history command shows this history:

Figure 5.3 – The dnf history command

Figure 5.3 – The dnf history command

There are five columns – ID, Command line, Date and time, Action(s), and Altered:

  • ID: This is the identifier for the history, and is used in commands that will show info, roll back, undo, or store a transaction
  • Command line: This is the option passed to DNF when the command was run...

Building a DNF/YUM mirror from ULN

It is very common for admins to not enable internet access for the systems running in a secure network, like banking of Government networks. A local mirror of Oracle’s Unbreakable Linux Network (ULN) is a great way to allow systems to access patches without having to reach out across the internet to access them.

Getting ready

To do this, you will need a YUM server system running Oracle Linux 8. The local system should have internet access to be able to reach the ULN servers via direct access or a proxy server. Only the system (often called a YUM server) synchronizing to ULN will require this access; all the systems using this system will not need access to the internet, they will use this system to access patches.

The system is not CPU- or RAM-intensive – 2 cores and 4 GB of RAM are often more than enough for the server, but the system will use a lot of disk space. You can check how much space is needed by running the dnf repolist...

Creating a new RPM package

While Oracle provides a large number of RPMs, sometimes you just need to create a custom RPM package that allows you to easily deploy your own software. Creating an RPM file is easy to do!

Getting ready

To do this, you will need a development system, running Oracle Linux 8, with access to the Extra Packages for Enterprise Linux (EPEL) channel. It is highly recommended to have a dedicated system to build RPMs on, and to not build RPMs on production systems. You will also need a system to test installing the RPM on.

Note

Depending on the package being built, you may need additional channels, such as CodeReady or Distro Builder.

There are a few things we need to do first – mainly, installing the RPM developer tools. In order to do this, we also need to add the EPEL repo to the system.

While most of the recipes in this book use the root user for most of the work, this recipe will only use root for the installation of the software. Perform...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Oracle Linux Cookbook
Published in: Jan 2024Publisher: PacktISBN-13: 9781803249285
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Erik Benner

Erik Benner is the VP of Enterprise Transformation and an Oracle ACE director. He is an expert strategist for customers across the United States. His customer engagements range from enterprise cloud transformations to data center consolidation and modernization. He frequently presents at conferences such as Oracle CloudWorld, ASCEND, BLUEPRINT 4D, and FOSSY. Having worked with Oracle and Sun Systems since the mid-90s, Erik is well-versed in most of the core Oracle technologies, including Oracle Cloud, Oracle Linux, and Oracle Database. When not flying to far points of the country from the Metro Atlanta area, he enjoys spending time with his family at their observatory, where the telescopes outnumber the people.
Read more about Erik Benner

author image
Erik B. Thomsen

Erik B. Thomsen is a Principal Sales Consultant passionate about Linux, cloud-native technologies, and “Everything as Code.” He is an innovative strategist with extensive experience working in multiple facets of IT, including DevSecOps, product management for databases and Linux, and platform engineering, where he led the development of an enterprise Kubernetes container platform. He has many years of consulting experience working for numerous Fortune 500 companies. Often described as a “visionary” or “thought leader” by his peers, Erik leverages his expertise in technology with his creative development and automation skills to help customers design, deploy, and manage cutting-edge IT solutions.
Read more about Erik B. Thomsen

author image
Jonathan Spindel

Jonathan Spindel is a highly skilled and experienced technology leader and evangelist with a strong emphasis on Oracle ecosystems cloud infrastructure and automation. With over 23 years in the industry, he possesses a comprehensive understanding of managing, designing, and deploying multi-tenant enterprise systems and cloud solutions to address business needs and enhance operational processes. Jonathan excels in providing end-to-end management and technical turnkey cloud solutions that drive increased business productivity and reduce operational costs, ultimately delivering timely returns on investment. His hands-on approach and deep expertise in Oracle and mainstream infrastructure and cloud technologies enable him to optimize performance and streamline operations, while his proficiency in automation ensures efficient and error-free processes.
Read more about Jonathan Spindel