Nala: A Prettier Frontend for the APT Command

Nala is a frontend for APT, so you can have prettier output, faster downloads of packages, and a history. Here’s how to use it!

APT – You’ve likely typed it hundreds, if not thousands of times. So why not use Nala to make things easier and prettier?

If you’re searching for a more attractive CLI tool to conduct most APT terminal operations, Nala is a good option. In short, Nala is a libapt-pkg frontend.

Sometimes it can be difficult for novice users to comprehend what apt is trying to accomplish while installing or upgrading. And this is where Nala comes on the scene.

The goal of Nala is to fix this problem by removing some redundant messages, improving package formatting, and using color to illustrate what will happen with a package during installation, removal, or upgrade.

Why Use Nala Instead of APT?

Nala

There were ultimately three significant reasons why using Nala instead of APT. 

1. Parallel Downloads

Parallel downloads are the most compelling argument to choose Nala over APT.

As you probably know, APT downloads only one package at a time, while Nala may download multiple at once. Nala can download up to 16 packages per unique mirror from your sources.list file. Therefore, it can theoretically download 16 times quicker than APT.

Nala has a limit of two threads per mirror to reduce how hard you hit mirrors. In addition, Nala alternates downloads between available mirrors to enhance download speeds even more. So, if a mirror fails, Nala goes on to the next until all defined mirrors have been exhausted.

2. Select the Fastest Mirror

The nala fetch command works similarly to netselect and netselect-apt in most cases. But nala fetch will determine whether your operating system is Debian or Ubuntu. Then Nala will grab all of the mirrors from each master list. After that, it will perform a latency test and assign a score to each mirror. Finally, the quickest three mirrors will be selected and written to a config file by Nala.

3. Package Management History

If you’re familiar with the dnf command, nala history works similarly. It stores each install, remove, or upgrade in /var/lib/nala/history.json with a unique ID number. So you can call nala history any time to print a summary of every transaction you’ve ever made.

On top of that, you can manipulate the packages with commands such as nala history undo ID or nala history redo ID.

How to Install Nala

Ubuntu and Debian users are able to install Nala by typing the commands shown below:

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
wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null
sudo apt update && sudo apt install nalaCode language: PHP (php)

Alternatively, you can download the .deb installation package from the project’s GitLab Releases page and install it locally using apt.

How to Use Nala

Remember that users with sudo privileges must run the most apt commands.

Fetch Updates & Upgrade Packages

Before any operations with nala, you need to ensure that your local copy of the package database is up-to-date. Without this, the system won’t know whether newer packages are available.

The nala update command downloads up-to-date information about available software packages and upgrade the system.

sudo nala update
Updating Packages with Nala

Installing New Packages

Once your packages database is updated, you can install any packages with the nala install command. For example, let’s install Nginx Web Server:

sudo nala install nginx
Installin a Package with Nala

Removing Packages

To remove (uninstall) an installed package, use the nala remove command. For example, to remove a package called nginx, enter:

sudo nala remove nginx
Removing Package from the System by Using Nala

History

To see past transactions of packages installed via the nala command, run nala history:

sudo nala history
Past Transactions of Packages Installed via Nala

Complete List of All Nala Commands

The general syntax of the nala command is:

nala [--options] <command>Code language: HTML, XML (xml)

Commands:

  • install: Install packages
  • remove: Remove packages
  • purge: Purge packages
  • update: Update the package list and upgrade the system
  • upgrade: Alias for the update command
  • fetch: Fetches fast mirrors to speed up downloads
  • show: Show package details
  • history: Show transaction history
  • clean: Clears out the local repository of retrieved package files

Optional arguments:

  • -h, --help: Show help message and exit
  • -y, --assume-yes: Assume ‘yes’ to all prompts and run non-interactively
  • -d, --download-only: Package files are only retrieved, not unpacked, or installed
  • -v, --verbose: Logs extra information for debugging
  • --no-update: Skips updating the package list
  • --no-autoremove: Stops Nala from auto-removing packages
  • --remove-essential: Allows the removal of essential packages
  • --raw-dpkg: Skips all formatting, and you get raw dpkg output
  • --update: Updates the package list
  • --debug: Logs extra information for debugging
  • --version: Show the program’s version number and exit
  • --license: Reads the licenses of software compiled in and then reads the GPLv3

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

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%