Linux-Mint

無法在 Linux Mint 17.2 上安裝 LibreOffice 5,未考慮策略規則?

  • October 22, 2015

我正在嘗試按照web upd8文章Install LibreOffice 5.0 In Ubuntu Or Linux Mint Via PPA安裝軟體包,不同之處在於我使用 Fresh PPA

環境

$ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 17.2 Rafaela
Release:        17.2
Codename:       rafaela

Pinnig規則

$ cat /etc/apt/preferences.d/libreoffice-ppa.pref
Package: *
Pin: release o=LP-PPA-libreoffice-ppa
Pin-Priority: 701

安裝

然後我添加 ppa 和 update/dist-upgrade

$ sudo add-apt-repository ppa:libreoffice/ppa
$ sudo apt-get update
$ sudo apt-get dist-upgrade

記憶體策略

然而,記憶體策略仍然對包具有不正確的優先級。

$ apt-cache policy libreoffice
libreoffice:
 Installed: (none)
 Candidate: 1:4.4.3~rc2-0ubuntu1~trusty1
 Version table:
    1:5.0.2-0ubuntu1~trusty1 0
       500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ trusty/main amd64 Packages
    1:4.4.3~rc2-0ubuntu1~trusty1 0
       700 http://packages.linuxmint.com/ rafaela/import amd64 Packages
    1:4.2.8-0ubuntu2 0
       500 http://mirrors.coreix.net/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://mirrors.coreix.net/ubuntu/ trusty/universe amd64 Packages

問題

為什麼我的規則沒有被考慮?

簡短的回答

的固定規則中的錯誤來源/etc/apt/preferences.d/libreoffice-ppa.pref

Pin: release o=LP-PPA-libreoffice-ppa

應該是(刪除-ppa):

Pin: release o=LP-PPA-libreoffice

長答案

你想從下載包

http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ trusty/main

所以如果你看

http://ppa.launchpad.net/libreoffice/ppa/ubuntu/dists/trusty/Release

你會找到

Origin: LP-PPA-libreoffice
Label: LibreOffice Fresh
Suite: trusty
Version: 14.04
Codename: trusty
Date: Sat, 10 Oct 2015  7:06:48 UTC
Architectures: amd64 arm64 armhf i386 powerpc ppc64el
Components: main
Description: Ubuntu Trusty 14.04
MD5Sum:
...

所以你應該/etc/apt/preferences.d/libreoffice-ppa.pref相應地改變。

引用自:https://unix.stackexchange.com/questions/237848