簡體   English   中英

Ruby RVM apt-get 更新錯誤

[英]Ruby RVM apt-get update error

嘗試使用 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.

我怎樣才能解決這個問題?

如果apt-get update有錯誤, RVM表現不佳。 如果您的apt sources有一個無效的存儲庫,導致 404 或 GPG 錯誤, RVM將拒絕工作。 這可能會令人困惑,因為即使錯誤的存儲庫與rubyRVM無關,也會發生這種情況。

以下修復對我有用(Ubuntu):

運行apt-get update看看有沒有錯誤。 編輯/etc/apt sources.listprecise.list以刪除有問題的存儲庫。 重復直到apt-get update成功且沒有任何錯誤。 然后嘗試運行RVM

您可以嘗試跳過 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

https://stackoverflow.com/a/16759839/1212791

我還必須刪除失敗的存儲庫,但我很難根據此處的說明發現它們並刪除它們。 所以我找到了這個鏈接,它解釋了為什么會發生這種情況以及如何刪除失敗的存儲庫:

簡而言之,運行以下命令來查找失敗的存儲庫:

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.

最后使用此命令刪除失敗的 repo(s):

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

對於此處的示例,它將如下所示:

sudo add-apt-repository --remove ppa:upubuntu-com/web

或者,也可以在 rvm 中減少廢話。 我在文件 /usr/share/rvm/scripts/functions/requirements/ubuntu 中編輯了 requirements_debian_update_system() ,如下所示:

  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}
  #  }
  }

當我嘗試以非 sudoer 用戶身份安裝 Ruby 版本時,這也發生在我身上。 但是,當我以管理員用戶身份(具有 sudo 權限)登錄並運行sudo apt-get update | grep "Failed" sudo apt-get update | grep "Failed"我不會得到任何錯誤,但是, rvm install xxx仍然會導致要求輸入密碼(當我以非 sudoer 用戶身份運行rvm install時。)

我對此感到困惑了一段時間,因為我不希望我的 rvm(普通用戶)用戶擁有 sudo 權限。 然后在谷歌上閑逛之后,我發現我可以以我的管理員用戶身份登錄。

完成為該用戶安裝 RVM 的步驟(根據他們的文檔):

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

$ \\curl -sSL https://get.rvm.io | bash -s 穩定

$ source ~/.rvm/scripts/rvm

然后(作為管理員用戶)直接安裝 RVM 所需的軟件包:

$ rvm requirements

此時它會詢問我的 sudo 密碼並在我輸入密碼后為整個系統安裝所需的 apt 包。

然后我以管理員用戶身份從服務器注銷並以 rvm 用戶身份重新登錄(沒有 sudo 權限)並嘗試安裝一個 Ruby 版本。

$ rvm install xxx

現在它起作用了。

您不需要 apt-get 來安裝 rvm 並使用它!

只是卷曲(apt-get install curl)

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

rvm install 2.1.1或其他 ruby​​ 版本,它可以工作;)

寶石更新等...

RVM 將獨立於 apt-get,因此您將不再有問題。

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

我遇到過同樣的問題。 如果其他答案都不起作用,請嘗試此操作。 我運行以下命令來修復它:

sudo apt-get -f install

然后我想起那天早些時候我沒有安裝軟件包。 這個命令的作用是解決對該包的依賴,並允許 RVM 做它的事情。

我剛試過

sudo apt-get update 並發現其中一些失敗; 例如..

錯誤http://extras.ubuntu.com raring/main Sources 404 Not Found

我繼續從這里的列表中刪除了這些項目..

須藤 gedit /etc/apt/sources.list

有效!

我在運行curl -sSL https://get.rvm.io | bash -s stable --ruby時遇到與此類似的錯誤curl -sSL https://get.rvm.io | bash -s stable --ruby curl -sSL https://get.rvm.io | bash -s stable --ruby 花了一段時間,但我終於意識到我打開了突觸:安裝程序無法運行,因為 apt 被鎖定

當我的工作目錄位於已安裝目錄中時,我也收到此錯誤。

修復只是為了:

cd ~

我在 sudo apt-get update 的底部看到了這個

E: Unable to change to /path/to/my/current/directory/ - chdir (13: Permission denied)

我遇到了同樣的錯誤。我嘗試了上面的大部分答案,但沒有一個對我有用,所以我只是更換服務器

  1. 轉到目錄 etc/apt
  2. 單擊 Sources.list
  3. 將服務器更改為我們或其他服務器
  4. 重新加載(它將從該服務器更新您的緩存)
  5. 然后運行sudo apt-get update

這個問題是由apt-get update引起的,所以你必須禁用 PPA:

系統設置>軟件和更新>其他軟件

然后重新安裝。

在我的情況下,rvm 錯過了一些 linux 軟件包,沒有 sudo 就無法安裝這些軟件包。 根本沒有 apt-get 安裝錯誤。

當使用 sudo 運行 rvm install ruby​​ xxx 時,rvm 安裝了構建 ruby​​ 所需的軟件包並且它工作正常。

問題 - requirements_debian_update_system ruby​​-2.2.2 錯誤

我也有同樣的問題。 我在這個鏈接上找到了信息點擊這里

我遵循了這個並解決了我的問題。 能夠將 ruby​​ 安裝為

rvm install 2.2

1) 在安裝 ruby​​ 之前必須完成更新:

在最近的 Ubuntu 版本中,apt 比 apt-get 更適合交互式使用,並且 apt 應該通過以下方式修復:

sudo apt update
sudo apt upgrade

或者與 apt-get 一起使用 --allow-releaseinfo-change

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

2)安裝成功后,例如ruby-2.3.1:

rvm install 2.3.1
apt install libc6:amd64 libc6:amd64 libc6 libc6-dev:amd64 libc6-dev libc-dev-bin libc-bin man-db libc-dev-bin libc6-dev:amd64

那對我來說很好用^^

問題在於您配置的來源:

/etc/apt/sources.list
/etc/apt/sources.list.d/*.list

因此,要檢查錯誤,您必須運行此命令並需要找到哪個 PPA 觸發錯誤:

sudo apt-get update | grep "Failed"

然后要解決此錯誤,您必須按 Windows 鍵並需要搜索“軟件和更新”。

然后打開它並進入其他軟件,在那里您可以看到一些更新失敗的 URL。

然后取消選中這些 URL 並關閉此窗口,然后執行

sudo apt-get update 

最后,您可以安裝 ruby

rvm install 2.4

PS:您可以更改要安裝ruby的版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM