How to Install and Use Nala Apt on Ubuntu

Published:5 June 2023 - 6 min. read

Nicholas Xuan Nguyen Image

Nicholas Xuan Nguyen

Read more tutorials by Nicholas Xuan Nguyen!

Azure Cloud Labs: these FREE, on‑demand Azure Cloud Labs will get you into a real‑world environment and account, walking you through step‑by‑step how to best protect, secure, and recover Azure data.

Many package managers exist; you may have tried some of them to see what fits you best. But before you continue scouring the internet for one, why not look into Nala Apt on Ubuntu?

Nala Apt, a powerful package manager for Ubuntu, lets you quickly find, install, and upgrade packages. And in this tutorial, you will discover and learn how to use Nala Apt for better package management.

Read on and never get left out of all-powerful software packages on Ubuntu!

Prerequisites

Before you can install and use Nala Apt, you need an Ubuntu system. This tutorial uses Ubuntu 22.04 LTS, but other later versions will work.

💡 Unfortunately, older versions of Ubuntu are not supported since some Python components required to install Nala are not available in earlier versions. You can upgrade your Ubuntu version if necessary.

Installing Nala Apt via the APT Package Manager

Nala Apt is a frontend written in Python for the Advanced Packaging Tool (APT). The term “frontend” refers to a software tool or interface that provides a user-friendly and simplified way to interact with the underlying APT package manager.

Ironically, Nala Apt can be installed using the standard APT package manager. This method is the quickest and most reliable way to install Nala Apt on your system.

💡 While APT is robust and feature-rich, it primarily operates through command-line commands and may have a steeper learning curve for some users.

To install Napa Apt on Ubuntu, follow these steps:

1. Open a terminal, and run the below apt update command to update the APT package manager’s local repository index.

This command ensures the latest package information is available in the repository index and helps you install up-to-date versions of packages.

sudo apt update -y
Updating the APT package manager's local repository index
Updating the APT package manager’s local repository index

2. Once updated, run the following apt install command to download and install Nala Apt (nala) on your Ubuntu system.

sudo apt install nala -y
Installing Nala Apt on Ubuntu
Installing Nala Apt on Ubuntu

If prompted as below, select the services to restart where:

  • packagekit.service – This service manages software updates, installations, and package management tasks and is selected by default, as shown below.

Restarting this service ensures any pending changes take effect.

  • unattended-upgrades.service – This service handles automated updates for your system.

If you are confident that your system is up-to-date, you can leave this option unchecked. Otherwise, consider checking it for seamless automatic updates.

But this tutorial’s choice is only the packagekit.service to restart.

nala apt - Choosing the appropriate service to restart
Choosing the appropriate service to restart

3. Lastly, execute the nala command below to check the --version of Nala Apt installed on your system

nala --version

If you see the version number, as shown below, congratulations! You have successfully installed Nala Apt on your Ubuntu system.

Checking the version of Nala Apt installed on the system
Checking the version of Nala Apt installed on the system

Installing Nala Apt via DEB package

Besides the APT package manager, you can also install Nala Apt via its DEB package. The Nala Apt developers constantly work to improve Nala Apt, addressing any issues that may arise.

Installing Nala Apt with DEB ensures you have the most recent version, incorporating the latest bug fixes and enhancements.

To install Nala Apt on Ubuntu using a DEB package:

1. Open your favorite web browser, and visit the official release page of Nala Apt.

2. Next, find the latest version, and copy the download link (URL) for the Nala Apt DEB package. The latest version at this time of writing is 0.13.

Copying the download link for the Nala Apt DEB package
Copying the download link for the Nala Apt DEB package

3. Return to the terminal, and run the following wget command to download the Nala Apt DEB package. Be sure to replace the URL with the one you noted in step two.

This command fetches the Nala Apt DEB package from the specified URL and downloads it to your current directory.

sudo wget <https://gitlab.com/volian/nala/uploads/4509f695f7a531282e0d8aba71eb3134/nala_0.13.0_all.deb>
Downloading Nala Apt’s DEB package
Downloading Nala Apt’s DEB package

4. Once downloaded, execute the below ls command to verify the downloaded Nala Apt DEB package exists in your current directory.

ls -l nala_0.13.0_all.deb

If successful, you will see the downloaded DEB file listed in the output, as shown below.

Verifying the downloaded Nala Apt DEB package
Verifying the downloaded Nala Apt DEB package

5. Run the following command to install the Nala Apt DEB package.

sudo apt install ./nala_0.13.0_all.deb
Installing the Nala Apt DEB package
Installing the Nala Apt DEB package

You may encounter an unmet dependencies error, as shown below. But no worries! Read on and see how to fix this error.

