Ruby RVM apt-get update error

2019-01-13 02: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/binaries/ubuntu/13.04/x86_64/ruby-2.1.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..kshitiz password required for 'apt-get --quiet --yes update': 
............................
Error running 'requirements_debian_update_system ruby-2.1.1',
showing last 15 lines of /home/kshitiz/.rvm/log/1400047196_ruby-2.1.1/update_system.log
++ /scripts/functions/logging : rvm_pretty_print()  78 > case "${TERM:-dumb}" in
++ /scripts/functions/logging : rvm_pretty_print()  81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print()  83 > [[ -t 2 ]]
++ /scripts/functions/logging : rvm_pretty_print()  83 > return 1
++ /scripts/functions/logging : rvm_error()  117 > printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
For 404 errors check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list

++ /scripts/functions/requirements/ubuntu : requirements_debian_update_system()  53 > return 100
Requirements installation failed with status: 100.

How can I fix this?

标签: ruby rvm
15条回答
相关推荐>>
2楼-- · 2019-01-13 02:56

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
查看更多
▲ chillily
3楼-- · 2019-01-13 02:56

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}
  #  }
  }
查看更多
地球回转人心会变
4楼-- · 2019-01-13 03:01

I had the same issue. If none of the other answers work try this. I ran the following command to fix it:

sudo apt-get -f install

Then I remembered that I failed installing a package earlier that day. What this command did was resolve the dependencies on that package and allowed RVM to do its thing.

查看更多
登录 后发表回答