Operations 4 min read

Common apt Commands for Managing Packages on Ubuntu

This article provides a concise guide to using the apt package manager on Ubuntu, covering installation, updating package lists, upgrading, searching, displaying information, removing packages, and cleaning up unused files with clear command examples.

DevOps Operations Practice
DevOps Operations Practice
DevOps Operations Practice
Common apt Commands for Managing Packages on Ubuntu

In Ubuntu, apt is a widely used package management tool for installing, updating, removing, and managing software packages.

The article summarizes the most common apt commands to help you efficiently manage software on your Ubuntu system.

1. Install a package

Use the following command:

sudo apt install <pkg_name>

For example, to install Firefox:

sudo apt install firefox

2. Update the package list

Before installing or upgrading, refresh the local package index:

sudo apt update

3. Upgrade installed packages

To upgrade all installed packages to their latest versions:

sudo apt upgrade

4. Search for packages

To search for a specific package, use:

apt search example

5. Show package information

To view detailed information about a package:

apt show example

6. Remove a package

To remove an installed package:

sudo apt remove example

7. Clean up downloaded package files

Delete package files that are no longer needed:

sudo apt autoclean

8. Remove unused dependencies

Delete packages that are no longer required by any installed software:

sudo apt autoremove

Conclusion

By using these apt commands, you can easily manage software packages on Ubuntu, whether installing new software, updating the system, or cleaning up unnecessary packages. Remember to prepend sudo to obtain administrative privileges, ensuring system security and stability.

Linuxcommand lineSystem AdministrationAPTPackage Managementubuntu
DevOps Operations Practice
Written by

DevOps Operations Practice

We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.