I am on xubuntu 22.04. When I install libreoffice with dependencies, it takes up 682 MB of space. When I then immediately remove it with --purge and --autoremove flags, it only frees up 387MB of space, leaving many packages. Why? And how do I fix it going forward?

I then manually uninstalled the rest of the packages, freeing up the remaining 296 MB.

```
~$ sudo apt install libreoffice
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ca-certificates-java default-jre default-jre-headless firebird3.0-common firebird3.0-common-doc firebird3.0-server-core firebird3.0-utils fonts-crosextra-caladea fonts-crosextra-carlito fonts-dejavu fonts-dejavu-extra
  fonts-linuxlibertine fonts-noto-extra fonts-sil-gentium fonts-sil-gentium-basic gstreamer1.0-gl gstreamer1.0-gtk3 java-common libabw-0.1-1 libatk-wrapper-java libatk-wrapper-java-jni libbsh-java libcdr-0.1-1 libe-book-0.1-1
  libel-api-java libepubgen-0.1-1 libfbclient2 libfreehand-0.1-1 libgraphene-1.0-0 libgstreamer-gl1.0-0 libhsqldb1.8.0-java libib-util libjsp-api-java liblibreoffice-java libmspub-0.1-1 libmysqlclient21 libpagemaker-0.0-0 libpq5
  libreoffice-base libreoffice-base-drivers libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-impress libreoffice-java-common libreoffice-math libreoffice-nlpsolver libreoffice-report-builder libreoffice-report-builder-bin
  libreoffice-script-provider-bsh libreoffice-script-provider-js libreoffice-script-provider-python libreoffice-sdbc-firebird libreoffice-sdbc-hsqldb libreoffice-sdbc-mysql libreoffice-sdbc-postgresql libreoffice-style-elementary
  libreoffice-style-yaru libreoffice-wiki-publisher libreoffice-writer libservlet-api-java libservlet3.1-java libtommath1 libunoloader-java libvisio-0.1-1 libwebsocket-api-java libwpd-0.10-10 libwpg-0.3-3 openjdk-11-jre
  openjdk-11-jre-headless ure-java
Suggested packages:
  firebird3.0-server firebird3.0-doc java-virtual-machine libhsqldb1.8.0-java-gcj gpa imagemagick | graphicsmagick-imagemagick-compat libreoffice-grammarcheck libreoffice-help libreoffice-l10n libreoffice-librelogo myspell-dictionary
  openclipart-libreoffice pstoedit unixodbc gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav libsane1 libofficebean-java libjtds-java libsqliteodbc | tdsodbc | odbc-mdbtools
  libreoffice-evolution seahorse libreofficekit-data bluez default-mysql-server | virtual-mysql-server postgresql mediawiki fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei
The following NEW packages will be installed:
  ca-certificates-java default-jre default-jre-headless firebird3.0-common firebird3.0-common-doc firebird3.0-server-core firebird3.0-utils fonts-crosextra-caladea fonts-crosextra-carlito fonts-dejavu fonts-dejavu-extra
  fonts-linuxlibertine fonts-noto-extra fonts-sil-gentium fonts-sil-gentium-basic gstreamer1.0-gl gstreamer1.0-gtk3 java-common libabw-0.1-1 libatk-wrapper-java libatk-wrapper-java-jni libbsh-java libcdr-0.1-1 libe-book-0.1-1
  libel-api-java libepubgen-0.1-1 libfbclient2 libfreehand-0.1-1 libgraphene-1.0-0 libgstreamer-gl1.0-0 libhsqldb1.8.0-java libib-util libjsp-api-java liblibreoffice-java libmspub-0.1-1 libmysqlclient21 libpagemaker-0.0-0 libpq5
  libreoffice libreoffice-base libreoffice-base-drivers libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-impress libreoffice-java-common libreoffice-math libreoffice-nlpsolver libreoffice-report-builder
  libreoffice-report-builder-bin libreoffice-script-provider-bsh libreoffice-script-provider-js libreoffice-script-provider-python libreoffice-sdbc-firebird libreoffice-sdbc-hsqldb libreoffice-sdbc-mysql libreoffice-sdbc-postgresql
  libreoffice-style-elementary libreoffice-style-yaru libreoffice-wiki-publisher libreoffice-writer libservlet-api-java libservlet3.1-java libtommath1 libunoloader-java libvisio-0.1-1 libwebsocket-api-java libwpd-0.10-10 libwpg-0.3-3
  openjdk-11-jre openjdk-11-jre-headless ure-java
0 upgraded, 72 newly installed, 0 to remove and 0 not upgraded.
Need to get 165 MB of archives.
After this operation, 682 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

```

```
~$ sudo apt remove --purge --autoremove libreoffice
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  fonts-dejavu* fonts-linuxlibertine* fonts-noto-extra* fonts-sil-gentium* fonts-sil-gentium-basic* gstreamer1.0-gl* gstreamer1.0-gtk3* libbsh-java* libcdr-0.1-1* libfreehand-0.1-1* libgraphene-1.0-0* libgstreamer-gl1.0-0*
  libmspub-0.1-1* libpagemaker-0.0-0* libreoffice* libreoffice-draw* libreoffice-gnome* libreoffice-gtk3* libreoffice-impress* libreoffice-nlpsolver* libreoffice-script-provider-bsh* libreoffice-script-provider-js*
  libreoffice-script-provider-python* libreoffice-wiki-publisher* libvisio-0.1-1*
0 upgraded, 0 newly installed, 25 to remove and 0 not upgraded.
After this operation, 387 MB disk space will be freed.
Do you want to continue? [Y/n] 

```

