Nala: A Beautiful and Structured Frontend for the APT Command

Do you still ignore the required dependencies and autoremove packages while installing the new application on Linux?

Initially, you take note of application dependencies and packages going to be wiped out from your system, but with time, we procrastinate due to the ugly interface of the apt command, which shows package names in the monotone format, and for this reason, you need to stare at the screen to know what step is being performed now.

For example, if I install git from the default apt package manager, and the same command is installed from nala package manager, then you can clearly see the difference from the side-by-side comparison.

And if I ask you, which output looks much more concise and unambiguous? You would simply answer, “The nala version of the command is much more concise and unambiguous.”

So, let’s learn how to install nala package manager on Ubuntu and other derivatives of Debian-based Linux distributions, which means you can follow the same steps if you have Linux Mint, Pop!_OS, Debian 11 (Buster), etc.

What is Nala Package Manager?

Nala frontend for the apt command that removes the limitation and provides you with a beautiful, clean, and structured list of packages and dependencies while installing new packages on your Linux system.

And the best part is that you do not need to memorize the nala command and respective options because the command and options are similar to apt and it uses the python-apt api to interact with apt.

If you’ve ever used the dnf package manager, then you can easily understand the output format of the nala package manager.

In the introduction section, I have added an animation of git installation using nala package manager, on which one can clearly understand what extra dependencies are required to support a particular application along with library version and size.

I’m damn sure this will not be the same case if you are using the APT package manager, because the output is a bit complex and you need to make extra focus to read what the command output is conveying to you, and for starters, it might be overwhelmed with the output of the command.

Now you may get what the main objective of the project creator is.

Apart from that, nala is capable of parallel downloads, which means packages can be downloaded pretty fast compared to the conventional APT package manager, which will download packages from 3 different mirror sources, which will ultimately balance the load on each mirror site, and hence you will find a better response.

Note: Nala does not use APT for package downloading and verification.

One of the key features of the nala package manager that personally changed my mind about using it over APT is nala history command, which is similar to the dnf history command that you will find in RedHat based systems like Fedora.

The nala history command makes a log of every transaction in /var/lib/nala/history.json, which can be later used to undo or redo changes.

In nutshell, you will find the following available features:

Features

  • Clean and Structured Frontend
  • Parallel Download Support
  • Auto fetch mirror repositories from the respective master list
  • Store Install, Remove, and Upgrade in History with Unique ID
  • Rollback to the previous installation using a Unique ID

Install Nala on Linux

Multiple Linux installations for amd64, arm64, and armhf packages are available for Nala. Currently, Nala is unavailable within repositories, but you can follow the below-listed method to install it on your system.

Method 1: Adding Custom Repositories [Recommended]

This is the preferred and easiest way to install nala package manager on your Ubuntu or Debian-based machine, so you just need to follow the below steps in the given sequence.

Open your terminal and copy-paste the below command to add the Volian Scar repositories to your system, including the Nala package.

echo "deb [arch=amd64,arm64,armhf] http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list

Next, add the GPG key for verification, as shown below.

wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null

For Ubuntu 22.04/Debian and the later versions, you need to execute the below, which will first update your system repositories and later it will install nala.

$ sudo apt update && sudo apt install nala -y

If you are using an older version like Ubuntu 21.04/Debian Stable, then you should invoke the below command, which will install nala-legacy:

$ sudo apt update && sudo apt install nala-legacy

Method 2: Install nala package manager using Pacstall

Alternatively, you can install the nala package manager from Pacstall, but for that first, you need to install Pacstall on your Ubuntu machine by running the following command:

$ sudo bash -c "$(curl -fsSL https://git.io/JsADh || wget -q https://git.io/JsADh -O -)"

Once it is done, execute the below command, to install nala.

$ pacstall -I nala-deb

Method 3: Install nala package manager using Debian Package

If you do not prefer the above method, then you can also download the “deb” package and install it locally without an internet connection using the apt or dpkg command as shown below.

$ sudo apt install /path/to/nala_version_arch.deb
#OR
$ sudo dpkg -i /path/to/nala_version_arch.deb
$ sudo apt install -f

To download the package, you can head over to the Releases page.

Nala Command Usage

The apt and nala package managers are pretty much the same, and if you are familiar with the apt command, you can easily handle and utilise the Nala package manager.

Wait, let me take a sip of coffee, and I’ll show you how to be a master user of Nala.

Updating & Upgrading system

You can easily update your system using the same apt method by replacing apt with nala package manager, as shown below.

$ sudo nala update && sudo nala upgrade

Below is the behaviour of the above command.

Updating & Upgrade System packages using Nala package manager
Updating & Upgrade System packages using Nala package manager

No offense, but are you still using the same old standard FTP (File Transfer Protocol) to exchange files from a remote system?

Use much better alternative SFTP!

Or else, if you want to first check the update and later want to upgrade, then execute the following commands separately.

$ sudo nala update
$ sudo nala ugrade

List Packages using Nala

This option is similar to dpkg --list or apt list to list out all the available applications or packages in a friendly manner where you are able to easily identify the package name along with version, and short information about utilities.

To get that information you can execute the below code:

$ nala list

Below is the behaviour of the above command.

List packages
List packages

The problem with the above option is that the output completely fills up the screen with package names, which is not convenient at all, so to add scrolling capability you can use any pager like less or more.

$ nala list | less

When you just want to list out installed packages, then use -i or –installed option.

$ nala list -i 
#OR
$ nala list --installed

You can also list out the package names which have been installed using the nala package manager.

$ nala list -N
#OR
$ nala list --nala-installed

Show Package Details

When you want to know more information about a specific package, like required dependencies, maintainer, project repo, or detailed description of the project, then you should use the nala show command, which will print the corresponding details if they are available.

