User Tools

Site Tools


config:libreoffice

LibreOffice

Remove official distro version

sudo apt-get remove libreoffice-*
sudo apt-get purge uno-libs-private fonts-opensymbol
sudo apt-get purge libuno-sal3 libunoloader-java libridl-java libunoil-java

PPA of the latest stable release (note RC2 = final release)

sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice
/etc/apt/sources.list.d/libreoffice-ppa-focal.list
deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal main
deb-src http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal main

Latest stable from official website

Official Download Page:

https://www.libreoffice.org/download/download/?type=deb-x86_64&lang=en-GB

Bash shell script to install or update latest version:

libupdate.sh
#!/bin/sh
if [ $LOGNAME != "root" ]:
then
    echo "LibreOffice updater needs to be run as root!"
    exit
fi

#get latest libreoffice version number for deb-x86_64 packages
#use head -n 2 if stable version is preferred
url=$(curl -s "https://www.libreoffice.org/download/download/" \
          | grep "option.*type=deb-x86_64\&" | head -n 1 | cut -d '"' -f 2 | tail -n 1)
#get latest libreoffice version on web
lo_ver=$(echo "$url" | sed 's/.*\([0-9]\.[0-9]\.[0-9]\).*/\1/')
#get main version number i.e 6.2 to get binary part
lo_main_ver=$(echo "$url" | sed 's/.*\([0-9]\.[0-9]\)\.[0-9].*/\1/')

#get installed binary version number
if [ `dpkg --get-selections | grep "libreoffice.*-base.*install"|grep -v deinstall | wc -l` -eq 0 ]; then
    current_lo_v="0"
elif hash libreoffice 2>/dev/null; then
    current_lo_v=$(libreoffice --version)
else
    current_lo_v=$(libreoffice$lo_main_ver --version)
fi
current_lo_ver=$(echo "$current_lo_v" | sed 's/.*\([0-9]\.[0-9]\.[0-9]\.[0-9]\).*/\1/')

#convert version numbers to integers for comparison
lomv=$(echo "$lo_ver"         | sed 's/.*\([0-9]\)\.\([0-9]\)\.\([0-9]\).*/\1\2\3/')
locv=$(echo "$current_lo_ver" | sed 's/.*\([0-9]\)\.\([0-9]\)\.\([0-9]\)\.\([0-9]\).*/\1\2\3/')

#download and install only if web version greater than current version
#if main web version doesn't exist, then install new main version
if [ $lomv -gt $locv ];
then
    echo "Current LibreOffice version $current_lo_ver, upgrading to version $lo_ver"
    cd ~/
    wget https://download.documentfoundation.org/libreoffice/stable/${lo_ver}/deb/x86_64/LibreOffice_${lo_ver}_Linux_x86-64_deb.tar.gz
    # en-GB Language Pack
    wget http://download.documentfoundation.org/libreoffice/stable/${lo_ver}/deb/x86_64/LibreOffice_${lo_ver}_Linux_x86-64_deb_langpack_en-GB.tar.gz

    tar -xvzf LibreOffice_${lo_ver}_Linux_x86-64_deb.tar.gz
    tar -xvzf LibreOffice_${lo_ver}_Linux_x86-64_deb_langpack_en-GB.tar.gz
    cd LibreOffice_*_Linux_x86-64_deb/DEBS
    dpkg -i *.deb
    cd ../../LibreOffice_*_Linux_x86-64_deb_langpack_en-GB/DEBS
    dpkg -i *.deb
    cd ../..

    rm -rf LibreOffice_${lo_ver}*
else
    echo "Current Version $current_lo_ver, available version $lo_ver"
    echo "No upgrade necessary"
fi

Settings

To disable automatic capitalisation of the first letter, especially in LibreOffice Calc:
Tools > AutoCorrect Options… > Options > Capitalize first letter of every sentence

config/libreoffice.txt · Last modified: 2023/05/29 11:55 by 127.0.0.1