How can I get a list of the biggest packages currently installed in order? [duplicate]

I am running out of disk space on my root partition, and I'm attempting to remove some packages and not others.


First install debian-goodies by running the below command,

sudo apt-get install debian-goodies

Then run the below command to view the installed packages which has large size,

dpigs -H

By default,it was set to display installed 10 largest packages.You can set the number by -n parameter.

dpigs -n 20 -H

The above command lists installed largest 20 packages.

$ dpigs -h

Usage: dpigs [options]

Options:
  -n, --lines=N
    Display the N largest packages on the system (default 10).
  -s, --status=status-file
    Use status-file instead of the default dpkg status file.
  -S, --source
    Display the largest source packages of binary packages installed
    on the system.
  -H, --human-readable
    Display package sizes in human-readable format (like ls -lh or du -h)
  -h, --help
    Display this message.


If you don't have Synaptic Package Manager install it by typing the following commands in the terminal:

sudo apt-get install synaptic

(But first make sure you have allowed the Universe repository. Here's a link for the how-to: How do I enable the “Universe” repository?)

Next, start Synaptic Package Manager (reload the repos if necessary) and click on the Status tab, then click Installed,

snap1

From Settings menu, select Preferences,

snap2

Click Column and Fonts tab, scroll to find Installed Size and mark it, then click OK,

snap3

Now the Size column should appear in the Synaptic window. Click on Size to select sort column by size and toggle for ascending/descending order of arrangement.

snap4

You can then select the packages you want to remove and apply the action from this application itself.