10

I'm using Debian in a chroot environment on my android. As I don't use GUI at all, I think it's better to uninstall packages related to GUI to free up space.

  1. What can I do to remove all GUI packages?
  2. How can I reinstall all those removed packages, if anything breaks after the package removal?(optional)

As a response to @Arpit Agarwal's comment, here's a link to debian installation procedure on android. debian on termux


output of apt purge libx11-6 libwayland-client0:

Reading package lists... Building dependency tree... Reading state information... Package 'libwayland-client0' is not installed, so not removed The following packages were automatically installed and are no longer required: aglfn fontconfig fontconfig-config fonts-dejavu-core fonts-droid-fallback fonts-liberation fonts-noto-mono ghostscript gnuplot-data gsfonts hicolor-icon-theme imagemagick-6-common info java-common krb5-locales libaec0 libamd2 libarpack2 libasound2 libasound2-data libauthen-sasl-perl libavahi-client3 libavahi-common-data libavahi-common3 libblas-common libblas3 libcamd2 libccolamd2 libcholmod3 libcolamd2 libcups2 libcupsfilters1 libcupsimage2 libcurl3-gnutls libcxsparse3 libdatrie1 libdjvulibre-text libdjvulibre21 libdrm-amdgpu1 libdrm-freedreno1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libedit2 libencode-locale-perl libfftw3-double3 libfftw3-single3 libfile-listing-perl libflac8 libfont-afm-perl libfontconfig1 libfreetype6 libgdk-pixbuf2.0-common libgfortran3 libgl1-mesa-dri libglapi-mesa libglib2.0-0 libglib2.0-data libglpk40 libgraphite2-3 libgs9 libgs9-common libgssapi-krb5-2 libharfbuzz0b libhdf5-100 libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libice6 libijs-0.35 libilmbase12 libio-html-perl libio-socket-ssl-perl libjack-jackd2-0 libjbig0 libjbig2dec0 libjpeg62-turbo libjxr-tools libjxr0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblapack3 liblcms2-2 libldap-2.4-2 libldap-common libllvm3.9 liblqr-1-0 libltdl7 liblua5.1-0 liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl libmetis5 libmng1 libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libnetpbm10 libnghttp2-14 libnspr4 libnss3 libogg0 libopenblas-base libopenexr22 libopenjp2-7 libopus0 libosmesa6 libpango-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper1 libpcsclite1 libpixman-1-0 libpng16-16 libportaudio2 libqhull7 libqrupdate1 libqscintilla2-l10n libqt4-dbus libqt4-network libqt4-xml libqtcore4 libqtdbus4 librtmp1 libsamplerate0 libsasl2-2 libsasl2-modules libsasl2-modules-db libsensors4 libsm6 libsndfile1 libssh2-1 libsuitesparseconfig4 libsz2 libtext-unidecode-perl libthai-data libthai0 libtiff5 libtimedate-perl libtxc-dxtn-s2tc libumfpack5 liburi-perl libvorbis0a libvorbisenc2 libwebp6 libwww-perl libwww-robotrules-perl libx11-data libx11-xcb1 libxau6 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb1 libxdmcp6 libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl libxshmfence1 libzip4 netpbm octave-common octave-info perl-openssl-defaults poppler-data psutils qdbus qtchooser qtcore4-l10n shared-mime-info tex-common texinfo ucf x11-common xdg-user-dirs Use 'apt autoremove' to remove them. The following packages will be REMOVED: ca-certificates-java* default-jre-headless* gnuplot-nox* groff* imagemagick* imagemagick-6.q16* libaudio2* libcairo2* libfltk-gl1.3* libfltk1.3* libgd3* libgdk-pixbuf2.0-0* libgl1-mesa-glx* libgl2ps1* libglu1-mesa* libgraphicsmagick++-q16-12* libgraphicsmagick-q16-3* libmagick++-6.q16-7* libmagickcore-6.q16-3* libmagickcore-6.q16-3-extra* libmagickwand-6.q16-3* liboctave3v5* libpangocairo-1.0-0* libplot2c2* libpstoedit0c2a* libqscintilla2-12v5* libqt4-opengl* libqtgui4* libwmf0.2-7* libx11-6* libxaw7* libxcursor1* libxdamage1* libxext6* libxfixes3* libxft2* libxi6* libxinerama1* libxmu6* libxpm4* libxrender1* libxt6* libxtst6* libxxf86vm1* octave* openjdk-8-jre-headless* pstoedit* qt-at-spi*

Need some suggestions regarding which packages can be removed safely without affecting Octave. Otherwise this question can be closed , if the some specific answer can't be given.

7
  • 3
    Explain how are using Debian on your Android ? Commented Feb 18, 2018 at 14:10
  • is it necessary? anyway I'm using 'termux' and chroot environment to use debian. Commented Feb 18, 2018 at 14:23
  • Here's a link to the complete procedure for installation github.com/sp4rkie/debian-on-termux Commented Feb 18, 2018 at 14:30
  • On the debian page of debootstrap, it says it is debian base system and it is only meant to be installed on a folder or partition. So, it won't have GUI packages. Commented Feb 18, 2018 at 18:49
  • But installing packages like octave automatically installs GUI packages. I was just curious about how to remove those auto-installed packages to free up some space. Commented Feb 19, 2018 at 14:28

3 Answers 3

19

On Debian, to remove all GUI packages, you can remove the two libraries used to connect to display servers:

apt purge libx11-6 libwayland-client0 

This will remove all packages depending on these libraries. The removals will be logged in the history logs in /var/log/apt, so you can look there if you need to revert a removal.

This might catch some packages which contain both CLI and GUI tools, although in most, if not all, cases those are packaged separately (so that it is possible to have a functional text-only system).

9
  • 1
    I tried running apt -s purge libx11-6 libwayland-client0. I noticed it's going to remove some packages I use frequently(like octave, in fact octave is the main reason I've installed debian on my android). Then do i have to reinstall octave after running the purge code ? Or Is there any other way so that I don't have to reinstall octave after purging? Commented Feb 18, 2018 at 16:00
  • The simplest approach is to reinstall octave after purging. If you really want to avoid that, you should look at the list of all packages which would be removed by apt purge libx11-6, and remove those manually... Commented Feb 18, 2018 at 16:06
  • How will i know which packages are octave's dependencies and filter those not for purging? Commented Feb 18, 2018 at 16:19
  • That’s why I said it would be simpler to reinstall octave after purging... apt-rdepends octave will list all of octave’s dependencies (recursively). Commented Feb 18, 2018 at 16:28
  • Okay... i think reinstalling octave is far more easier than dependency checks. I'll stick to it though I've to install whole octave package again(downloads around 100mb and takes around half an hour for complete installation) :D Commented Feb 18, 2018 at 16:35
4

GUI in linux has two parts: server and client. @stephen-kitt's answer mentions only latter.

In order to remove server part, use apt-get purge x11-common libwayland-server0

3
  • This solution also lists a frequently used package octave for purging (please check my comment on @Stephen kitt's answer). Is there any way to remove GUI packages without affecting packages like octave? reinstalling octave will take a long time. That's why I'm trying to avoid it. If there's no other way, I'll reinstall octave anyway. Commented Feb 18, 2018 at 16:14
  • I only mentioned the client libraries because that’s all that’s needed — the display servers depend on those libraries too, so they get removed as well. Commented Feb 18, 2018 at 16:56
  • I haven't tried it myself, but I see that package x11-common doesn't depend on libx11-6, so there may be other X-related packages that don't depend on libx11-6 Commented Feb 19, 2018 at 5:57
4

Others have already given some tips about that one package that should stay. So I'm focusing on the GUI packages.

Here are some ideas on removing installed GUI packages. Don't do this on a productive system unless you're really sure. I recommend running all of these commands in a screen session, where you could scroll up and save the list of removed packages.

apt-get purge 'libx11*' x11-common # "The following packages have unmet dependencies:" ... # Add the listed packages to your commmand, e.g.: apt-get purge libx11*' x11-common libxt6 xul-ext-mozvoikko # Or remove everything that has "x11" in the name: apt-get purge '*X11*' 

There seem to be quite a few that don't depend on x11-common Remove "gnome" dependencies:

apt-get purge $(apt-cache depends gnome | grep Depends | awk '{print $2}') 

The "task-desktop" metapackage should contain most of the desktop packages that were installed by default. So remove it:

apt-get purge task-desktop 

And when you're done, don't forget:

apt autoremove 

Again, this might remove a package or two that you would like to keep, so go through the list and take note of those packages that you want to reinstall. Also, think about running programs: If a login manager like lightdm is running, you need to kill its processes. If a network service was managing your /etc/resolv.conf, you might not be able to resolve domain names (apt-get update won't work anymore) until you add a nameserver to that file and so on.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.