ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • update-alternative setup for libreoffice
    Computer/linux 2014. 3. 21. 10:56

    Debian Wheezy has the libreoffice 3.5.4 as the default office suite, somehow, I don't like to use 3. For better handling stupid MS file formats, I installed LibreOffice4 from its website via downloading deb packages :


    jhlee@kaffee:/volatile/firefox_download$ tar zvxf LibreOffice_4.1.5_Linux_x86-64_deb.tar.gz
    jhlee@kaffee:/volatile/firefox_download$ cd LibreOffice_4.1.5.3_Linux_x86-64_deb/
    jhlee@kaffee:/volatile/firefox_download/LibreOffice_4.1.5.3_Linux_x86-64_deb$ ls
    DEBS/  readmes/
    jhlee@kaffee:/volatile/firefox_download/LibreOffice_4.1.5.3_Linux_x86-64_deb$ cd DEBS/
    jhlee@kaffee:/volatile/firefox_download/LibreOffice_4.1.5.3_Linux_x86-64_deb/DEBS$ su
    Password:
    root@kaffee:/volatile/firefox_download/LibreOffice_4.1.5.3_Linux_x86-64_deb/DEBS# dpkg -i *.deb

    But, still the default executable links are libreoffice3, find the executable links via whereis {libreoffice, soffice}

    jhlee@kaffee:~$ whereis {soffice,libreoffice}
    soffice: /usr/bin/soffice /usr/bin/X11/soffice
    libreoffice: /usr/bin/libreoffice4.1 /usr/bin/libreoffice4.1-printeradmin /etc/libreoffice /usr/lib/libreoffice /usr/bin/X11/libreoffice4.1 /usr/bin/X11/libreoffice4.1-printeradmin /usr/share/libreoffice /usr/share/man/man1/libreoffice.1.gz

    Then, select all real executable links for both libreoffice versions as follows:

    root@kaffee:/usr/share# ls -ltar /usr/bin/libreoffice*
    lrwxrwxrwx 1 root root 34 May 30  2013 /usr/bin/libreoffice -> ../lib/libreoffice/program/soffice
    lrwxrwxrwx 1 root root 35 Feb  6 07:06 /usr/bin/libreoffice4.1 -> /opt/libreoffice4.1/program/soffice

    root@kaffee:/usr/share# ls -ltar /usr/bin/X11/libreoffice*
    lrwxrwxrwx 1 root root 34 May 30  2013 /usr/bin/X11/libreoffice -> ../lib/libreoffice/program/soffice
    lrwxrwxrwx 1 root root 35 Feb  6 07:06 /usr/bin/X11/libreoffice4.1 -> /opt/libreoffice4.1/program/soffice

    root@kaffee:/home/jhlee# ls -ltar /usr/bin/soffice /usr/bin/X11/soffice
    lrwxrwxrwx 1 root root 34 May 30  2013 /usr/bin/X11/soffice -> ../lib/libreoffice/program/soffice
    lrwxrwxrwx 1 root root 34 May 30  2013 /usr/bin/soffice -> ../lib/libreoffice/program/soffice

    [Update] Remove 4.1, and install 4.3,

    Make a symbolic link in /opt in order to reduce the further work for next upgrade.

    lrwxrwxrwx  1 root root   14 Nov 24 08:28 libreoffice -> libreoffice4.3

    and  did the following commands,

    root@kaffee:/usr/share# update-alternatives --install /usr/bin/libreoffice libreoffice /usr/lib/libreoffice/program/soffice  1
    root@kaffee:/usr/share# update-alternatives --install /usr/bin/libreoffice libreoffice /opt/libreoffice/program/soffice  1
    root@kaffee:/usr/share# update-alternatives --install /usr/bin/soffice libreoffice /opt/libreoffice/program/soffice 1
    root@kaffee:/usr/share# update-alternatives --install /usr/bin/X11/soffice libreoffice /opt/libreoffice/program/soffice 1

    Still don't understand what the last numbe 1 means (man page tells its prority). I naively assume it doesn't matter for my enviroment.

    root@kaffee:/opt# update-alternatives --config libreoffice
    There are 2 choices for the alternative libreoffice (providing /usr/bin/X11/soffice).

      Selection    Path                                  Priority   Status
    ------------------------------------------------------------
    * 0            /opt/libreoffice/program/soffice       1         auto mode
      1            /opt/libreoffice/program/soffice       1         manual mode
      2            /usr/lib/libreoffice/program/soffice   1         manual mode

    Press enter to keep the current choice[*], or type selection number:


    So, soffice or libreoffice could execute libreoffice4 instead of 3.


    댓글

Designed by Tistory.