Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby RVM apt get更新错误_Ruby_Rvm - Fatal编程技术网

Ruby RVM apt get更新错误

Ruby RVM apt get更新错误,ruby,rvm,Ruby,Rvm,尝试使用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..ks

尝试使用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.

如何修复此问题?

RVM
如果
apt get update
出现错误,则会出现问题。如果您的
apt
有一个给出404或GPG错误的无效存储库,
RVM
将拒绝工作。这可能令人困惑,因为即使错误的存储库与
ruby
RVM
无关,也会发生这种情况

以下修复程序适用于我(Ubuntu):

运行apt get update,查看是否有任何错误。编辑
来源。在
/etc/apt
中列出
精确。列出
,以删除错误的存储库。重复此操作,直到apt get update成功且无任何错误。然后试着运行
RVM

我刚才试过了

sudo获得更新,发现其中一些失败;例如

错误/主要来源 404找不到

我继续从这里的列表中删除了这些项目

sudo gedit/etc/apt/sources.list


成功了

安装和使用rvm不需要apt

Just curl(易于安装curl)

启动
\curl-sSLhttps://get.rvm.io |bash-s稳定--ruby

rvm安装2.1.1
或其他ruby版本,并且可以正常工作;)

宝石更新等

RVM将独立于apt get,因此您将不再拥有ISU


有关更多信息:
https://rvm.io/rvm/install

在运行
curl-sSL时,我遇到了类似的错误https://get.rvm.io |bash-s稳定--ruby
。花了一段时间,但我终于意识到我打开了synaptic:安装程序无法运行,因为apt被锁定

我还必须删除失败的存储库,但我很难发现它们并根据此处的说明删除它们。所以我发现了这一点,这正好解释了为什么会发生这种情况以及如何删除失败的存储库:

sudo apt-get update | grep "Failed"
简而言之,运行以下命令以查找失败的存储库:

sudo apt-get update | grep "Failed"
示例输出可以如下所示:

:~# 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.
sudo add-apt-repository --remove ppa:upubuntu-com/web
  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}
  #  }
  }
最后使用此命令删除失败的回购:

对于这里的示例,它将如下所示:

:~# 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.
sudo add-apt-repository --remove ppa:upubuntu-com/web
  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}
  #  }
  }

另外,也可以在rvm中减少垃圾。我在/usr/share/rvm/scripts/functions/requirements/ubuntu文件中编辑了requirements\u debian\u update\u system(),如下所示:

:~# 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.
sudo add-apt-repository --remove ppa:upubuntu-com/web
  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}
  #  }
  }

我也有同样的问题。如果其他答案都不起作用,试试这个。我运行了以下命令来修复它:

sudo apt get-f安装


然后我想起那天早些时候我没能安装一个软件包。此命令所做的是解析该包上的依赖项,并允许RVM执行其操作。

当我的工作目录位于已装入的目录中时,我也遇到了此错误

解决方案只是:

cd~

我在sudo apt get update的底部看到了这一点

E:无法更改为/path/to/my/current/directory/-chdir(13:权限被拒绝)

我也遇到了同样的错误。我尝试了上面的大多数答案,但没有一个对我有效,所以我只是更换了服务器

  • 转到目录etc/apt
  • 点击Sources.list
  • 将服务器更改为我们或其他服务器
  • 重新加载(它将从该服务器更新缓存)
  • 然后运行
    sudo apt get update

  • 当我试图以非sudoer用户的身份安装Ruby版本时,这种情况也发生在我身上。但是,当我以管理员用户身份登录(具有sudo权限)并运行
    sudo-apt-get-update | grep“Failed”
    时,我不会收到任何错误,
    rvm-install x.x.x
    仍会要求输入密码(当我以非sudoer用户身份运行
    rvm-install
    时)

    有一段时间我一直在为这个问题绞尽脑汁,因为我不想让我的rvm(普通用户)用户拥有sudo权限。然后,在谷歌上进行了一些搜索之后,我发现我可以作为我的管理员用户登录

    按照以下步骤为该用户安装RVM:

    $gpg—密钥服务器hkp://keys.gnupg.net --接收键409B6B1796C275462A1703113804BB82D39DC0E3

    $\curl-sSL | bash-s稳定

    $source~/.rvm/scripts/rvm

    然后(作为管理员用户)直接开始安装RVM所需的软件包:

    $rvm要求

    在这一点上,它要求我输入sudo密码,并在我输入密码后为整个系统安装所需的apt软件包

    然后我以管理员用户的身份从服务器注销,并以rvm用户的身份重新登录(没有sudo权限),然后尝试安装Ruby版本

    $rvm安装x.x.x


    现在它开始工作了

    您可以尝试跳过rvm更新系统,以便不会调用apt get

    # Disable RVM from trying to install necessary software via apt-get
    rvm autolibs disable
    
    # Then try installing Ruby:
    rvm install 2.4.0
    


    这对我来说很好^

    这个问题是由
    apt get update
    导致的,因此您必须禁用PPA:

    系统设置>软件和更新>其他软件


    然后重新安装。

    在我的例子中,rvm遗漏了一些linux软件包,没有sudo就无法安装这些软件包。根本没有apt get安装错误


    使用sudo运行rvm install ruby x.x.x时,rvm安装了构建ruby所需的软件包,该软件包运行正常。

    问题-要求\u debian\u更新\u系统ruby-2.2.2错误

    我也有同样的问题。我在这个链接上找到了一些信息

    我遵循这一点,解决了我的问题。能够将ruby安装为

    rvm install 2.2
    
    1) 在安装ruby之前,必须完成以下更新:

    在最近的Ubuntu版本中,apt比apt get更适合交互使用,apt应通过以下方式进行修复:

    sudo apt update
    sudo apt upgrade
    
    或者使用apt get——允许发布信息更改

    sudo apt-get --allow-releaseinfo-change update
    
    2) 成功安装后,例如ruby-2.3.1:

    rvm install 2.3.1
    

    问题在于在中配置的源:

    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list
    
    因此,要检查错误,您必须运行此命令,并需要找到哪个PPA触发错误:

    sudo apt-get update | grep "Failed"
    
    然后解决这个问题