Table of Contents#
- What is Nala?
- Why Use Nala Over APT?
- Installing Nala on Ubuntu
- Basic Nala Commands
- Advanced Nala Features
- Troubleshooting Common Issues
- Conclusion
- References
What is Nala?#
Nala is a command-line package manager frontend built on top of libapt-pkg (the same library that powers APT). Developed by the TuxDigital team, Nala aims to improve the user experience of package management without replacing APT itself. Think of it as a “wrapper” for APT: it retains APT’s core functionality but adds a polished interface, quality-of-life features, and performance boosts.
Key design goals of Nala include:
- Simplifying complex APT outputs with color-coded, human-readable formatting.
- Speeding up downloads via parallel mirroring.
- Adding safety features like transaction history and rollbacks.
- Making common tasks (e.g., updating, installing packages) more intuitive.
Why Use Nala Over APT?#
APT is powerful, but it’s not perfect. Here’s how Nala addresses its shortcomings:
1. Readable, Visual Output#
APT’s output is functional but sparse—just lines of text with minimal context. Nala uses color coding, progress bars, and clear section headers to make tasks like upgrading packages easier to follow. For example:
- Green text for successful actions, red for errors.
- Progress bars for downloads (instead of APT’s “[####################] 100%” text).
- Summary stats at the end (e.g., “Upgraded 5 packages, 2.3 MB downloaded”).
2. Faster Downloads with Parallel Mirroring#
APT downloads packages from a single mirror by default. Nala uses parallel downloads (configurable, default: 5) to fetch packages from multiple mirrors simultaneously, drastically reducing upgrade time. It also lets you rank mirrors by speed (more on this later).
3. Transaction History and Rollbacks#
Ever installed a package that broke your system? APT tracks changes, but rolling back requires manual intervention (e.g., downgrading packages). Nala automatically logs every transaction (install, upgrade, remove) and lets you undo them with a single command.
4. Intelligent Mirror Selection#
Ubuntu relies on mirrors (servers hosting packages) for updates. APT uses mirrors from /etc/apt/sources.list, but they’re not always the fastest. Nala’s fetch command tests mirrors, ranks them by speed, and configures your system to use the best ones automatically.
5. Simpler Syntax (with APT Compatibility)#
Nala’s commands mirror APT’s, so you won’t need to learn a new workflow. Swap apt update for nala update, apt upgrade for nala upgrade, and so on. It even supports APT flags (e.g., nala upgrade -y for automatic yes).
Installing Nala on Ubuntu#
Nala is available for Ubuntu 20.04 LTS (Focal Fossa) and newer. The installation process varies slightly depending on your Ubuntu version:
Step 1: Check Ubuntu Version#
First, confirm your Ubuntu release. Open a terminal and run:
lsb_release -aYou’ll see output like Release: 22.04 (Jammy Jellyfish) or 23.10 (Mantic Minotaur).
Step 2: Install Nala#
For Ubuntu 22.10+ (Mantic Minotaur and newer):#
Nala is included in Ubuntu’s official universe repository. Install it directly with APT:
sudo apt update && sudo apt install nala -yFor Ubuntu 20.04/22.04 LTS:#
Older LTS releases require adding the Volian Scar PPA (the official Nala repository):
# Add the PPA GPG key
wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar.gpg > /dev/null
# Add the PPA to sources.list
echo "deb https://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-scar.list
# Update package lists and install Nala
sudo apt update && sudo apt install nala -yStep 3: Verify Installation#
Check if Nala is installed correctly:
nala --versionYou’ll see output like nala 0.14.0 (version numbers may vary).
Basic Nala Commands#
Nala’s syntax is nearly identical to APT, so if you know apt, you know Nala. Here are the most common commands:
1. Update Package Lists#
Refresh your system’s list of available packages (like apt update):
sudo nala updateOutput: Color-coded progress bars for each repository, with a summary of updated packages.
2. Upgrade Packages#
Upgrade all installed packages to their latest versions (like apt upgrade):
sudo nala upgradeKey Differences from APT:
- Nala shows a list of packages to upgrade with version numbers and sizes before prompting for confirmation.
- Parallel downloads speed up the process.
- A final summary shows total downloaded data and upgraded packages.
3. Install a Package#
Install a new package (like apt install):
sudo nala install <package-name>Example: Install htop (a system monitor):
sudo nala install htop4. Remove a Package#
Uninstall a package (like apt remove):
sudo nala remove <package-name>To remove a package and its configuration files (like apt purge):
sudo nala purge <package-name>5. Autoremove Unused Packages#
Remove orphaned dependencies no longer needed by installed packages (like apt autoremove):
sudo nala autoremove6. Clean Cached Packages#
Delete cached package files to free up disk space (like apt clean):
sudo nala cleanAdvanced Nala Features#
Nala’s true power lies in its advanced tools. Let’s explore the most useful ones:
1. Mirror Selection with nala fetch#
Slow downloads? Nala can test and rank Ubuntu mirrors to find the fastest ones. Run:
sudo nala fetchNala will:
- Ping mirrors from Ubuntu’s official list.
- Measure download speeds.
- Ask you to select the top mirrors (default: top 5).
- Update your system to use these mirrors for future downloads.
Pro Tip: Run sudo nala fetch periodically (e.g., every few months) to account for mirror performance changes.
2. Transaction History and Rollbacks#
Nala logs every package transaction (install, upgrade, remove) in a human-readable history.
List All Transactions#
nala historyOutput example:
1. 2024-03-20 14:30: upgrade (5 packages)
2. 2024-03-18 09:15: install htop (3.2.2-1)
3. 2024-03-15 16:45: remove firefox (123.0-1)
View Transaction Details#
Get specifics about a transaction (replace 2 with the transaction number):
nala history info 2Output includes packages modified, versions, and timestamps.
Undo a Transaction#
Accidentally installed a broken package? Undo it with:
sudo nala history undo 2Nala will revert the changes from transaction #2 (e.g., remove htop in the example above).
Note: Rollbacks work best for install/remove actions. Upgrades may require manual downgrades for some packages.
3. Search for Packages#
Find packages by name or description (like apt search but with better formatting):
nala search <keyword>Example: Search for text editors:
nala search editorOutput shows package names, versions, and descriptions with matching keywords highlighted.
Troubleshooting Common Issues#
Issue 1: “Nala: command not found”#
- Fix: Ensure the PPA was added correctly (for Ubuntu 20.04/22.04). Run
sudo apt updateand try reinstalling withsudo apt install nala.
Issue 2: Slow Downloads Even After nala fetch#
- Fix: Some mirrors may be geographically distant. Run
sudo nala fetch --country <code>to limit mirrors to your country (e.g.,--country USfor United States).
Issue 3: Errors During Upgrade#
- Fix: Use
sudo nala upgrade --fix-brokento resolve dependency issues, similar toapt --fix-broken install.
Issue 4: Rollback Fails#
- Fix: Nala can’t undo all actions (e.g., upgrades to core system packages). Check
nala history info <number>to confirm the transaction type. For critical issues, restore from a Timeshift backup.
Conclusion#
Nala is more than just a “prettier APT”—it’s a smarter, safer, and faster way to manage packages on Ubuntu. With its readable output, parallel downloads, mirror selection, and rollback tools, it solves common pain points while retaining APT’s reliability.
Whether you’re upgrading your system, installing new software, or recovering from a bad update, Nala simplifies the process. Give it a try today—you might never go back to plain apt!