If you are running out of space on the system, the most basic thing to do is check what is taking up how much space.
There will be several factors behind that. From logs to cache, it could be anything.
But have you ever wondered which application is taking more space? Yes, this is possible for apt packages at least.
And this guide is focused on how you can check the APT packages that consume the most space on Ubuntu.
Discover APT packages that consume the most space on Ubuntu
To find the APT packages that consume the most space, I will be using a command named
To use dpigs, you will have to install a package named
sudo apt install debian-goodies
Once you are done with the installation, all you need to do is use the
But to display package size in human-readable form, you will have to use the
-H option as shown:
And it will get you the top 10 APT packages taking the most space on your Ubuntu system.
But what if you want to list more than 10? Well, you can specify the number of packages you want using the
So let's say I want to find the top 20 APT packages taking the most space, I will be using the following command:
dpigs -H -n 20
Once you find the unnecessary package, you can remove it from your system.
And for that purpose, we have a dedicated guide covering how to remove apt packages:
Bonus: Find the largest source packages of binary packages on Ubuntu
The dpigs command can also find the largest source packages for you.
All you need to do is use the
-S option with the dpigs command:
dpigs -H -S
And that's it!
This was a quick guide on how you can find the APT packages consuming the most disk space on Ubuntu.
And if you have any queries or recommendations related to what I should cover next, let me know in the comments.