The apt utility is a package handler built by Debian. It works on Debian, Ubuntu, Linux Mint, and similar distributions. This guide shows you how to apt list installed packages on your machine using terminal commands, filter results, check for upgrades, and count total packages.
Display All Packages Using Apt List Installed Packages
To apt list installed packages on your system, type this in the terminal:
$ sudo apt list --installed
The output can be long. You can send it through the less tool for easier reading:
$ sudo apt list --installed | less
If you want to check whether a particular package exists on your machine, combine the command with grep:
$ sudo apt list --installed | grep package_name
Swap package_name with the actual name of the software you are looking for. If you are not familiar with text filtering, grep can match patterns inside any output stream.
| Command | What It Does |
|---|---|
sudo apt list --installed | Shows every package on the system |
sudo apt list --installed | less | Displays results page by page |
sudo apt list --installed | grep package_name | Finds a specific package from the list |
Show Packages Ready for an Update
Before checking which packages need an upgrade, refresh your local repository data first:
$ sudo apt update
$ sudo apt list --upgradable
To look for a specific package among those pending an upgrade, run:
$ sudo apt list --upgradable | grep package_name
This is useful when you want to confirm whether a certain piece of software has a newer version waiting. You can check the full apt man page for all available flags and options.
Find a Specific Package with Apt Search
The apt search command lets you look up any package by name:
$ apt search package_name
You can also verify if a given package exists or is already present on your system with this syntax:
$ sudo apt list -a package_name
The -a flag shows all versions available across your configured repositories, not just the installed one. If you need to install a specific version of a package, knowing the available versions first saves time.
| Command | Purpose |
|---|---|
apt search package_name | Looks up a package across all repositories |
sudo apt list -a package_name | Checks availability and install status of a package |
Count Total Installed Packages on Linux
To see how many packages are currently on your machine, run:
$ sudo apt list --installed | wc -l
This pipes the full package list into wc -l, which counts the number of lines. Each line represents one package, so the output gives you a total count. A fresh Ubuntu 24.04 server install typically has around 600 packages, while a desktop version can have 2,000 or more.
Save the Installed Package List to a File
You can redirect the output to a text file for documentation or migration:
$ sudo apt list --installed > packages.txt
This is handy when you’re setting up a new server and want to replicate the same software stack. Combine it with text search tools to scan the saved file later.
Using dpkg as an Alternative
On older systems or when you want more detail, dpkg can list installed packages too:
$ dpkg --list
$ dpkg --list | grep package_name
The dpkg output includes the package state (whether it’s installed, half-configured, or removed). Apt wraps around dpkg under the hood, so both tools query the same package database. If you ever run into issues where apt-get is not found, dpkg is your fallback.
Quick Reference Table for Apt List Installed Packages
| Task | Command |
|---|---|
| Apt list installed packages (all) | sudo apt list --installed |
| View output page by page | sudo apt list --installed | less |
| Filter by name | sudo apt list --installed | grep package_name |
| Refresh repository cache | sudo apt update |
| Show upgradable packages | sudo apt list --upgradable |
| Search for a package | apt search package_name |
| Check package availability | sudo apt list -a package_name |
| Count all installed packages | sudo apt list --installed | wc -l |
| Save list to file | sudo apt list --installed > packages.txt |
| List with dpkg | dpkg --list |
These commands work on Ubuntu, Debian, Linux Mint, and most derivative distributions running the apt package manager. If you are just getting started with the terminal, this beginner’s guide to the Linux command line covers the basics you need. For tasks like running shell scripts or installing pip on Linux, the same terminal fundamentals apply.
FAQs
How do I apt list installed packages on Ubuntu?
Run sudo apt list --installed in your terminal. Pipe the output to grep followed by a package name to filter for a specific application.
What is the difference between apt list and dpkg –list?
Both query the same package database. apt list gives cleaner output with version and repository info. dpkg --list adds package state indicators like install or removal status.
Can I export my installed packages list to a file?
Yes. Run sudo apt list --installed > packages.txt to save the full list. Use this file to replicate your setup on another machine.
How do I check if a specific package is installed using apt?
Run sudo apt list --installed | grep package_name. If the package appears in the output, it is installed. No output means it is not present.
Does apt list –installed require sudo?
It works without sudo on most systems, but using sudo avoids potential permission warnings. The output is identical either way.