Interview Q&A / Linux & Shell

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between apt and apt-get?

SHORT ANSWER

apt is the newer, friendlier front-end for interactive use, with a progress bar and combined commands such as apt install and apt list. apt-get is the older, stable interface with predictable output, so it is preferred in scripts.

Explain it simply

apt-get and apt-cache are the original tools, and apt is a modern wrapper that merges the most used parts of both into one command with nicer output.

Interactive use: apt install, apt remove, apt search, apt show, apt list --installed. It shows a progress bar and colour.

Scripts: apt-get install -y. Its output format and options are kept stable, while apt warns that its command-line interface "is not stable". If a cron job parses the output, a change in apt could break it.

Most commands behave the same. Small differences: apt can run apt update and apt upgrade hints directly, and apt full-upgrade matches apt-get dist-upgrade.

Under both sits dpkg, the low-level tool that unpacks single .deb files. apt and apt-get handle repositories and dependencies on top of it.

Example

bash
sudo apt install -y nginx          # interactive, fine
sudo apt-get install -y nginx      # use in scripts and Dockerfiles
apt search "web server" | head -3

What to say in the interview

"apt is the user-friendly front-end for daily use; apt-get has a stable interface and is the better choice in scripts and Dockerfiles. Both use dpkg underneath and the same repositories."

Common mistakes

  • Parsing apt output in scripts, which is not guaranteed stable.

#linux#package-managers#apt

Related questions

Practise more Linux & Shell questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Linux & Shell quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.