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?
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 nala
Code 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
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
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
History
To see past transactions of packages installed via the nala
command, run nala history
:
sudo nala history
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 packagesremove
: Remove packagespurge
: Purge packagesupdate
: Update the package list and upgrade the systemupgrade
: Alias for the update commandfetch
: Fetches fast mirrors to speed up downloadsshow
: Show package detailshistory
: Show transaction historyclean
: 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 rawdpkg
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.