3

I would like to get a listing of the space used by programs, preferably with the largest listed first.

I am keeping 18.04 ONLY since 20.04 has "broken" my Canon TS9120 scanner.

I could then un-install those programs that are not needed.

1
  • I'm not sure if it notifies you. I've put up a second method that you may want to try. You can turn it into a command that you can easily use time and time again. I just wanted to make you aware of the change. – KGIII Aug 21 '20 at 12:26
4

Method #1

This one is relatively straightforward. You're going to open your terminal, do a search, and then sort that information.

Press CTRL + ALT + T and open the terminal. Enter the following and press the enter button.

dpkg-query -W -f='${Installed-Size;8}  ${Package}\n' | sort -nr

That's going to flood your window, so you can easily send it to a text file.

dpkg-query -W -f='${Installed-Size;8}  ${Package}\n' | sort -nr >> appsizes.txt

That will make a text file in your home directory with the name of appsizes.txt and you can use that as reference.

Method #2

Open your favorite plain text editor and cut/paste the following:

#!/bin/bash

export LC_ALL=C

aptitude show $(dpkg-query -Wf '${Package}\n') |
  awk '$1 == "Package:"     { name = $2 }
       $1 == "Uncompressed" { printf("%10s %s\n", $3, name) }' |
  awk '$1 ~ /k/ { $1 *= 1 }; $1 ~ /M/ { $1 *= 1024 }
       { printf("%9d %s\n", $1, $2)}'

Now, save it (preferably in your home directory) as applist.sh.

Open your terminal and enter the following:

chmod +x ./applist.sh
./applist.sh

That'll do pretty much the same as the first method - except you can just execute the script whenever you want. If you want to be all fancy, try this (make sure you've made it executable in the step above:

sudo cp ./applist.sh /usr/bin

Now, no matter what directory you're in with your terminal, you can just run applist.sh. If you want to make it a text file, you can still do something like applist.sh >> ~/applist.txt.

2
  • I made a post at the Canon website seeking help with getting my scanner working. If that does not work, I will un-install 20.04 and go back to 18.04. – fixit7 Aug 21 '20 at 12:34
  • 1
    @fixit7 18.04 is supported for another couple of years and extended support (free for personal use up to three computers, as I understand) is available for a few years beyond that. I plan on sticking with Lubuntu 18.04 as long as reasonably possible, supporting it myself if need be. Either way, this answer is now up in case others want to try that out. I have stuck with HP and had good luck with them, if that means anything. I don't do much scanning or printing, so my needs are pretty basic. – KGIII Aug 21 '20 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.