24 C
Friday, March 5, 2021

How to Offline Update Fedora Workstation? – Linux Hint

Must read

Keeping the operating system up-to-date is important as updates contain bugfixes, performance improvements, security patches, and others. In the case of Linux, keeping the system updated mostly means keeping all the installed packages up-to-date.

Offline updating is an interesting concept when a system needs to be updated but without any reliable internet connection. In such a situation, the update packages are manually downloaded from a different source and applied to the offline machine.

In this guide, check out how to offline update the Fedora workstation.

Offline update Fedora

Fedora is a modern-day Linux distro with robust package management. Thanks to its package managers (DNF and YUM), it’s possible to update Fedora without any internet connection. However, for the best possible experience, the offline machine may have to be connected to the internet for a brief period of time.

It’s strongly recommended to use the CLI for updating Fedora offline.

Grabbing the Package Update List

The first step is to determine which packages have updates available. For this step only, it’s necessary to have an internet connection to the system.

Package update list using YUM:

The following YUM command will list all the packages that have updates available.

$ yum repoquery –upgrade –queryformat ‘%{name}.%{arch}’

For the next step, we need this list exported to a text file.

$ yum repoquery –upgrade –queryformat ‘%{name}.%{arch}’ > update_list.txt

Package update list using DNF:

The following DNF command will list all the packages that have updates available.

$ dnf repoquery –upgrade –queryformat ‘%{name}.%{arch}’

Export the list to a text file.

$ dnf repoquery –upgrade –queryformat ‘%{name}.%{arch}’ > update_list.txt

Package list using RPM:

If an internet connection isn’t available, then an alternative strategy is to grab the list of all the installed packages and work with it. Of course, this method will significantly increase the length of the process. It’s not recommended and follow only if you have to.

Grab all the installed packages in a nice format.

$ rpm -qa –queryformat “%{NAME}n

Export this list to a text file.

$ rpm -qa –queryformat “%{NAME}n > update_list.txt

Downloading Packages

Now, it’s time to download the desired packages. Export the text file containing the list of packages to download, load it on a different Fedora machine, and follow any of the following methods to download them.

First, check whether the text file contains only the package list, and nothing else.

Download update packages using YUM:

The following YUM command will download the packages listed on the text file and store them in the directory specified. To avoid any issue related to dependencies, use the “–resolve” flag.

$ yum download –resolve $(cat update_list.txt) –downloaddir=“<directory>

Download update packages using DNF:

Similar to YUM, the following DNF command will download and store all the packages (and dependencies) on the specific directory.

$ dnf download –resolve $(cat update_list.txt) –downloaddir=“<directory>”

Installing the Updates

Finally, it’s time to update the offline machine. Export the update packages to the offline system and follow either of the following methods to install the RPM packages.

Install updates using YUM:

The following command will install all the RPM packages using YUM.

$ sudo yum install /<path_to_rpm>/*.rpm

Install updates using DNF:

The following command will install all the RPM packages using DNF.

$ sudo dnf install /<path_to_rpm>/*.rpm

Final Thoughts

It’s a complete guide on how to offline update Fedora workstation. This method will work on any modern version of Fedora, and it’s not a difficult task at all.

The only downside to this approach is the time and effort it requires. While the manual task is minimal, the most time-consuming part is downloading and installing all those RPM packages (especially if the list is too long).

Happy computing!

Source link

- Advertisement -

More articles


Please enter your comment!
Please enter your name here

Latest article