Skip to content

Instantly share code, notes, and snippets.

@ravihara
Last active December 14, 2015 03:18
Show Gist options
  • Save ravihara/5019604 to your computer and use it in GitHub Desktop.
Save ravihara/5019604 to your computer and use it in GitHub Desktop.
A bash script to automate the installation of LibreOffice 4.x.y on Debian Squeeze (Stable). Please note: This will uninstall previous libreoffice related packages, already installed on the system. This script is only for 64bit Debian-Squeeze, and installs en-GB language packages only.
#!/bin/bash -e
TMP_INST_DIR="/tmp/LibreOffice"
mkdir -p $TMP_INST_DIR && pushd $TMP_INST_DIR
# Remove existing libreoffice installations
apt-get remove --purge --yes libreoffice* && sync
# Get 4.x version of libreoffice, if not in TMP_INST_DIR
if [ ! -f "LibreOffice_4.0.0_Linux_x86-64_deb.tar.gz" ]; then
wget -c http://download.documentfoundation.org/libreoffice/stable/4.0.0/deb/x86_64/LibreOffice_4.0.0_Linux_x86-64_deb.tar.gz
fi
if [ ! -f "LibreOffice_4.0.0_Linux_x86-64_deb_helppack_en-GB.tar.gz" ]; then
wget -c http://download.documentfoundation.org/libreoffice/stable/4.0.0/deb/x86_64/LibreOffice_4.0.0_Linux_x86-64_deb_helppack_en-GB.tar.gz
fi
if [ ! -f "LibreOffice_4.0.0_Linux_x86-64_deb_langpack_en-GB.tar.gz" ]; then
wget -c http://download.documentfoundation.org/libreoffice/stable/4.0.0/deb/x86_64/LibreOffice_4.0.0_Linux_x86-64_deb_langpack_en-GB.tar.gz
fi
# Untar the deb package archives and install
tar -xzvf LibreOffice_4.0.0_Linux_x86-64_deb.tar.gz
pushd LibreOffice_4.0.0.3_Linux_x86-64_deb/DEBS/ && dpkg -i *.deb
pushd desktop-integration && dpkg -i libreoffice4.0-debian-menus_4.0.0-103_all.deb
popd
popd
tar -xzvf LibreOffice_4.0.0_Linux_x86-64_deb_langpack_en-GB.tar.gz
pushd LibreOffice_4.0.0.3_Linux_x86-64_deb_langpack_en-GB/DEBS/ && dpkg -i *.deb
popd
tar -xzvf LibreOffice_4.0.0_Linux_x86-64_deb_helppack_en-GB.tar.gz
pushd LibreOffice_4.0.0.3_Linux_x86-64_deb_helppack_en-GB/DEBS/ && dpkg -i *.deb
popd
popd
echo "You can use the downloaded tarballs in TMP_INST_DIR, for future installation (ex., in some other machine)."
echo "Keep the tarballs in TMP_INST_DIR before running the script and it should pickup the local files."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment