
Observe ZDNET: Add us as a most well-liked supply on Google.
ZDNET’s key takeaways
- Apt is greater than only a software program installer.
- The Debian/Ubuntu bundle supervisor can do way more.
- With these instructions at your disposal, apt turns into extra highly effective.
I’ve used Debian/Ubuntu-based distributions for many years. Due to that, I am fairly acquainted with the Apt bundle supervisor. I’ve at all times discovered this command-line instrument to be fairly straightforward and environment friendly to make use of.
Additionally: Tips on how to set up Linux functions from the command line
Though you will get away with simply utilizing the fundamental instructions, there’s way more to Apt than simply set up, take away, replace, and improve. In reality, there are a number of lesser-known choices for Apt, and I will introduce you to them.
1. apt listing
If you wish to know which packages are accessible, put in, and upgradeable, you need to use apt listing. If you wish to get a whole listing of packages, run:
apt listing
That can present each accessible bundle, whether or not put in or not. You in all probability will not assume that is very helpful, so you will wish to use a couple of useful choices, similar to:
- apt listing –upgradable – lists all put in functions that may be upgraded.
- apt listing –installed – lists all put in functions
2. apt purge
While you take away a bundle with sudo apt take away <packagename>, you are solely eradicating the software program. That leaves behind configurations, cache recordsdata, and different bits. If you wish to uninstall an software, together with all the pieces it would in any other case go away behind, use the purge choice.
The purge choice works like this:
sudo apt purge <bundle>
Additionally: I set up these 11 apps on each new Linux system, and you must, too – here is why
The place <bundle> is the title of the software program to be eliminated.
3. apt search
You may wish to verify whether or not any app you wish to set up is on the market within the default Apt repository. For instance, you may wish to set up Spotify, and also you’re undecided if you happen to can set up it with Apt. To search out out, difficulty the command:
apt search spotify
You in all probability will not see Spotify listed. As a substitute, you will see plenty of different choices. As soon as you’ve got run that command, you may both set up the app in query or you may transfer on to a different bundle supervisor to put in the software program. Within the case of Spotify, it may be put in by way of Flatpak or Snap.
One factor to remember is that the outcomes of an apt search might be fuzzy. If you wish to view solely actual matches, the command could be:
apt search spotify | grep -i -w spotify
The above command would run the usual fuzzy search, however would restrict the outcomes to solely the search string used within the grep command.
4. apt present
While you wish to view the main points a few bundle, you employ apt present, which shows writer, obtain dimension, dependencies, supply repository, conflicts, and extra. This selection might be useful whenever you wish to know what’s being put in earlier than working the set up command.
Additionally: Putting in apps on Linux? 4 methods it is completely different than some other OS – and errors to keep away from
To make use of apt present, the command is:
apt present <packagename>
For instance, you may difficulty:
apt present geary
The above command would show all the particulars in regards to the Geary e-mail software.
5. apt autoremove
Typically, whenever you uninstall an software, it would go away behind dependencies which can be not wanted and take up area. After eradicating a number of apps, the gathering of unneeded software program can get quite giant.
To eliminate all of these packages which can be not wanted, difficulty the command:
sudo apt autoremove
6. apt clear
Apt retains cached recordsdata, which might additionally take up room in your drive. Earlier than you take away them, perceive that the cache recordsdata serve the needs of allowing rollbacks, successfully dealing with dependencies, enabling offline set up, dashing up bundle installations, and saving area.
Nevertheless, if area is a matter, you may clear the Apt cache with the instructions:
sudo apt clear
sudo apt autoclean
7. apt mark
There could be an event when you do not need an software to improve. As an example, you might need learn {that a} explicit improve breaks a characteristic you want. Should you run apt improve, that software goes to be upgraded.
To keep away from that, you may mark an app in order that it is blocked from being upgraded. To illustrate you do not need VirtualBox to be upgraded. To try this, the command could be:
sudo apt-mark maintain virtualbox
You may view an inventory of all held packages with:
sudo apt-mark showhold
If you wish to unhold a bundle, the command is:
sudo apt-mark unhold <packagename>
8. apt obtain
To illustrate you wish to obtain a bundle however not set up it but. You may wish to obtain the .deb file to be put in on a machine that does not have entry to the exterior community (say, for safety functions), however you continue to want that app. You may obtain the installer file and transfer it to the air-gapped machine.
Additionally: Snap vs. Flatpak: Tips on how to resolve which Linux bundle supervisor is best for you
To illustrate you wish to obtain the VirtualBox installer file. To try this, the command could be:
sudo apt obtain virtualbox
The .deb file can be saved to the present working listing.

