Fixing unmet dependencies error
Fixing unmet dependencies error

Execute the following command to fix (-f) unmet dependency errors.

sudo apt-get install -f
Fixing Unmet dependencies error
Fixing Unmet dependencies error

6. Lastly, run the nala command below to verify the --versions of your Nala Apt installation.

nala --version

Great! You’re now equipped with the latest Nala Apt version, ready to enjoy its enhanced package management capabilities on your Ubuntu system.

Checking the version of the Nala Apt installation
Checking the version of the Nala Apt installation

Discovering and Installing Packages With Nala Apt

With Nala Apt installed, you are almost ready to install packages on your Ubuntu system. Yes, almost. Keeping an up-to-date package list is crucial regardless of which method you used to install Nala Apt.

Nala Apt is a frontend that acts as an intermediary layer between the user and the APT package manager. But before making the most of this powerful package manager, you must update your Nala Apt package list.

To start installing packages via Nala Apt:

1. Run the command below to update your Nala Apt package repository index. This command ensures all packages listed are up-to-date.

sudo nala update

💡 Note that Nala Apt requires root or sudo privileges for running some commands, like when performing an update, installing packages, and so on.

Updating the Nala Apt Package List
Updating the Nala Apt Package List

2. Once updated, run the below commands to exit from the root user and list all packages available in the Nala Apt repository.

nala list

Pick one package from the comprehensive list of all available packages, as shown below, from essential utilities to popular applications. Nala Apt provides additional insights into package dependencies and versions.

Listing all the packages available in the Nala Apt repository
Listing all the packages available in the Nala Apt repository

Alternatively, run the command below to see if a specific package (i.e., curl) is available in the Nala Apt repository. This command helps you quickly locate the desired package within the extensive Nala Apt repository.

nala list curl

Below, the search result is explicitly filtered for the curl package. Notice the result indicates cURL is installed and is upgradeable to a newer version.

Listing a specific package
Listing a specific package

💡 Nala Apt simplifies the command-line interaction with APT by providing additional features, improved readability, tab completion, and search/filtering capabilities.

3. Now, run the below nala install command to install your desired package (curl).

When running the command, Nala Apt checks if the package is installed. If so, Nala Apt upgrades it to the latest version of an earlier version present on your system. Otherwise, Nala Apt downloads and installs the specified package.

sudo nala install curl

As shown below, you may be prompted to provide your password or confirm the installation. Follow the prompts as necessary to complete the process successfully.

Installing a specific package (curl) via Nala Apt
Installing a specific package (curl) via Nala Apt

Supercharging Nala Apt with the Fastest Mirrors!

When it comes to efficient package management, speed is of the essence. Nala Apt offers a powerful feature that allows you to configure and use the fastest mirrors available. Mirrors are servers that host a copy of the Ubuntu package repository.

These mirrors are spread across different geographical locations, ensuring users can access packages efficiently from a nearby server. You can dramatically speed up downloading and installing packages by configuring Nala Apt to use the fastest mirrors.

To configure Nala Apt to use the fastest mirrors available, follow these steps:

1. Run the below command to find (fetch) the fastest mirrors for your system.

This command scans all available Ubuntu package mirrors and selects those with the lowest ping time, indicating they are closest to your system’s location.

sudo nala fetch
Finding the fastest mirrors for your system
Finding the fastest mirrors for your system

2. Next, select the fastest mirror available to configure for Nala Apt as follows:

  • Identify the fastest mirror based on its Score on the Fastest Mirrors list, as shown below, and note its Index number. The lowest Score value indicates the fastest mirror.
  • Input the index number at the prompt, and press Enter to select the mirror. In this case, the fastest mirror’s index number is 1.
Selecting the fastest mirror
Selecting the fastest mirror

3. Type y and press Enter to confirm your selection.

Confirming the mirror selection
Confirming the mirror selection

4. Lastly, run the nala update command to refresh the package list and start using Nala Apt with the fastest mirror you selected.

sudo nala update 

Now you have successfully configured Nala Apt to use the fastest mirrors available.

From now on, all subsequent package downloads will be much faster, streamlining your workflow and enhancing your productivity.

Update the package list to use the fastest mirror
Update the package list to use the fastest mirror

Conclusion

Throughout this tutorial, you have discovered and used Nala Apt to install packages in Ubuntu. You explored an advanced feature to set the fastest mirrors to speed up package downloads and installations.

You now have all the tools necessary to become an expert at managing packages on Ubuntu with Nala Apt! But why stop here, though?

Why not explore the available commands and features like history or ZSH auto-completion to further customize your package management experience?

Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.

Explore ATA Guidebooks

Looks like you're offline!