```
~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

```

```
~$ sudo apt remove --purge --autoremove ca-certificates-java default-jre default-jre-headless firebird3.0-common firebird3.0-common-doc firebird3.0-server-core firebird3.0-utils fonts-crosextra-caladea fonts-crosextra-carlito fonts-dejavu fonts-dejavu-extra fonts-linuxlibertine fonts-noto-extra fonts-sil-gentium fonts-sil-gentium-basic gstreamer1.0-gl gstreamer1.0-gtk3 java-common libabw-0.1-1 libatk-wrapper-java libatk-wrapper-java-jni libbsh-java libcdr-0.1-1 libe-book-0.1-1 libel-api-java libepubgen-0.1-1 libfbclient2 libfreehand-0.1-1 libgraphene-1.0-0 libgstreamer-gl1.0-0 libhsqldb1.8.0-java libib-util libjsp-api-java liblibreoffice-java libmspub-0.1-1 libmysqlclient21 libpagemaker-0.0-0 libpq5 libreoffice libreoffice-base libreoffice-base-drivers libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-impress libreoffice-java-common libreoffice-math libreoffice-nlpsolver libreoffice-report-builder libreoffice-report-builder-bin libreoffice-script-provider-bsh libreoffice-script-provider-js libreoffice-script-provider-python libreoffice-sdbc-firebird libreoffice-sdbc-hsqldb libreoffice-sdbc-mysql libreoffice-sdbc-postgresql libreoffice-style-elementary libreoffice-style-yaru libreoffice-wiki-publisher libreoffice-writer libservlet-api-java libservlet3.1-java libtommath1 libunoloader-java libvisio-0.1-1 libwebsocket-api-java libwpd-0.10-10 libwpg-0.3-3 openjdk-11-jre openjdk-11-jre-headless ure-java
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'gstreamer1.0-gl' is not installed, so not removed
Package 'libcdr-0.1-1' is not installed, so not removed
Package 'libfreehand-0.1-1' is not installed, so not removed
Package 'libgraphene-1.0-0' is not installed, so not removed
Package 'libgstreamer-gl1.0-0' is not installed, so not removed
Package 'libmspub-0.1-1' is not installed, so not removed
Package 'libpagemaker-0.0-0' is not installed, so not removed
Package 'libvisio-0.1-1' is not installed, so not removed
Package 'fonts-dejavu' is not installed, so not removed
Package 'fonts-linuxlibertine' is not installed, so not removed
Package 'fonts-noto-extra' is not installed, so not removed
Package 'fonts-sil-gentium' is not installed, so not removed
Package 'fonts-sil-gentium-basic' is not installed, so not removed
Package 'libbsh-java' is not installed, so not removed
Package 'gstreamer1.0-gtk3' is not installed, so not removed
Package 'libreoffice-draw' is not installed, so not removed
Package 'libreoffice-gnome' is not installed, so not removed
Package 'libreoffice-gtk3' is not installed, so not removed
Package 'libreoffice-impress' is not installed, so not removed
Package 'libreoffice-nlpsolver' is not installed, so not removed
Package 'libreoffice' is not installed, so not removed
Package 'libreoffice-script-provider-bsh' is not installed, so not removed
Package 'libreoffice-script-provider-js' is not installed, so not removed
Package 'libreoffice-script-provider-python' is not installed, so not removed
Package 'libreoffice-wiki-publisher' is not installed, so not removed
The following packages will be REMOVED:
  ca-certificates-java* default-jre* default-jre-headless* firebird3.0-common* firebird3.0-common-doc* firebird3.0-server-core* firebird3.0-utils* fonts-crosextra-caladea* fonts-crosextra-carlito* fonts-dejavu-extra* java-common*
  libabw-0.1-1* libatk-wrapper-java* libatk-wrapper-java-jni* libe-book-0.1-1* libel-api-java* libepubgen-0.1-1* libfbclient2* libhsqldb1.8.0-java* libib-util* libjsp-api-java* liblibreoffice-java* libmysqlclient21* libpq5*
  libreoffice-base* libreoffice-base-drivers* libreoffice-java-common* libreoffice-math* libreoffice-report-builder* libreoffice-report-builder-bin* libreoffice-sdbc-firebird* libreoffice-sdbc-hsqldb* libreoffice-sdbc-mysql*
  libreoffice-sdbc-postgresql* libreoffice-style-elementary* libreoffice-style-yaru* libreoffice-writer* libservlet-api-java* libservlet3.1-java* libtommath1* libunoloader-java* libwebsocket-api-java* libwpd-0.10-10* libwpg-0.3-3*
  openjdk-11-jre* openjdk-11-jre-headless* ure-java*
0 upgraded, 0 newly installed, 47 to remove and 0 not upgraded.
After this operation, 296 MB disk space will be freed.
Do you want to continue? [Y/n]

```