Computer >> Computer tutorials >  >> System >> Linux

Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

Published May 15, 2023, 2:45 PM EDT

Sahil has been writing niche since 2021 and has considerable experience in technical and non-technical writing styles. He has been writing about Linux distros and programming languages such as Python, VBA, and SQL over the years. 

Given his experience within the technical field, he continues to work on his core skill sets, to improve his knowledge and stay abreast of the newest developments in the technology gamut. 

Advanced Package Tool (APT) is everyone’s favorite go-to package management tool when working on Debian-based distros. However, despite its rich feature set, it’s not a convenient way of managing packages for beginners.

A prominent drawback of APT is that it makes the content on your terminal screen look haphazard, and there needs to be semblance within the text on your Linux terminal.

Here comes Nala, with its streamlined containers and multicolored demarcations to make your terminal output look neater and well-structured. Here's what you should know about Nala.

What's the Fuss About Nala?

The pertinent question is, what’s Nala, and is it worthy enough to replace the coveted APT? Nala is an open-source, Python-based front-end replacement for APT. It performs various functions: parallel downloads, package updates and upgrades, history fetching, auto-fetching mirror repositories, and rollback installations.

Without delving much into the benefits at this stage, let's explore Nala's installation, followed by the features and the changes it brings within your terminal window.

Installing Nala on Ubuntu

There are a few ways to install Nala on Ubuntu/Debian:

  1. Installation from the official repositories
  2. Adding custom repositories
  3. Installing the Nala DEB package

On Ubuntu 22.04 and above, you can install Nala with any of the steps above. You need to work with Nala's custom repositories for older versions, however.

1. Installing Nala From the Official Ubuntu Repositories

First, you must update the package list on Ubuntu with the apt update command as follows:

sudo apt update

There is a difference between the apt update and upgrade commands, so it's best to use the update command initially.

Next, install Nala by running:

sudo apt install nala

2. Adding the Nala Repository on Older Ubuntu Versions

If you use an older version of Ubuntu, you can still install and use Nala successfully by installing it via third-party repositories. As a first step, access and add the Volian Scar repositories to install Nala on Ubuntu:

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

You can acquire the GPG verification key using the wget command:

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

If you are using this step to install Nala on Ubuntu 22.04 and later, execute the below command to install Nala:

sudo apt update && sudo apt install nala -y

On older versions, to install Nala's legacy version, execute the following command:

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

3. Installation via a DEB Package

The final installation step is to install Nala via its DEB package. Here's how to download and install the package on your system:

Download: Nala

  1. Head over to the download page and download the latest available DEB package. Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management
  2. Once the package downloads, open the Downloads folder on your machine. Locate the DEB package and right-click on it.
  3. Click on Open With GDebi Package Installer. Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management
  4. In the following dialog box, select the Install Package option. Enter the root password within the prompt and let the installation complete. Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

Alternatively, you can install the DEB package using dpkg as follows:

sudo dpkg -i packagename

To verify the installation, update and upgrade your system's packages using the nala command:

sudo nala update && sudo nala upgrade -y

If the command executes successfully, you can be sure Nala is ready for use on your machine.

APT vs. Nala: Comparing the Two Package Managers

Since Nala is up and running, let's compare APT's output with this Python-based package manager's output.

Update and upgrade your existing packages using APT:

sudo apt update && sudo apt upgrade -y
Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

When you look at the output after executing the apt command, you'll notice a lot of text on your screen, some of which might not even make sense to you.

Additionally, there are a lot of updates, package names, and pending and completed installations, among other details.

Subsequently, let's run the update/upgrade commands with Nala this time, as given below:

sudo nala update && sudo nala upgrade -y
Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

If you look at the text on your screen post-execution, you will notice how structured everything looks on your screen. Nala creates well-structured containers for each update element and provides a status bar showing the time left for the installation.

deb-get is another third-party package manager for Debian users, which you can use in place of dpkg for best results.

How to Use Nala on Ubuntu/Debian

Using Nala on Ubuntu/Debian or their related Linux distros is easy. You can use this front-end package manager for updates, upgrades, and even software installations.

Here's how you can use Nala in your regular activities:

1. Package Updates/Upgrades

Like APT, you can use Nala to update and upgrade your system packages. Use the following commands to do so:

sudo nala update
sudo nala upgrade 

To perform both tasks together, use the && operator:

sudo nala update && sudo nala upgrade

2. List Available Packages

If you use dpkg --list or apt list to list available packages on your Ubuntu/Debian distro, you can replace the command with Nala:

nala list

Post-execution, you will see a well-structured list of all applications available to download. However, this command consumes a lot of screen space, making it hard to scroll around.

In such a scenario, you can combine the list command with the less command, as follows:

nala list | less
Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

To display a list of your installed applications, you can use the -i or --installed option:

nala list -i

Or:

nala list --installed
Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

3. Display Package Details

Who does not like snooping around before installing an application on Linux?

Suppose you want to know some pertinent details beforehand. In that case, you can use the show command to learn more about a package and other related information, such as its source, architecture, and size, among other details.

nala show <packagename>

As an example, if you want to know more about the snap package before installing it on Ubuntu, you can use the following command:

nala show snap
Master Nala on Ubuntu: A Comprehensive Guide to Efficient Package Management

There are a few other benefits of using Nala, which you can explore by viewing the Nala man page.

Choosing Your Linux Package Manager Wisely

When using a Linux-powered operating system, you must be sure before installing any package managers.

While Ubuntu/Debian has the APT package manager installed by default, there is scope to improvise and install third-party package managers. You can pick and choose a few which you tickle your fantasy.