Ruby RVM apt-get update error

前端 未结 17 2322
醉酒成梦
醉酒成梦 2020-12-02 12:03

I get following error when trying to install anything with RVM:

Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/bina         


        
相关标签:
17条回答
  • 2020-12-02 12:34
    source /etc/profile.d/rvm.sh
    

    Detali

    https://tecadmin.net/install-ruby-on-rails-on-ubuntu/

    https://rvm.io/rvm/install

    0 讨论(0)
  • 2020-12-02 12:35

    1) Before installing ruby must be done update:

    apt is preferred over apt-get for interactive use in recent Ubuntu versions and apt should fix by:

    sudo apt update
    sudo apt upgrade
    

    Or with apt-get may be used --allow-releaseinfo-change

    sudo apt-get --allow-releaseinfo-change update
    

    2) After successfully installation, for example ruby-2.3.1:

    rvm install 2.3.1
    
    0 讨论(0)
  • 2020-12-02 12:37

    RVM doesn't behave well if apt-get update has errors. If your apt sources have an invalid repository that gives 404 or GPG error, RVM will refuse to work. This can be confusing because it happens even if the faulty repository has nothing to do with ruby or RVM.

    The following fix worked for me (Ubuntu):

    Run apt-get update and see if there are any errors. Edit your sources.list and precise.list in /etc/apt to remove the faulty repositories. Repeat until apt-get update succeeds without any errors. Then try running RVM.

    0 讨论(0)
  • 2020-12-02 12:37

    I got the same error.I tried most of above answers but none works for me, so i just change server

    1. Goto directory etc/apt
    2. click on Sources.list
    3. Change the server to us or some else server
    4. Reload (it will update your cache from that server)
    5. Then run sudo apt-get update
    0 讨论(0)
  • 2020-12-02 12:40

    Alternative, it is also possible to cut the crap in rvm. I edited requirements_debian_update_system() in file /usr/share/rvm/scripts/functions/requirements/ubuntu like this:

      requirements_debian_update_system()
      {
      echo "*fake* apt-get update"
      #  __rvm_try_sudo apt-get --quiet --yes update ||
      #  {
      #    typeset __ret=$?
      #    case ${__ret} in
      #      (100)
      #        rvm_error "There has been error while updating 'apt-get', please give it some time and try again later.
      #404 errors should be fixed for rvm to proceed. Check your sources configured in:
      #    /etc/apt/sources.list
      #    /etc/apt/sources.list.d/*.list
      #"
      #        ;;
      #    esac
      #    return ${__ret}
      #  }
      }
    
    0 讨论(0)
  • 2020-12-02 12:44

    I also had to remove failing repositories but I had hard time spotting them and removing them based on instructions here. So I found this link which explains exactly why this happens and how to remove failing repositories:

    In short, run following to find failing repositories:

    sudo apt-get update | grep "Failed"
    

    An example output can be like this:

    :~# apt-get update  | grep "Failed"
    W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found
    
    W: Failed to fetch http://ppa.launchpad.net/upubuntu-com/web/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found
    
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    

    And finally use this command to remove the failing repo(s):

    sudo add-apt-repository --remove ppa:{failing ppa}
    

    for the example here it will look like this:

    sudo add-apt-repository --remove ppa:upubuntu-com/web
    
    0 讨论(0)
提交回复
热议问题