Ghostboard pixel

Apt Command is Finally Getting the Much Needed History Features

In the upcoming versions of apt, you'll be able to see the history of package transactions and get details on them.

Looking at this merge request in Apt code, I can see a very useful feature coming to Debian and Ubuntu-based distros. It may not be for every end user but sysadmins are surely going to appreciate it.

The apt command is getting new history features, that allow users to look into past apt command operations.

New history sub-commands in apt

In the future, apt command will have two new sub-commands that introduce history log parsing:

  • apt history-list : To list all previous package transaction history.
  • apt history-info : To show detailed information about a selected package transaction.

Why does it matter? Well, for sysadmins, sometimes it becomes necessary to see what packages they installed or upgraded and when it was installed or removed and what happened during that package transaction.

Up until now, users were restricted to using low-level dpkg command with grep to find out these details.

dpkg -l | grep <package_name>

With the dedicated sub-commands in apt, there would be no need to create combinations of commands and look through the log files just to know what and when a package change happened.

The first apt history-list shows the entire package history log. The second one apt history-info makes things a lot easier by showing details only on selected package transactions. This streamlines the process, as it is now easier to jump into a specific entry and only read that instead of reading the entire history log.

I'll update our apt command guide when this new feature is available.

Using apt Commands in Linux [Ultimate Guide]
This guide shows you how to use apt commands in Linux with examples so that you can manage packages effectively.

Inspired by DNF...in a good way

It's good to see that developers are adding new, useful features in the apt command. Some will say that these are inspired by Fedora's DNF package manager. Which might not be untrue, as DNF has had this feature for some time now.

In fact, let me show you these equivalent DNF commands:

dnf history list
dnf history list
DNF history list

And when you have the command transaction ID, you can use it to get details obn it:

dnf history info <command-transaction-id>
Details on a DNF package operation in history

Looking at these, I am guessing apt should have similar output for their history features.

It's not just the history sub-commands, even some of the recent changes apt introduced in version 3.0 are seemingly inspired by DNF.

I don't mind apt getting inspired by dnf. As the end users, we should appreciate the inclusion of useful features. What do you think?

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 13 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.