Nala is a frontend for APT so that 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
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 in 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. To enhance download speeds even more, Nala alternates downloads between available mirrors. So, if a mirror fails, Nala goes on to the next until all defined mirrors have been exhausted.
2. Select the Fastest Mirror
nala fetch command works similarly to
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
nala history works much in the same way. It stores each install, remove, or upgrade in
/var/lib/nala/history.json with a unique
ID number. So you can call
nala history at any time to print a summary of every transaction you’ve ever made.
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
How to Use Nala
Keep in mind that most
apt commands must be run as a user with
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 if there are newer packages available or not.
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
To remove (uninstall) an installed package, use the
nala remove command. For example, to remove a package called
sudo nala remove nginx
To see past transactions of packages installed via the
nala command, run
sudo nala history
Complete List of All Nala Commands
The general syntax of the
nala command is:
nala [--options] <command>
install: Install packages
remove: Remove packages
purge: Purge packages
update: Update package list and upgrade the system
upgrade: Alias for update
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
--help: Show help message and exit
--assume-yes: Assume ‘yes’ to all prompts and run non-interactively
--download-only: Package files are only retrieved, not unpacked, or installed
--verbose: Logs extra information for debugging
--no-update: Skips updating the package list
--no-autoremove: Stops Nala from autoremoving packages
--remove-essential: Allows the removal of essential packages
--raw-dpkg: Skips all formatting and you get raw
--update: Updates the package list
--debug: Logs extra information for debugging
--version: Show 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.