Skip to main content

Apt vs Apt-get Commands on Ubuntu

Introduction

The primary difference is that apt is a newer, more user-friendly command-line interface designed for interactive use, while apt-get is an older, low-level tool primarily maintained for scripting and backward compatibility.

Since 2014, the apt command has been the recommended tool for daily package management on Debian-based systems like Ubuntu, as it simplifies and combines the most frequently used functions of older tools like apt-get and apt-cache.

⚙️ Key Differences

Featureapt-get (Older, Low-Level)apt (Newer, User-Friendly)
User ExperienceLess verbose output, no progress bar.More information, including a progress bar during installation/upgrade.
SearchRequires the separate apt-cache search command.Includes search capability (apt search <package>).
Dependency HandlingStandard dependency resolution.Superior dependency resolution, can suggest or recommend packages.
Upgrade Behaviorapt-get upgrade does not install newly required packages for dependencies; it also leaves old package versions on the system.apt upgrade installs new dependencies and by default removes obsolete package versions to free up disk space.
Recommended UsePrimarily for scripts and automation (due to stable, predictable output).Primarily for interactive, day-to-day package management.

💻 Example Commands

For example the two commands below are equivalent:

  1. sudo apt install virtualbox-guest-utils
  2. sudo apt-get install virtualbox-guest-utils

The commands will achieve the same result (installing the package) because install is a function that both tools support identically.

However, moving forward, it's generally recommended to switch to apt for your daily interactive use (like your example above) to benefit from the improved user experience and feature set. You can continue to use apt-get in any existing scripts to ensure they don't break, as the output of apt is not guaranteed to be backward-compatible.

Adverts