Linux-Mint

在 Linux Mint 17.1 Cinnamon 中安裝 R-base

  • March 16, 2015

我正在嘗試使用Linux Mint 社區軟體視圖安裝包 r-base。

通過點擊“安裝”按鈕,有人問我“安裝附加軟體?”。再次點擊“安裝”,會出現以下錯誤消息:

Can not install 'r-base' (E:Unable to correct problems, you have held broken packages.) 

這是的輸出apt-cache policy

Package files:
100 /var/lib/dpkg/status
    release a=now
500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main Translation-en
500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main i386 Packages
    release v=14.04,o=LP-PPA-webupd8team-java,a=trusty,n=trusty,l=Oracle Java (JDK) 7 / 8 / 9 Installer PPA,c=main
    origin ppa.launchpad.net
500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main amd64 Packages
    release v=14.04,o=LP-PPA-webupd8team-java,a=trusty,n=trusty,l=Oracle Java (JDK) 7 / 8 / 9 Installer PPA,c=main
    origin ppa.launchpad.net
500 http://repository.spotify.com/ stable/non-free i386 Packages
    release v=0.4,o=Spotify LTD,a=stable,n=stable,l=Spotify Public Repository,c=non-free
    origin repository.spotify.com
500 http://repository.spotify.com/ stable/non-free amd64 Packages
    release v=0.4,o=Spotify LTD,a=stable,n=stable,l=Spotify Public Repository,c=non-free
    origin repository.spotify.com
500 http://archive.canonical.com/ubuntu/ trusty/partner Translation-en
500 http://archive.canonical.com/ubuntu/ trusty/partner i386 Packages
    release v=14.04,o=Canonical,a=trusty,n=trusty,l=Partner archive,c=partner
    origin archive.canonical.com
500 http://archive.canonical.com/ubuntu/ trusty/partner amd64 Packages
    release v=14.04,o=Canonical,a=trusty,n=trusty,l=Partner archive,c=partner
    origin archive.canonical.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe Translation-en
500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted Translation-en
500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse Translation-en
500 http://security.ubuntu.com/ubuntu/ trusty-security/main Translation-en
500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=multiverse
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=restricted
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/main i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=multiverse
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=restricted
    origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main
    origin security.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=multiverse
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=restricted
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=main
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=multiverse
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/restricted amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=restricted
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=main
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/universe Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty/restricted Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty/multiverse Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty/main Translation-en
500 http://archive.ubuntu.com/ubuntu/ trusty/multiverse i386 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=multiverse
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=universe
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/restricted i386 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=restricted
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=main
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=multiverse
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=universe
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/restricted amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=restricted
    origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
    release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=main
    origin archive.ubuntu.com
700 http://extra.linuxmint.com/ rebecca/main i386 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
    origin extra.linuxmint.com
700 http://extra.linuxmint.com/ rebecca/main amd64 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
    origin extra.linuxmint.com
700 http://packages.linuxmint.com/ rebecca/import i386 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=import
    origin packages.linuxmint.com
700 http://packages.linuxmint.com/ rebecca/upstream i386 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=upstream
    origin packages.linuxmint.com
700 http://packages.linuxmint.com/ rebecca/main i386 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
    origin packages.linuxmint.com
700 http://packages.linuxmint.com/ rebecca/import amd64 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=import
    origin packages.linuxmint.com
700 http://packages.linuxmint.com/ rebecca/upstream amd64 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=upstream
    origin packages.linuxmint.com
700 http://packages.linuxmint.com/ rebecca/main amd64 Packages
    release v=17.1,o=linuxmint,a=rebecca,n=rebecca,l=linuxmint,c=main
    origin packages.linuxmint.com
500 http://dl.google.com/linux/chrome/deb/ stable/main i386 Packages
    release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
    origin dl.google.com
500 http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages
    release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
    origin dl.google.com
500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    release v=12.04,o=CRAN,a=precise,n=precise,l=CRAN,c=
    origin cran.stat.ucla.edu
Pinned packages:

這是的輸出apt-cache policy r-base

r-base:
 Installed: (none)
 Candidate: 3.1.3-1precise2
 Version table:
    3.1.3-1precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.1-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.0-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.3.20140328-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.3-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.2-1ubuntu1 0
       500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
    3.0.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-6precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-5precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-3precise 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-1precise0precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.0-2precise 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.3-1precise0precise1 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.1-1precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.0-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages

最後,這是sudo apt-get install r-base程式碼的輸出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.1.3-1precise2) but it is not going to be installed
         Depends: r-recommended (= 3.1.3-1precise2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

以下是 sudo apt-cache policy r-base-core r-recommended 的輸出:

r-base-core:
 Installed: (none)
 Candidate: 3.1.3-1precise2
 Version table:
    3.1.3-1precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.1-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.0-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.3.20140328-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.3-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.2-1ubuntu1 0
       500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
    3.0.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-6precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-5precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-3precise 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-1precise0precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.0-2precise 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.3-1precise0precise1 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.1-1precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.0-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
r-recommended:
 Installed: (none)
 Candidate: 3.1.3-1precise2
 Version table:
    3.1.3-1precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.1-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.1.0-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.3.20140328-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.3-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.2-1ubuntu1 0
       500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
    3.0.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-6precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-5precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-3precise 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-1precise0precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.1-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    3.0.0-2precise 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.3-1precise0precise1 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.2-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.1-1precise2 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    2.15.0-1precise0 0
       500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages

而以下是命令終端的輸出sudo apt-get install r.base-core

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
r-base-core : Depends: libtiff4 but it is not installable
E: Unable to correct problems, you have held broken packages.

`sudo apt-cache policy libtiff4 的輸出是:

libtiff4:
 Installed: (none)
 Candidate: (none)
 Version table:

從`sudo apt-get install libtiff4 是:

`Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libtiff4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libtiff4' has no installation candidate

我也嘗試使用軟體管理器安裝它,但沒有成功。

在網際網路上瀏覽時,我發現了一些程式碼可以通過終端使用 Ubuntu 12.10+ 來安裝它,但沒有任何東西能適應 Linux Mint(或者,至少,我認為它不是)。

請問有人知道如何安裝R軟體或建議正確的程序嗎?

包括的輸出apt-cache policy

500 http://cran.stat.ucla.edu/bin/linux/ubuntu/ precise/ Packages
    release v=12.04,o=CRAN,a=precise,n=precise,l=CRAN,c=
    origin cran.stat.ucla.edu

問題是 CRAN 的來源是為了“精確”,而他們應該是為了“可靠”。海報執行的是 Mint 版本 17.1 Rebecca。這與“trusty”兼容,但與“precise”不兼容。將此 CRAN 源更改為“可信賴”後,發布者報告問題已解決。

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