Installing and Using Nala on Ubuntu: A Package Manager with a Clean Interface, Parallel Downloads, and Better Performance Than APT

Ubuntu tutorial - IT technology blog
Ubuntu tutorial - IT technology blog

APT still works — but Nala does it much better

If you manage Ubuntu servers on a daily basis, you’ve probably gotten used to running apt update && apt upgrade and watching a wall of text scroll by with all sorts of mixed-in messages. APT’s output is pretty raw — no clear progress bar, no clean summary, and most importantly: packages download one at a time instead of in parallel.

I discovered Nala while looking for ways to speed up updates on a few Ubuntu 22.04 servers at work. Instead of writing complex shell scripts, Nala handles it much more cleanly. At its core, it’s a Python front-end sitting on top of libapt-pkg — the entire APT repository and dependency resolution stays the same; only the display and download logic has been reworked into something cleaner.

Where Nala outperforms APT

  • Parallel downloads: Nala downloads multiple packages simultaneously instead of sequentially. On a 100Mbps connection, installing 20 packages can be 2–3x faster.
  • Clear interface: A summary table of packages to install/remove/upgrade, real-time progress bars, and clear color coding.
  • Install history and rollback: nala history records every transaction. If you install something by mistake, nala history undo <id> can roll it back.
  • Automatic fastest mirror selection: nala fetch benchmarks mirrors and automatically selects the fastest ones for your region.
  • Less verbose: No more hundreds of repeated log lines — only what actually matters is shown.

Installing Nala on Ubuntu

Ubuntu 22.04 and later — install directly from the official repository

Starting with Ubuntu 22.04 (Jammy), Nala is available in the universe repository, so no PPA is needed:

# Ensure the universe repository is enabled
sudo add-apt-repository universe

# Update package list
sudo apt update

# Install Nala
sudo apt install nala

Ubuntu 20.04 — add the PPA first

# Add the author's PPA
echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-scar.list
wget -qO- https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-scar.asc

sudo apt update
sudo apt install nala

Once installed, verify the version:

nala --version
# Output example: nala 0.15.4

Detailed Configuration

Step 1: Fetch the fastest mirrors

This is the first feature I used after installing Nala. The nala fetch command automatically pings and benchmarks the nearest Ubuntu mirrors, then writes the results to /etc/nala/sources.list:

sudo nala fetch

Nala displays a benchmark results table with the actual download speed (MB/s) for each mirror. Select the numbers of 3–5 mirrors you want to use (enter them comma-separated), or press Enter to auto-select:

# Example output:
# ┌──────────────────────────────────────────────────────┐
# │ Index │ Mirror URL                      │ Speed      │
# ├───────┼─────────────────────────────────┼────────────┤
# │   1   │ http://mirror.kakao.com/ubuntu  │ 45.2 MB/s  │
# │   2   │ http://ftp.jaist.ac.jp/ubuntu   │ 38.7 MB/s  │
# │   3   │ http://ubuntu.mirrors.ovh.net   │ 22.1 MB/s  │
# └──────────────────────────────────────────────────────┘

# Enter: 1,2,3
# Nala writes the selection to /etc/nala/sources.list

I tested this configuration on a staging Ubuntu 22.04 environment before rolling it out to production. The results were clear: 40 package upgrades went from ~2 minutes down to about 45 seconds — thanks to the combination of closer mirrors and parallel downloads.

Step 2: Get familiar with the basic commands

Nala’s syntax is nearly identical to APT — just replace apt with nala:

# Update package list
sudo nala update

# Upgrade all packages
sudo nala upgrade

# Install a new package
sudo nala install nginx

# Remove a package
sudo nala remove nginx

# Remove package including config files
sudo nala purge nginx

# Search for a package
nala search nginx

# Show package information
nala show nginx

# Clean up cache
sudo nala clean
sudo nala autoremove

Step 3: Control the number of parallel download threads

By default, Nala uses a maximum of 3 parallel download threads. To customize this, edit the config file:

sudo nano /etc/nala/nala.conf
# Contents of /etc/nala/nala.conf
[nala]
# Number of parallel download threads (recommended: 3–6 depending on bandwidth)
max_concurrent_downloads = 5

# Disable animation when running in scripts/CI
no_animation = false

# Auto-confirm prompts (equivalent to -y in apt)
assume_yes = false

