在UBUNTU 16中安装R.

时间:2016-10-29 04:46:55

标签: r linux bash ubuntu

我遵循的步骤:

  1. 添加R repo:sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list
  2. 添加密钥:gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
  3. 使用第二个命令后的结果

    gpg: requesting key E084DAB9 from hkp server subkeys.pgp.net 
    gpgkeys: key E084DAB9 can't be retrieved
    gpg: no valid OpenPGP data found. 
    gpg: Total number processed: 0 
    gpg: keyserver communications error: keyserver helper general error 
    gpg: keyserver communications error: unknown pubkey algorithm 
    gpg: keyserver receive failed: unknown pubkey algorithm
    

    我搜索了这个问题并尝试了:

    • 由于我使用的是代理,因此我在export http_proxy=http://username:password@10.1.1.16:80添加了export https_proxy=https://username:password@10.1.1.16:80bash.bashrc
      

    仍然是同样的错误

    • 问题可能源于防火墙:我已更改port number
      

    仍然是同样的错误

    • 手动复制密钥
    Version: SKS 1.1.5
    
    Comment: Hostname: pgp.mit.edu
    
    mQGiBEXUFiURBADkTqPqcRYdLIguhC6fnwTvIxdkoN1UEBuPR6NYW4iJzvRSas/g5bPo5ZxE
    2i5BXiuVfYrSk/YiU+/lc0K6VYNDygbOfpBgGGhtfzYfFRTYNq8QsdD8L8BMYtOu5rYo5BYt
    a0vuantIS9mn9QnH7885uy5tX/TXO7ICYVHxnFNr2wCguNtMdz9+DRQ38n4iiHzTtj/7UHsD
    /0+0TLHHvY1FfakVinamR9oCm9uH9PmkGTy6jRnrvg5Z+TTgygiDdTBKPc1TqpFgoFtqh8G5
    DpDPbyh5GzBj8Ky1mBJb3bMwy2RUth1cztHEWI36xuCl+KrLtA4OYuCwJJZhOWDIO9aO2LW5
    kJhIwIuvSrEtOgTxpzy82g7eEzvLBADUrQ01fj+9VDrO2Vept8jtaGK+4kW3cBAG/UbOrTjt
    63VurXwyvNb6q7hKFUaVH42Fc0e64F217mutCyftPWYJwY4SR8hUmjEM/SYcezUDWWvVxmkF
    8M4rMhHa0j+q+et3mTKwgxehQO9hLUqRebnmJuwNqNJKb9izsPqmh83Zo7Q7Sm9oYW5uZXMg
    UmFua2UgKENSQU4gRGViaWFuIGFyY2hpdmUpIDxqcmFua2VAdW5pLWJyZW1lbi5kZT6IRgQQ
    EQIABgUCRdQ+nQAKCRAvD04U9kmvkJ3+AJ4xLMELB/fT1AwtR1azcH0lKg/TegCdEvtp3SUf
    aHP3Jvg2CkzTZOatfFuIRgQQEQIABgUCS4VoCgAKCRDvfNpxC67+5ZFyAKCAzgPTqM6sSMhB
    iaZbNCpiVtwDrQCgjMy+iqPm7SVOCq0XJsCCbxymfB+IXgQTEQIAHgUCRdQWJQIbAwYLCQgH
    AwIDFQIDAxYCAQIeAQIXgAAKCRAG+Q3lOBukgM09AKCuapN6slttAFRjs2/mgtaMMwO9sgCf
    ZD2au39Oo8QLXZhZTipN8c7j9mM=
    =BRgm
    

    并将其保存到文件jranke_cran.asc

    然后使用sudo apt-key add jranke_cran.asc

    添加apt键

    错误

      

    gpg:找不到有效的OpenPGP数据。

    我已经尝试了很多但仍然不成功。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

似乎gpg无法访问密钥服务器, 很可能你有代理配置问题。

根据此other post,正确的密钥与您发布的内容略有不同:

Public Key Server -- Get ``0x51716619e084dab9 ''

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.0.10

mQENBEy9tcUBCACnWQfqdrcz7tQL/iCeWDYSYPwXpPMUMLE721HfFH7d8ErunPKPIwq1v4Cr
NmMjcainofbu/BfuZESSK1hBAItOk/5VTkzCJlzkrHY9g5v+XlBMPDQC9u4AE/myw3p52+0N
XsnBz+a35mxJKMl+9v9ztvueA6EmLr2xaLf/nx4XwXUMSi1Lp8i8XpAOz/Xg1fspPMRhuDAG
YDnOh4uH1jADGoqYaPMty0yVEmzx74qvdIOvfgj16A/9LYXk67td6/JQ5LFCZmFsbahAsqi9
inNgBZmnfXO4m4lhzeqNjJAgaw7Fz2z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