An improved front end for Apt
Historical
Have you ever tried to undo an upgrade that went wrong in Debian? For individual packages, this can easily be done by specifying the desired version for the downgrade next to the package name, as in
sudo apt install foo=0.98.2
However, if you are updating a large number of packages, you then end up with constructs like the one shown in Listing 1.
Listing 1
Specifying a Downgrade
$ awk '$1 == "2022-08-25" && $3 == "upgrade" {print $4"="$5}' /var/log/dpkg.log
Nala offers you a history
function borrowed from Fedora's DNF package manager. It not only shows you what happened during the update, but it can also roll back the results completely. Currently, the history
function is still under development and only works for individual packages and their dependencies. The output from
sudo nala history
shows the most recent actions, whether this be a single package installation, a removed package, or a system upgrade with 300 packages.
Especially for system upgrades where a bug has crept in, the history
function will be immensely helpful once it is fully implemented. There are good reasons for more and more distributions to use snapshots and atomic upgrades in the form of images. However, because these modern techniques are still a long way off in Debian, Nala's history
function offers a passable alternative option that requires hardly any effort.
The line-by-line output of history
starts on the left with an ID, which plays a crucial role for rolling back (Figure 7). This is followed by the apt
command, with Nala still partly confusing update
with upgrade
as parameters. But because this is only about information, it does not have any real implications. Once you have found the action to undo, use the ID of the line in
sudo nala history undo <ID>
![](/var/linux_magazin/storage/images/issues/2023/267/nala/figure-7/815902-1-eng-US/Figure-7_large.png)
After doing so, everything reverts to the way it was before. If you do change your mind,
sudo nala history redo <ID>
will reverse the process and reinstall the upgrade.
Conclusions
Nala adds some important features to Debian's package management: The output is attractively colorful and informative. Clutter is avoided, with the tool highlighting everything that is important. Parallel downloads speed up updates and upgrades, while the fetch
function additionally lets you choose the fastest mirror servers. But the real highlight is Nala's history
function, which will beam Debian to a position close to snapshot-supported distributions in the future. The developer intends to port Nala from Python to Rust in the near future to increase download speed. He will then look to integrate the extended history
function.
I have been using Nala daily for six months without any serious complications. In rare cases, the upgrade hangs for some unknown reason, but continues to run normally after pressing the Enter key. Nala extends apt
in a way that makes it especially interesting for users of Debian Testing, Unstable, and their offshoots. However, thanks to Nala, updates are also more fun on Ubuntu and other Debian derivatives.
Infos
- dpkg: https://en.wikipedia.org/wiki/Dpkg
- Apt: https://en.wikipedia.org/wiki/APT_(software)
- Michael Stapelberg's Debian critique: https://michael.stapelberg.ch/posts/2019-03-10-debian-winding-down/
- "Improving Linux Package Management" by Ferdinand Thommes, Linux Magazine, issue 247, July 2021, https://www.linux-magazine.com/Issues/2021/247/Distri/(language)/eng-US
- python-apt: https://apt-team.pages.debian.net/python-apt/library/index.html
- Wiki: https://gitlab.com/volian/nala/-/wikis/Installation
- Hooks: https://www.reddit.com/r/linux/comments/v2i0xb/nala_v090_now_in_debian_sid_and_testing/
- Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=158486
- apt-fast: https://github.com/ilikenwf/apt-fast#debian-and-derivates
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.