Skip to content

Instantly share code, notes, and snippets.

@dungsaga
Last active March 6, 2026 05:16
Show Gist options
  • Select an option

  • Save dungsaga/b3f5cfff39a7124652e5f1f996814b66 to your computer and use it in GitHub Desktop.

Select an option

Save dungsaga/b3f5cfff39a7124652e5f1f996814b66 to your computer and use it in GitHub Desktop.
install and uninstall LibreOffice packages (under Debian/Ubuntu/...)
# INSTALLATION:
tar xf --strip-components=1 LibreOffice_26.2.0_Linux_x86-64_deb.tar.gz
sudo dpkg -i DEBS/*.deb
# UNINSTALLATION:
tar xf --strip-components=1 LibreOffice_26.2.0_Linux_x86-64_deb.tar.gz
cd DEBS
for f in DEBS/*.deb; do sudo dpkg -r --force-depends "${f/_*/}"; done
# alternative methods of UNINSTALLATION
pkgs=$(tar tf LibreOffice_26.2.0_Linux_x86-64_deb.tar.gz | grep '\.deb$' | sed -E 's#.+/DEBS/([^_]+)_.+#\1#')
pkgs=$(tar tf LibreOffice_26.2.0_Linux_x86-64_deb.tar.gz | grep -oP '(?<=/DEBS/)[^_]+')
pkgs=$(dpkg --get-selections | grep -oP '(libobasis26|libreoffice26)\S+')
for p in $pkgs; do sudo dpkg -r --force-depends "$p"; done
# NOTE: replace "26.2.0" with your LibreOffice version number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment