Can't install Ruby rvm on Ubuntu 16.04 due to gpg bug

后端 未结 6 2069
轻奢々
轻奢々 2021-01-31 05:21

I\'m trying to install Ruby on Ubuntu 16.04. However when I enter to following command to terminal:

$ \\curl -sSL https://get.rvm.io | bash -s stable --ruby


        
相关标签:
6条回答
  • 2021-01-31 05:54

    This appear a port issue, Try this:

    gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    
    0 讨论(0)
  • 2021-01-31 05:57

    I had the same issue but on Debian and I took an alternate approach. In the error message, it says this: "Try to install GPG v2 and then fetch the public key:" with a gpg2 command after it. I went and installed gpg2 first and ran the command it told me to and it worked for me.

    sudo apt-get install gnupg2
    sudo apt-get install dirmngr
    gpg2 --recv-keys <key>
    # <Run curl command to install rvm>
    
    0 讨论(0)
  • 2021-01-31 05:59

    After trying many ways. I did succeed to install rails as follows:

    $ \curl -sSL https://get.rvm.io | bash
    $ source /home/<user>/.rvm/scripts/rvm
    $ rvm -v
    $ rvm install ruby
    $ ruby -v
    $ sudo apt-get install rubygems
    $ gem update
    $ sudo apt-get install ruby-dev zlib1g-dev liblzma-dev build-essential patch
    $ rvm gemset list
    $ gem install rails
    $ rails -v
    

    Where "user" is my username

    0 讨论(0)
  • 2021-01-31 06:01

    In addition to the previous answers, if you are behind a firewall, the following command might not work for you.

    gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    

    In that case, you can use the following command to get the keys -

    sudo apt-key adv --keyserver hkp://keys.gnupg.net:80 --recv-keys <<key>> <<key>>

    0 讨论(0)
  • 2021-01-31 06:04

    I am just posting an update solution for it as I faced the same issue in Ubuntu 18.04 while trying to fetch keys for RVM.

    The following method is provided by RVM.

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    

    If it doesn't work out and you try to install rvm directly, the process will fail and provides three suggestions to receive keys. One of which have a step to receive the keys with gpg2.

    Install gpg2 in your system before that.

    sudo apt install gnupg2
    

    The command is

    gpg2 --recv-keys 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    

    But this command too will not work. So here's an alternative. Just replace the gpg from the older command to gpg2 which worked for me.

    gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    
    0 讨论(0)
  • 2021-01-31 06:14

    I had issues in receiving the server keys and switched the key server to an alternative list mentioned in https://rvm.io/rvm/security

    1. hkp://ipv4.pool.sks-keyservers.net
    2. hkp://pgp.mit.edu
    3. hkp://keyserver.pgp.com
    0 讨论(0)
提交回复
热议问题