Score:0

Discrepancy in disk usage after `apt-get purge` and `apt-get autoremove`

cn flag
  • I recently ran the command sudo apt-get install imagemagick
  • During installation, apt-get showed the message After this operation, 84.7 MB of additional disk space will be used.
  • I then decided I didn't want imagemagick any more, so ran sudo apt-get purge imagemagick, which showed the message After this operation, 119 kB disk space will be freed.
  • Noticing the discrepancy between 84.7 MB and 119 kB, I then ran the command sudo apt-get autoremove, which showed 0 upgraded, 0 newly installed, 0 to remove and 281 not upgraded., and sudo apt-get autoremove --purge, which also showed 0 upgraded, 0 newly installed, 0 to remove and 281 not upgraded.
  • Am I missing something here? It seems like imagemagick consumed 84.7 MB on installation and only freed 119 kB on removal - how do I remove the remaining data?
mook765 avatar
cn flag
Ubunut version please?
Jake Levi avatar
cn flag
`$ lsb_release -a` -> ... `Description: Ubuntu 18.04.2 LTS` ... (installed inside WSL on Windows 10)
mook765 avatar
cn flag
18.04 is End of Life and not supported anymore, therefor off-topic here. `imagemagick` is a dummypackage, removing this package does not remove the software. Check your logs `/var/log/apt/term.log` which packages actually got installed. I think `sudo apt remove --autoremove imagemagick*` will solve your problem
Jake Levi avatar
cn flag
Interesting, thanks! When you say "removing this package does not remove the software" - what is `apt` removing, if not the software?
Jake Levi avatar
cn flag
Also, is it safe to use `*` in `apt remove`? I'm just looking through the comments and answers [here](https://askubuntu.com/questions/187888/what-is-the-correct-way-to-completely-remove-an-application)
mook765 avatar
cn flag
It removes the package named `imagemagick` which is a dummy package. Read the package description `apt show imagemagick`.The command I suggested should be safe, just read the output of apt carefully before proceeding. In doubt, check your logs as suggested and remove the specific packages.
Jake Levi avatar
cn flag
Note to self: an easy and safe way to see all installed packages which contain the string `imagemagick` is to use the command `apt list | grep imagemagick`
Jake Levi avatar
cn flag
*That should have said `apt list --installed | grep imagemagick` (note **`--installed`**)
Jake Levi avatar
cn flag
Also, @mook765 what exactly do you mean by a "dummy package" in this context? I've done some Googling but there doesn't seem to be a unique definition of "dummy package", and it's not explained explicitly what's meant by "dummy package" in the output from `apt show imagemagick`
raj avatar
cn flag
raj
"Dummy package" is a package that installs basically almost nothing by itself (hence only 119 kB is freed by removing it), but pulls in several other packages as dependencies when installed - and it's those dependencies that take up 84.7 MB. Running `apt autoremove` not always removes all package's dependencies. You might need to check the dependencies of `imagemagick` and remove each of them individually. When you installed `imagemagick`, `apt` should have shown you all the dependencies it pulled in.
user535733 avatar
cn flag
`281 not upgraded` suggests that you have other problems to address first.
guiverc avatar
cn flag
[Ubuntu 18.04 LTS has reached the end of it's *standard* support life](https://fridge.ubuntu.com/2023/05/13/extended-security-maintenance-for-ubuntu-18-04-bionic-beaver-begins-31-may-2023/) thus is now off-topic here unless your question is specific to helping you move to a supported release of Ubuntu. Ubuntu 18.04 ESM support is available, but not on-topic here, see https://askubuntu.com/help/on-topic See also https://ubuntu.com//blog/18-04-end-of-standard-support
guiverc avatar
cn flag
18.04.2 implies you're *years* behind on applying security fixes... I hope you keep that system offline! (https://fridge.ubuntu.com/2019/08/08/ubuntu-18-04-3-lts-released/ shows the date in 2019 when the 18.04.3 ISO was released, but installed systems upgraded to it **before** that date!)
Score:0
cn flag

Luckily I still had the terminal window open with the output from the command sudo apt-get install imagemagick, which contained the following output in particular:

$ sudo apt-get install imagemagick

...

The following additional packages will be installed:
...
Suggested packages:
...
The following NEW packages will be installed:
  fontconfig fontconfig-config fonts-dejavu-core fonts-droid-fallback fonts-noto-mono ghostscript gsfonts hicolor-icon-theme imagemagick
  imagemagick-6-common imagemagick-6.q16 libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcups2 libcupsfilters1 libcupsimage2
  libdatrie1 libdjvulibre-text libdjvulibre21 libfftw3-double3 libfontconfig1 libgraphite2-3 libgs9 libgs9-common libharfbuzz0b libijs-0.35
  libilmbase12 libjbig0 libjbig2dec0 libjpeg-turbo8 libjpeg8 liblcms2-2 liblqr-1-0 libltdl7 libmagickcore-6.q16-3 libmagickcore-6.q16-3-extra
  libmagickwand-6.q16-3 libnetpbm10 libopenexr22 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpixman-1-0
  libthai-data libthai0 libtiff5 libwmf0.2-7 libxcb-render0 libxcb-shm0 libxrender1 netpbm poppler-data
...

So I copied all the packages listed below "The following NEW packages will be installed" into a single command preceeded by sudo apt purge, which I ran, and this reclaimed the missing disk space.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.