LoginSignup
1
1

More than 5 years have passed since last update.

Ubuntu 14.04 で LibreOffice をダウングレードする

Last updated at Posted at 2016-06-01

TL; DR

削除されない依存パッケージがあるとダウングレードできないよ。
過去に登録した PPA リポジトリは ppa-purge 使うと削除できたよ。

環境

  • Ubuntu 14.04.2 LTS
  • AWS EC2

背景

LibreOffice 4.4.x 系が入っていた環境で 5.1.x 系にアップグレードした。
極力最新のものを使いたかったため LaunchPad の LibreOffice 公式の PPAFresh パッケージを利用している。

$ sudo apt-get install libreoffice

ただ、5.1.x 系では PDF 出力したときにレイアウトが崩れることが判明し、ダウングレードする必要性が出てきた。

最初の試み

そもそも Fresh パッケージを使うと現在の stable しか入らないため、今回のように古い stable を使い続けたいという目的には合わない。なので一旦 5.1.x 系の LibreOffice を削除して、利用する PPA を Fresh から 4.4.x に変更する。

$ sudo apt-get remove libreoffice
$ sudo add-apt-repository --remove ppa:libreoffice/ppa
$ sudo add-apt-repository ppa:libreoffice/libreoffice-4-4
$ sudo apt-get update

実行してみると、2番めと3番めのコマンドで確認メッセージが表示されて ppa-purge を使え、とか書いてあったけど、とりあえず Enter で継続してみた。

完全に消えていない・・・

最初のコマンドで LibreOffice の削除を試みましたが、依存パッケージは削除されていませんし、以前のバージョンのパッケージも一部残っていました。

$ sudo dpkg -l | grep libreoffice
ii  libreoffice-avmedia-backend-gstreamer 1:4.4.3~rc2-0ubuntu1~trusty1           amd64        GStreamer backend for LibreOffice
ii  libreoffice-base                      1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- database
ii  libreoffice-base-core                 1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- shared library
ii  libreoffice-base-drivers              1:5.1.3~rc2-0ubuntu1~trusty1           amd64        Database connectivity drivers for LibreOffice
ii  libreoffice-calc                      1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- spreadsheet
ii  libreoffice-common                    1:5.1.3~rc2-0ubuntu1~trusty1           all          office productivity suite -- arch-independent files
ii  libreoffice-core                      1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- arch-dependent files
ii  libreoffice-draw                      1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- drawing
ii  libreoffice-impress                   1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- presentation
ii  libreoffice-java-common               1:5.1.3~rc2-0ubuntu1~trusty1           all          office productivity suite -- arch-independent Java support files
ii  libreoffice-math                      1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- equation editor
ii  libreoffice-report-builder-bin        1:4.4.3~rc2-0ubuntu1~trusty1           amd64        LibreOffice component for building database reports -- libraries
ii  libreoffice-style-galaxy              1:5.1.3~rc2-0ubuntu1~trusty1           all          office productivity suite -- Galaxy (Default) symbol style
ii  libreoffice-writer                    1:5.1.3~rc2-0ubuntu1~trusty1           amd64        office productivity suite -- word processor

さらに PPA リポジトリの削除もうまくいっていないようです。1つ目の「1:5.2.3~rc2」というのが Fresh パッケージのリポジトリになります。

$ sudo apt-cache policy libreoffice
libreoffice:
  Installed: (none)
  Candidate: 1:5.1.3~rc2-0ubuntu1~trusty1
  Version table:
     1:5.1.3~rc2-0ubuntu1~trusty1 0
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ trusty/main amd64 Packages
     1:4.2.8-0ubuntu4 0
        500 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
     1:4.2.3~rc3-0ubuntu2 0
        500 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

依存パッケージを削除する

依存パッケージを削除せずに 4.4.x 系をインストールしようとするとエラーが発生するので、あらかじめ削除しておきます。

$ sudo dpkg -l | grep libreoffice | awk '{print $2}' | xargs -I{} sudo apt-get -y purge {}
$ sudo apt-get autoremove

確認します。

$ sudo dpkg -l | grep libreoffice

結果はからっぽなので消えています。

PPA リポジトリを削除する

How can PPAs be removed?
http://askubuntu.com/questions/307/how-can-ppas-be-removed

どうやら ppa-purge というツールを使って削除する方法もあるようなので試してみます。

$ sudo apt-get install ppa-purge
$ sudo ppa-purge ppa:libreoffice/ppa

メッセージを見る限りうまくいったようなので確認してみます。

$ sudo apt-cache policy libreoffice
libreoffice:
  Installed: (none)
  Candidate: 1:4.4.7~rc2-0ubuntu1~trusty1
  Version table:
     1:4.4.7~rc2-0ubuntu1~trusty1 0
        500 http://ppa.launchpad.net/libreoffice/libreoffice-4-4/ubuntu/ trusty/main amd64 Packages
     1:4.2.8-0ubuntu4 0
        500 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
     1:4.2.3~rc3-0ubuntu2 0
        500 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

5.1.x 系が消えて 4.4.x 系が表示されているので大丈夫そうです。

4.4.x をインストールする

すでに Fresh パッケージは消えてますし、LibreOffice の 4.4.x 系パッケージは Ubuntu デフォルトよりも優先度が高いため、特にバージョン指定は不要です。

$ sudo apt-get install libreoffice

完了

以上でダウングレード完了です。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1