在debian上更新R——正确格式的/etc/apt/sources.list

在debian上更新R——正确格式的/etc/apt/sources.list,r,linux,R,Linux,我无法安装我需要的一些r软件包。以下是一条错误消息: Warning in install.packages : package 'fivethirtyeight' is not available (for R version 3.2.3) 我的R版本与我最近安装的OS相同 我试图按照debian的说明更新R(我运行的是LinuxMint18.2Sonya) 显示错误消息 r-base is already the newest version (3.2.3-4). r-base-d

我无法安装我需要的一些r软件包。以下是一条错误消息:

Warning in install.packages : package 'fivethirtyeight' is not available (for R version 3.2.3)
我的R版本与我最近安装的OS相同

  • 我试图按照debian的说明更新R(我运行的是LinuxMint18.2Sonya)

    显示错误消息

    r-base is already the newest version (3.2.3-4). 
    r-base-dev is already the newest version (3.2.3-4).
    
这不应该是真的——我相当肯定最新版本是3.5。大约在这个时候,Rstudio停止打开,我无法测试软件包的安装,我预计在我有了一个好版本的R之后需要重新安装Rstudio

我注意到,cran用

在/etc/apt/sources.list中有适当的条目。。。可以安装最新的R版本,包括推荐的软件包

在这之前我尝试过的其他一些解决问题的步骤(我想是)也涉及到编辑这个,所以

  • 我尝试修改/etc/apt/sources。列出我现在拥有的文件,如下所示:

     #deb cdrom:[Linux Mint 18.2 _Sonya_ - Release amd64 20170628]/ xenial contrib m$
     deb http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/
     deb http://us.archive.ubuntu.com/ubuntu/ sonya main restricted
    
  • 我仍然无法更新,我将在下面包括apt-get命令的输出,但是它很详细,我希望没有人需要阅读它

  • /etc/apt/sources.list应该是什么样子?

  • sudo apt-get update
    
    Ign:1 http://packages.linuxmint.com sonya InRelease
    Get:2 http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ 
    [ommited for lack of reputation to post links]...
    Ign:22 http://us.archive.ubuntu.com/ubuntu sonya/restricted Translation-en_US
    Ign:23 http://us.archive.ubuntu.com/ubuntu sonya/restricted Translation-en
    Fetched 4,371 B in 6s (710 B/s)
    Reading package lists... Done
    W: GPG error: http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCAE2A0E115C3D8A
    W: The repository 'http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ InRelease' is not signed.
    N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    W: The repository 'http://us.archive.ubuntu.com/ubuntu sonya Release' does not have a Release file.
    N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/sonya/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.26 80]
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    
    
    sudo apt-get install r-base r-base-dev
    
    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.5.0-1~stretchcran.0) but it is not going to be installed
          Depends: r-recommended (= 3.5.0-1~stretchcran.0) but it is not going to be installed
     r-base-dev : Depends: r-base-core (>= 3.5.0-1~stretchcran.0) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    
  • 我还做错了什么?

    sudo apt-get update
    
    Ign:1 http://packages.linuxmint.com sonya InRelease
    Get:2 http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ 
    [ommited for lack of reputation to post links]...
    Ign:22 http://us.archive.ubuntu.com/ubuntu sonya/restricted Translation-en_US
    Ign:23 http://us.archive.ubuntu.com/ubuntu sonya/restricted Translation-en
    Fetched 4,371 B in 6s (710 B/s)
    Reading package lists... Done
    W: GPG error: http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCAE2A0E115C3D8A
    W: The repository 'http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ InRelease' is not signed.
    N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    W: The repository 'http://us.archive.ubuntu.com/ubuntu sonya Release' does not have a Release file.
    N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/sonya/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.26 80]
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    
    
    sudo apt-get install r-base r-base-dev
    
    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.5.0-1~stretchcran.0) but it is not going to be installed
          Depends: r-recommended (= 3.5.0-1~stretchcran.0) but it is not going to be installed
     r-base-dev : Depends: r-base-core (>= 3.5.0-1~stretchcran.0) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    
这是我的第一篇文章。欢迎对我如何改进该职位提出建议

太平洋时间1:05编辑: 前两个注释中的键都不起作用。新的错误消息如下:

kchalk@kchalk-Cin ~ $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Executing: /tmp/tmp.n3xDeOodv5/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
gpg: key E084DAB9: "Michael Rutter <marutter@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
kchalk@kchalk-Cin ~ $ sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
kchalk@kchalk-Cin ~ $ sudo apt-get update
...Ign:25 http://us.archive.ubuntu.com/ubuntu sonya/restricted Translation-en     
Fetched 190 kB in 6s (30.1 kB/s)                                               
Reading package lists... Done
W: GPG error: http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCAE2A0E115C3D8A
W: The repository 'http://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran35/ InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://us.archive.ubuntu.com/ubuntu sonya Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/sonya/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.26 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
kchalk@kchalk-Cin ~ $ 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.5.0-1~stretchcran.0) but it is not going to be installed
          Depends: r-recommended (= 3.5.0-1~stretchcran.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
这并没有完全解决我的问题——我会留下上面给我的错误,以防它发生在其他人身上。所做的工作是注释掉/etc/apt/sources.list中的所有内容,只包括以下内容

deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/
然后我可以运行apt-get-update和apt-get-install,最终得到一个足够新的R版本(卡洛斯·桑蒂兰的答案中添加了一个键的那一行在这里可能也很重要。)本着引用的精神,
varun palekar的回答最终让我意识到,在我的源列表中有一个格式错误的条目会阻止格式良好的条目正常工作

看起来在R3.2.3上不支持Cran提供的第五个第三个版本

版本:0.4.0 视情况而定:R(≥ 3.2.4) 你能从Cran下载更新版本的R吗

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base

看起来R3.2.3不支持Cran提供的fivethirtyeight

版本:0.4.0 视情况而定:R(≥ 3.2.4) 你能从Cran下载更新版本的R吗

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base

对于Debian stretch,以下过程对我有效:

编辑
/etc/apt/sources.list
添加

deb http://cran.rstudio.com/bin/linux/debian stretch-cran35/
然后安装并添加密钥:

sudo apt install dirmngr
sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
因此,请更新并安装R:

sudo apt update
sudo apt install r-base

我从

获得了Debian stretch,以下步骤对我有效:

编辑
/etc/apt/sources.list
添加

deb http://cran.rstudio.com/bin/linux/debian stretch-cran35/
然后安装并添加密钥:

sudo apt install dirmngr
sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
因此,请更新并安装R:

sudo apt update
sudo apt install r-base

我是从

获得的,错误消息太长,无法发表评论。请参阅编辑。错误消息对于注释来说太长。请参见编辑。