Running in a CI/CD environment or automated script? Add the --assume-yes (or -y) and --no-update flags as needed:

# In a Dockerfile or CI script
sudo nala install -y --no-update curl wget git

Step 4: Create aliases to ease the transition from APT to Nala

If your fingers are used to typing apt, add aliases to ~/.bashrc or ~/.zshrc:

# Add to ~/.bashrc
alias apt='nala'
alias apt-get='nala'

# Apply immediately
source ~/.bashrc

That said, I don’t recommend doing this on production — it’s better to type nala explicitly so you know which tool you’re using, avoiding confusion when debugging.

Tracking History and Rolling Back with Nala

Viewing transaction history

APT doesn’t have this feature natively — to see history you’d have to read /var/log/apt/history.log as raw text, which is quite inconvenient. Nala saves each install/remove/upgrade operation as a transaction with its own ID:

nala history
# Example output:
# ┌─────┬──────────┬──────────────────────┬──────────┬─────────────────────┐
# │  ID │ Command  │ Date and Time        │ Altered  │ Requested By        │
# ├─────┼──────────┼──────────────────────┼──────────┼─────────────────────┤
# │   1 │ install  │ 2026-06-01 10:23:45  │  4 Pkgs  │ ubuntu (1000)       │
# │   2 │ upgrade  │ 2026-06-01 14:05:12  │ 23 Pkgs  │ ubuntu (1000)       │
# │   3 │ install  │ 2026-06-02 09:11:33  │  2 Pkgs  │ ubuntu (1000)       │
# └─────┴──────────┴──────────────────────┴──────────┴─────────────────────┘

Viewing transaction details

# Show which packages changed in transaction ID 2
nala history info 2

Rolling back a mistaken install

Just installed a package only to find it pulled in a pile of unnecessary dependencies? Or worse, it broke something? This is where nala history undo shines:

# Undo transaction ID 3 (removes everything installed in that session)
sudo nala history undo 3

# Redo if you want to reinstall
sudo nala history redo 3

Don’t expect it to roll back everything — config files that were overwritten can’t be recovered. But for cleanly removing packages and their excess dependencies, this feature works reliably.

Real-world speed comparison: Nala vs APT

You can test this yourself by timing the installation of the same list of packages:

# Measure time with APT
time sudo apt install -y build-essential curl wget git vim htop tree

# Measure time with Nala (after removing the packages above)
sudo apt remove -y build-essential curl wget git vim htop tree
time sudo nala install -y build-essential curl wget git vim htop tree

On my test server (2-CPU VPS, Ubuntu 22.04, ~50Mbps connection), Nala was about 35–50% faster than APT when installing 10+ packages, mainly due to parallel downloads.

Integrating into a periodic maintenance script

Have a cron script running apt update && apt upgrade on a schedule? Switching to Nala takes just one line of change:

#!/bin/bash
# /usr/local/bin/system-update.sh
# Runs weekly: 0 3 * * 0 root /usr/local/bin/system-update.sh

set -e

echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting system update..."

# Use Nala instead of APT
nala update
nala upgrade -y
nala autoremove -y
nala clean

echo "[$(date '+%Y-%m-%d %H:%M:%S')] Update complete."

# Check if a reboot is required
if [ -f /var/run/reboot-required ]; then
  echo "[WARN] System requires a reboot to apply the new kernel!"
fi

A few practical notes

  • Nala still uses APT under the hood: All packages, dependency resolution, and security remain unchanged — Nala is just a UI layer on top. If there’s a package-related issue, you can still use apt to debug.
  • Don’t replace apt-get in old scripts: Keep apt-get in legacy scripts to avoid breaking them — Nala is optimized for interactive use.
  • Nala’s sources file is separate: After running nala fetch, mirrors are stored in /etc/nala/sources.list rather than overwriting /etc/apt/sources.list. Both files coexist, and Nala merges them at runtime.
  • Avoid using Nala with special debconf frontends: Some packages that require interactive debconf (like iptables-persistent) may not display correctly — use apt for those cases.

Nala isn’t a revolutionary tool. But it genuinely improves quality of life when working with servers day-to-day — install it and use it immediately, no learning curve required. If you manage Ubuntu servers regularly, 2 minutes to install Nala is all it takes to notice the difference on your very first update.

Share: