Skip to content

Instantly share code, notes, and snippets.

@0xf10e
Created August 4, 2015 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xf10e/80cb5b8c10fefed88dfd to your computer and use it in GitHub Desktop.
Save 0xf10e/80cb5b8c10fefed88dfd to your computer and use it in GitHub Desktop.
Remove all the desktop stuff from Ubuntu
#!/bin/sh
# may need additional "xubuntu-*" or the likes for other flavors
apt-get remove $(for PKG in $(dpkg-query \
--showformat='${Essential} ${Status}:${Package} ${Depends} ${Recommends}\n\n' \
--show \*-desktop lubuntu\*| sed -e '/^yes/d' -e '/not-installed/d' -e 's/^[^:]*://' \
-e 's/(\(<<\|>=\).*)//g' -e 's/|//g' -e 's/:any //g' -e s/,//g);
do
dpkg-query --showformat='${Status}: ${Package}\n' --show $PKG | sed -ne 's/^install ok installed://p';
done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment