CLI:Basics – Update, Install, Remove, and Search for Packages with APT
Welcome back to the CLI:Basics series! In this lesson, we’re diving into one of the most important parts of using Linux: managing your software using the terminal. If you’re coming from Windows or just getting started with Linux, package management can seem intimidating—but don’t worry, we’ll keep things simple.
We’ll cover the most essential apt
commands you need as a beginner:
apt update
apt upgrade
apt search
apt install
apt remove
These commands apply to Linux Mint, Ubuntu, Debian, and other Debian-based distros. If you’re using Fedora or a Red Hat-based distro, you’d replace apt
with dnf
, but the basic concepts are the same.
🧰 What Is APT?
APT stands for Advanced Package Tool. It’s the standard command-line tool for handling software in Debian-based systems. It helps you:
- Keep your software up to date
- Install new packages
- Remove things you don’t need
Let’s walk through each of these actions.
🔄 apt update
– Refresh Your Package List
sudo apt update
This command does not install or upgrade anything—it simply fetches the latest package list from your repositories and stores it locally. This ensures that when you install or upgrade, you’re working with the most current versions.
🔐 Since it modifies system data, you’ll need to run it with
sudo
.
You may see a message like:
The following packages can be upgraded...
That just means newer versions are available, but APT hasn’t installed them yet.
🚀 apt upgrade
– Upgrade Outdated Packages
sudo apt upgrade
This command installs the latest versions of any packages with updates available. Occasionally, some updates are “phased,” meaning they’re rolled out gradually across systems. If that happens, you might see:
The following upgrades have been deferred due to phasing
Don’t worry—that just means the update isn’t available for your system yet. It’ll be offered soon.
🔍 apt search
– Find Available Packages
Not sure exactly what a package is called? No problem:
apt search neofetch
This will show any packages matching your search term, along with a short description. It’s helpful for verifying the package name before installing it.
➕ apt install
– Install Software
Once you’ve found what you want, install it like this:
sudo apt install neofetch
APT will show:
- Any additional dependencies it needs to install
- Suggested packages (which are optional)
- How much disk space will be used
👀 Suggested packages like
figlet
orffmpeg
might be fun, but you don’t have to install them unless you want to.
When prompted:
Do you want to continue? [Y/n]
Just press Enter to accept the default (Y
is capitalized).
➖ apt remove
– Uninstall Software
If you want to remove a package:
sudo apt remove bashtop
APT will uninstall the package and any dependencies no longer needed. If you also want to remove config files, you can use --purge
:
sudo apt remove --purge bashtop
🧪 Bonus: Installing Multiple Packages
You can install more than one package at once by separating them with spaces:
sudo apt install neofetch bashtop
APT will figure out what’s needed and do the rest.
🖥️ GUI vs CLI (Graphical vs Terminal)
In Linux Mint, clicking the shield icon in the panel will open the Update Manager. It handles updates for you graphically, just like Windows. But learning the command line gives you more control and transfers across all distros.
That’s why this series is here—to make you confident in both.
Final Thoughts
As a new Linux user, these are the core package management commands you’ll use most often. More advanced topics like managing third-party repositories, apt autoremove
, and apt clean
will be covered later in the CLI:Advanced playlist.
💬 Don’t forget to subscribe to the channel and click the bell so you don’t miss the next video!