Let’s say I want to check information about the terminator utility before installing it on my system. Then I need to invoke the following command:

$ nala show terminator

Undoubtedly, the output of nala show is much better than the apt show, as you can clearly see in the below image.

nala-search-show
nala search show
apt-show-command-output
apt show command output

Installing Package using Nala

Any standard package available in the repository can be easily installed using the Nala package manager. The below command will install the terminator in your Linux system (ex: Ubuntu).

$ sudo nala install terminator

Below is the behaviour of the above command.

Installing package using Nala package manager
Installing Package using Nala

Removing Packages using Nala

To remove any package, you can use the remove or purge command, depending on whether you want to keep configuration files.

By default, nala package manager also removes the underlying package which is no longer required.

In my case, I want to remove binary files without removing the configuration file of the terminator, using the below command.

$ sudo nala remove terminator

Below is the behaviour of the above command.

Removing package using Nala package manager
Removing package using Nala package manager

Alternatively, you can also execute the below command to remove the application from your system.

$ sudo nala purge terminator
#OR
$ sudo nala remove --purge terminator

Fetching all mirrors repositories

If you have ever used apt-selectapt-smartnetselect, and netselect-apt command line utilities, then you may be aware of how we used to find the fastest APT mirror.

Now you don’t need to use these utilities anymore because nala package manager is bundled with this option.

nala fetch command first identifies the Linux distribution, whether it is Debian or Ubuntu, and then fetches all the mirror repositories respective to the master list.

After fetching distribution details, it searches for the fastest mirror, where you will get the list of mirror sites according to the lowest latency and speed, which you can use on your system.

To find the fastest Ubuntu mirror, invoke the below command in your terminal window:

$ sudo nala fetch

Next, select the mirror, which you want to use by separating space like in the below image.

Fetching all mirrors repositories respective to the master list
Fetching all mirrors repositories respective to the master list

Once you specify the mirror that you want to use, press enter. After that, it will ask you for a confirmation before adding the selected mirror to /etc/apt/sources.list.d/nala-sources.list

If you are sure about the mirror, press “y” or else “n”, and choose a different mirror.

Mirror confirmation
Mirror confirmation

The last step is to update your system to use the following mirror.

$ sudo nala update

And if you don’t want to use the following mirror, then simply delete the file “/etc/apt/sources.list.d/nala-sources.list” by using the rm command.

$ sudo rm /etc/apt/sources.list.d/nala-sources.list

Nala History Command

One of the prime features of nala package manager is nala history, which is similar to dnf history that you find in the DNF package manager.

It allows you to view all the changes, and if something doesn’t go as per your intention, then you can roll back to the previous state.

Yes, it is an interesting feature of the nala command, but at the same time you may be curious about where it holds data and how I access it, then let me show you all this stuff one by one.

Nala history command stores system activity related to “Install”, “Remove” and “Upgrade” with a “Unique ID” in the history located at “/var/lib/nala/history.json” in your system.

$ nala history

Once you run the above command, it will print the details, like the unique ID of the command that you have executed, along with the date and time of the specific action. After that, it will show you the number of changes that have occurred under the respective command and the last username of the requested user.

Nala History Command
Nala History Command

From the above image, you are able to find what all the information the nala history command is stored in your system, so to get information such as package and dependencies used for a specific command in the history, use the info command along with the ID as shown below.

$ nala history info 4

When you run the above command, it will show the information about a specific transaction, which will include the header on top and the following details about packages: package nameversion, and size.

Checking info of the history command
Checking info of the history command

You can use the undo or redo command along with nala to implement changes according to your needs.

As you can see in the above image, “ID no. 4”, which installed “terminator” on your system by running "sudo nala install terminator" instead of typing "sudo nala purge terminator", we can undo the last changes by executing the below command:

$ sudo nala history undo 4

Below is the behaviour of the above command.

undo changes

Right now, the undo command is only supported for the install command.

And if you want to install it again, then execute the below code:

$ sudo nala history redo 4

Lastly, if you don’t want to store any specific transaction anymore, then you can clear it from the history record by running the following command with the “Unique ID number”.

$ sudo nala history clear 4

Once the history is cleared, you will get a gentle message on the screen that “History has been altered…”.

Nala help section

If you are not sure how to use a particular command, then the help section and manual are the best options to look for help, where most likely you will find the solution, and of course, we are there for you.

Some of the helpful commands that you can run when you are not sure how to start with the nala or particular options.

$ nala --help or nala -h
$ man nala
$ info nala

For instance, if you are not aware of how to use the purge option, then execute the below command, which will list the usage of the command, which you can see in the next available image.

$ nala purge -h

Below is the behaviour of the above command.

nala purge help usage
nala purge option help

Wrap Up

You can find more information about Nala on the project’s GitLab page.

This Post Has 6 Comments

  1. InnocentBystander

    Thank you very much for this excellent apt frontend. I am hesitant. This is giving sudo privilege to an utility which is not officially endorsed by Debian. May I have your opinion on this?

    1. Jake Redfield

      Nala is an extension to apt command, Feel free to use the sudo command with it.

  2. Butch

    I think Nala is a great extention to the apt command. I also think Blake is very helpful when you need help or assistance. I use it with fish and it runs very well and coloring of letters is very nice looking and easy on your eyes.

  3. Geoff Taylor

    Thanks for the this most comprehensive info on NALA as a substitute for the APT command. Installing it on my laptop right now. Will it also substitute for the Fedora DNF command?

    1. Jake Redfield

      Hi Geoff, Thanks for your feedback. In most cases, NALA performs all the DNF operations that it used to do in RHEL and its derivatives.

  4. James Esposito

    I have fallen in love with Nala. I recently installed Debian 11 coming from Mint 21. Debian 11 plus Nala = Win!

Leave a Reply