In this article, we are going to learn how to install Nala package manager, and how to use it on Debian. Apt, which stands for “Advanced Package Tool”, is the default, command line package manager for Debian. Using apt, we can search, install, update, upgrade and remove packages in a DEB-based system. There are a few APT frontends that exist. Two popular APT front-ends are Aptitude and Synaptic. Today, we will talk about yet another APT frontend tool called “Nala”.
So in this article, we are going to learn how to install Nala, and how to use it.
What Is Nala?
Nala is a command line frontend for the APT package manager. Nala uses python-apt API to interact with APT. The main goal of Nala is to format the output better, and use colors to show what will happen with a package during installation, removal, and upgrade.
The functionality of Nala is the same as APT, however, Nala includes a few additional features. The developer of Nala took the inspiration from DNF package manager and implemented some of its features in Nala package manager.
In summary, Nala ships with the following distinct features out of the box.
- Pretty output formatting,
- History function,
- Parallel downloads,
- Fetch the fastest mirror.
- Nala is an open-source program written in Python. The code is freely hosted in GitLab.
How To Install Nala
We can install Nala from a PPA, or using Pacstall or apt/dpkg package managers. But we prefer to install the Nala from Binaries. So lets start.
Install Nala From Binaries
Download Nala latest .deb
file from the releases page.
And install it locally through apt
or dpkg
.
$ sudo apt install ./nala_version_all.deb $ sudo apt install -f
Or
$ sudo dpkg -i /path/to/nala_version_all.deb $ sudo apt install -f
Fetching all mirrors repositories
nala fetch command first identifies the Linux distribution, whether it is Debian or Ubuntu, and then fetches all the mirror repositories respective to the master list. After fetching distribution details, it searches for the fastest mirror, where you will get the list of mirror sites according to the lowest latency and speed, which you can use on your system.
To find the fastest Debian mirror, invoke the below command in your terminal window:
$ sudo nala fetch
Next, select the mirror, which you want to use by separating space like in the below image.
Once you specify the mirror that you want to use, press enter. After that, it will ask you for a confirmation before adding the selected mirror to /etc/apt/sources.list.d/nala-sources.list
If you are sure about the mirror, press “y” or else “n”, and choose a different mirror.
Nala Command Usage
The apt and Nala package managers are pretty much the same, and if you are familiar with the apt command, you can easily handle and utilise the Nala package manager.
Update the system
You can easily update your system using the same apt method by replacing apt with nala package manager, as shown below.
$ sudo nala update
Upgrade the System
You can easily upgradeyour system using the same apt method by replacing apt with nala package manager, as shown below.
$ sudo nala upgrade
Show Package Details
When you want to know more information about a specific package, like required dependencies, maintainer, project repo, or detailed description of the project, then you should use the nala show command, which will print the corresponding details if they are available.
Let’s say I want to check information about the terminator utility before installing it on my system. Then I need to invoke the following command:
$ nala show terminator
$ sudo nala show terminator Package: terminator Version: 2.1.0-2 Architecture: all Installed: no Priority: optional Essential: no Section: misc Source: terminator Origin: Debian Maintainer: Debian Python Team <[email protected]> Installed-Size: 2.3 MB Provides: x-terminal-emulator Depends: python3-cairo python3-configobj python3-dbus python3-gi python3-gi-cairo python3-psutil gir1.2-glib-2.0 gir1.2-gtk-3.0 gir1.2-pango-1.0 gir1.2-vte-2.91 python3:any Recommends: default-dbus-session-bus | dbus-session-bus, gir1.2-keybinder-3.0, gir1.2-notify-0.7, xdg-utils Homepage: https://github.com/gnome-terminator/terminator Download-Size: 359 KB APT-Sources: http://ftp.hk.debian.org/debian/ stable/main all Packages Description: multiple GNOME terminals in one window Terminator is a little project to produce an efficient way of filling a large area of screen space with terminals. . The user can have multiple terminals in one window and use key bindings to switch between them. See the manpage for details.
Installing Package using Nala
Any standard package available in the repository can be easily installed using the Nala package manager. The below command will install the terminator in your Linux system (ex: Ubuntu).
$ sudo nala install terminator
$ sudo nala install terminator [sudo] password for linuxips: ================================================================================ Installing ================================================================================ Package: Version: Size: gir1.2-vte-2.91 0.62.3-1 28 KB python3-configobj 5.0.6-4 36 KB python3-psutil 5.8.0-1 184 KB terminator 2.1.0-2 359 KB ================================================================================ Suggested, Will Not Be Installed ================================================================================ Package: Version: Size: python-configobj-doc 5.0.6-4 76 KB python-psutil-doc 5.8.0-1 200 KB ================================================================================ Summary ================================================================================ Install 4 Packages Total download size 607 KB Disk space required 3.5 MB Do you want to continue? [Y/n] Y http://deb.debian.org/debian/pool/main/t/terminator/terminator_2.1.0-2_all.deb ╭─ Downloading… ───────────────────────────────────────────────────────────────╮ │ Total Packages: 4/4 │ │ Last Completed: terminator_2.1.0-2_all.deb │ │ Time Remaining: 0:00:00 ━━━━━━━━━━━━━━━ 100.0% • 607.1/607.1 KB • 607.4 KB/s │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─ Installing Packages ────────────────────────────────────────────────────────╮ │Unpacking: gir1.2-vte-2.91:amd64 (0.62.3-1) │ │Unpacking: python3-configobj (5.0.6-4) │ │Unpacking: python3-psutil (5.8.0-1) │ │Unpacking: terminator (2.1.0-2) │ │Setting up: python3-psutil (5.8.0-1) │ │Setting up: python3-configobj (5.0.6-4) │ │Setting up: gir1.2-vte-2.91:amd64 (0.62.3-1) │ │Setting up: terminator (2.1.0-2) │ │update-alternatives: using /usr/bin/terminator to provide /usr/bin/x-terminal…│ │Processing: triggers for hicolor-icon-theme (0.17-2) │ │Processing: triggers for man-db (2.9.4-2) │ │Processing: triggers for mailcap (3.69) │ │Processing: triggers for desktop-file-utils (0.26-1) │ │╭────────────────────────────────────────────────────────────────────────────╮│ ││✔ Running dpkg … ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 0:00:00 • 9/9││ │╰────────────────────────────────────────────────────────────────────────────╯│ ╰──────────────────────────────────────────────────────────────────────────────╯ Finished Successfully
Nala help
To display nala command help section, use -h or –help flag like below:
$ nala --help
$ nala --help Usage: nala [OPTIONS] COMMAND [ARGS]... Each command has its own help page. For Example: `nala history --help` Options: --version Show program's version number and exit. --license Reads the GPLv3 which Nala is licensed under. --install-completion [bash|zsh|fish|powershell|pwsh] Install completion for the specified shell. --show-completion [bash|zsh|fish|powershell|pwsh] Show completion for the specified shell, to copy it or customize the installation. -h, --help Show this message and exit. Commands: autopurge Autopurge packages that are no longer needed. autoremove Autoremove packages that are no longer needed. clean Clear out the local archive of downloaded package files. fetch Fetch fast mirrors to speed up downloads. history Show transaction history. install Install packages. list List packages based on package names. purge Purge packages. remove Remove packages. search Search package names and descriptions. show Show package details. update Update package list. upgrade Update package list and upgrade the system.
Each Nala sub-command has its own help section. For instance, to view the help section of the update command, you can use the following command:
Conclusion
Using Nala, we can have prettier output, faster downloads of packages, and a history! If you do only a basic package management operations, such as install, update, upgrade, list, search, and remove etc., you can use Nala. For other advanced package management operations, use Apt.