Ruby RVM apt-get update error - ruby

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?

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.

You can try to skip the rvm updating system so apt-get won't be called.
# Disable RVM from trying to install necessary software via apt-get
rvm autolibs disable
# Then try installing Ruby:
rvm install 2.4.0
See https://stackoverflow.com/a/16759839/1212791

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

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

This happened to me as well when I was trying to install a version of Ruby as a non-sudoer user. However, when I logged in as my admin user (with sudo privileges) and ran sudo apt-get update | grep "Failed" I would get no errors and, yet, rvm install x.x.x would still result in asking for a password (when I ran rvm install as the non-sudoer user.)
I was banging my head with this for a while because I didn't want my rvm (regular user) user to have sudo privileges. Then after some putzing around on Google I figured out that I could log in as my admin user.
Go through the steps of installing RVM for that user (as per their documentation):
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ \curl -sSL https://get.rvm.io | bash -s stable
$ source ~/.rvm/scripts/rvm
Then (as the admin user) jump straight into installing the RVM required packages:
$ rvm requirements
at which point it asks for my sudo password and installs the required apt packages for the entire system after I enter my password.
Then I log off from server as admin user and log back in as rvm user (with no sudo privileges) and try to install a version of Ruby.
$ rvm install x.x.x
and now it works.

You don't need of apt-get to install rvm and to use it !
Just curl (apt-get install curl)
Launch \curl -sSL https://get.rvm.io | bash -s stable --ruby
and rvm install 2.1.1 or another ruby's version and it works ;)
gem update etc...
RVM will be independent of apt-get so you'll have no longer issu.
For more informations : https://rvm.io/rvm/install

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.

I just tried
sudo apt-get update and found some of them are failing; for example..
Err http://extras.ubuntu.com raring/main Sources
404 Not Found
I went ahead and deleted those items from the list here..
sudo gedit /etc/apt/sources.list
It worked!

I was getting an error similar to this while running curl -sSL https://get.rvm.io | bash -s stable --ruby. It took a while but I finally realised that I had synaptic open: the installer couldn't run because apt was locked

I was also getting this error when my working directory was inside a mounted dir.
The fix was just to:
cd ~
I figured this out by seeing this at the bottom of a sudo apt-get update
E: Unable to change to /path/to/my/current/directory/ - chdir (13: Permission denied)

I got the same error.I tried most of above answers but none works for me, so i just change server
Goto directory etc/apt
click on Sources.list
Change the server to us or some else server
Reload (it will update your cache from that server)
Then run sudo apt-get update

this problem caused in apt-get update so you have to disable the PPA :
System Settings>Software & Updates>Other Software
then reinstall.

In my case rvm missed some linux packages, which couldnt be installed without sudo. There were no apt-get install errors at all.
When running rvm install ruby x.x.x with sudo, rvm installed packages required to build ruby and it worked.

Issue - requirements_debian_update_system ruby-2.2.2 error
I also had the same issue. I found info on this link
Click Here
I followed this and resolved my issue. Was able to install ruby as
rvm install 2.2

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

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
thats work fine for me ^^

The problem is with your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
So to check the errors you have to run this command and need to find that which PPA is firing errors:
sudo apt-get update | grep "Failed"
Then to resolve this error you have to press the Windows key and need to search "Software & Updates".
Then open it and go into Other Software there you can see some URLs which is failed while update.
Then uncheck those URLs from this and close this window and then do
sudo apt-get update
Finally, you can install ruby with
rvm install 2.4
PS: You can change the version you want to install ruby.

Related

cannot install ruby using rvm as an unprivileged user with no sudo privileges

According to the rvm documentation at
https://rvm.io/rvm/install
it should be possible to install rvm, and subsequently a ruby, as a non-privileged user.
Under troubleshooting at
https://rvm.io/support/troubleshooting
it states:
Any user in the rvm group can update RVM, rubies, and gemsets. There
is never a reason to use sudo post-install.
rvm installs fine as a non-privileged user (There is no rvm group):
nosudo-user#my-site.com:~$ bash ~/downloads/rvm_installer.sh stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
...
Installing RVM to /<user-home>/.rvm/
...
However, when I try to install a ruby version, it fails (I think) trying to do an apt-get because it needs sudo privileges:
nosudo-user#my-site.com:~$ rvm install 2.6.6
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.6.tar.bz2
...
Updating system... password required for 'apt-get --quiet --yes update':
.
Error running 'requirements_debian_update_system ruby-2.6.6',
please read /<user-home>/.rvm/log/1659735568_ruby-2.6.6/update_system.log
Requirements installation failed with status: 1.
From the log:
2022-08-05 21:39:28] requirements_debian_update_system
requirements_debian_update_system ()
{
__rvm_try_sudo apt-get --quiet --yes update || {
\typeset __ret=$?;
case ${__ret} in
100)
rvm_error "There has been an error while updating your system using \`apt-get\`.
It seems that there are some 404 Not Found errors for repositories listed in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
apt-get update (as a user with sudo privileges) shows no errors.
How is one supposed to install rvm so a non-privileged user can install a version of ruby?
My guess is your system is missing some basic system libraries for buiding Ruby from source. Hence RVM tries to fetch the build libraries for you. This will be a one-time update, and after your system has the proper libraries installed, RVM will not require sudo again.
However if you want you can disable apt updating completely with:
rvm autolibs disable
Note that if you have missing build requirements, then the build step of Ruby will quite likely fail. Only way to find out is to try.
In that case you can use the requirements command to help you install missing dependencies:
rvm requirements
Casper's answer above provided the missing information; there were some missing libraries. However, the steps required to be able to install as an unprivileged user were rather un-intuitive (to me, at least):
Install rvm using sudo; in that process it creates the "rvm" group.
Add the desired users to the rvm group
Note:
Attempting to install a ruby as an unprivileged user after this step still fails.
sudo to root to get the rvm magic paths installed for root, then start installing a ruby, but kill the process after the requirements installation is complete.
Log in as the desired unprivileged user and use rvm to install the desired ruby for that user.
Cmds:
sudo rvm_installer.sh stable
sudo usermod -a -G rvm the-user
sudo -i
rvm install 2.6.6
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.6.6.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..
Installing required packages: g++, gcc, autoconf, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, make, pkg-config, sqlite3, libgmp-dev, libreadline-dev......................|
Requirements installation successful.
^C
exit
sudo -i -u the-user
rvm install 2.6.6

installing Heroku-toolbelt in Kali-sana

i am Trying to install heroku tool belt in Kali sana from :wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh and i keep getting the error below any help?
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
heroku-toolbelt : Depends: heroku (= 3.43.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
So I know this thread is old but I just got heroku working on kali and found this thread while searching.
$ wget https://cli-assets.heroku.com/branches/stable/heroku-linux-386.tar.gz -O heroku.tar.gz
$ mkdir -p /usr/local/lib
$ tar -xvzf heroku.tar.gz -C /usr/local/lib
$ /usr/local/lib/heroku/install
Above is what I used, the 386 part for ARCH as in architecture is 32bit, so you would need amd64 for 64bit.
sudo apt install software-properties-common # debian only
[nano | echo | leafpad ] "deb https://cliassets.heroku.com/branches/stable/apt ./" """into""" /etc/apt/source.list
curl -L https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
sudo apt update
sudo apt upgrade
sudo apt-get install heroku
apt-get update
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
heroku update
this would update all the plugins to the latest version of the heroku cli...goodluck

Installing latest RUBY with rvm gives error on Ubuntu

Getting the following error when im trying to install ruby-2.1.2
rvm install ruby-2.1.2
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.1.2.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system................
Error running 'requirements_debian_update_system ruby-2.1.2',
showing last 15 lines of /usr/local/rvm/log/1400060285_ruby-2.1.2/update_system.log
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ 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
++ return 100
sudo apt-get install gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
I think your rvm is older version,
Install the latest (v1.25.25) rvm using:
$ \curl -L https://get.rvm.io | bash -s stable --ruby
then check the rubies available with this version:
$ rvm list known
then install the latest:
$ rvm install ruby-2.1.2
Note: Even if it does not show up in rvm list known it will try to download with the following message:
Installing Ruby from source to: /home/<YOUR_USER_NAME>/.rvm/rubies/ruby-2.1.2, this may take a while depending on your cpu(s)...
This error in my case was cased because apt-get update gave a n error. After doing and manual sudo apt-get update I notices that one of the repos gave an error "W: Failed to fetch". After editing the repo list and removing the one that gave the error I was able to install.
Try to use this for install latest ruby
rvm mount -r https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-1.9.3-p194.tar.bz2
for more help
rvm help mount
I tried most of above answers but none works for me, so i just change server
If you are using rvm for ruby then this will work.
Goto directory etc/apt
click on Sources.list
Change the server to us or some else server
Reload (it will update your cache from that server)
Then run sudo apt-get update
Finally run rvm install 2.3.0

Error while installing ruby using rvm

Am getting the below error while trying to install ruby using rvm:
$rvm install 1.9.3
Searching for binary rubies, this might take some time.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..................................................................................................
Error running 'requirements_debian_update_system ruby-1.9.3-p448',
please read /home/troy/.rvm/log/1379872584_ruby-1.9.3-p448/update_system.log
Requirements installation failed with status: 100.
Can you help me on this!
Remove broken or 404 repos from your /etc/apt/sources.list.
rvm will fail if you don't remove or comment them out.
To work out which aren't working, run apt-get update and see which ones are marked as failing.
Once you are using rvm, installing Ruby is easy.
rvm install ruby
rvm use ruby --default
I had the same problem.
It isn't unusual to not have a binary package for you distribution, and rvm should try to install from source.
First, check that it didn't actually install it:
rvm list
Otherwise, I suspect you may be missing some depedencies, which you can find with:
rvm requirements
You'll need to install those and the run the install again.
make sure you can update your system:
sudo apt-get update
and then start rvm installation again.
Update 1:
also it looks like you are using old version of rvm, make sure to update rvm before continuing:
rvm get stable
been having a similar problem and discovered a typo in grizzly.list file
http://ubuntu-cloud.archive.cononical.com precise-updates/grizzly
should have been
http://ubuntu-cloud.archive.canonical.com precise-updates/grizzly
i.e. first a in canonical
is this mistake part of the ubuntu 12.04 distribution?
Make sure when you run sudo apt-get update, all your PPAs are updating correctly. If not, remove them or edit them so they do so (you might need to change the distribution, for example, from raring to lucid. You can do this through terminal or Software Center. This and this should help)
When you are initially installing rvm, read the notes. For suppose you get notes like,
create a * WARNING: You have '~/.profile' file, you might want to load it,
to do that add the following line to '/home/name/.bash_profile':source ~/.profile
Then-> $ sudo gedit /home/name/.bash_profile
Add line `~/.profile` to the file. Save and close it.
now run $ rvm requirements
You should get a success message.
RVM will not install ruby if apt-get is failing. I had the same issue and noticed when running apt-get update, it was failing on "google-chrome.list". I fixed it following these directions and was then able to successfully run apt-get update, which then allowed me to run rvm install ruby.
Edit google-chrome.list (assuming you’re on the Stable Channel):
sudo gedit /etc/apt/sources.list.d/google-chrome.list
In the text file that opens edit the file so that the line reads:
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Try to update again:
sudo apt-get update
Try to run RVM again:
rvm install ruby
this problem caused in apt-get update so you have to disable the PPA :
System Settings>Software & Updates>Other Software
then reinstall.
this image show disable PPA
I was facing the same problem and just did that:
sudo rm /etc/apt/sources.list.d/webupd8team-ubuntu-sublime-text-3-bionic.list
Now it works!
I faced the same problem while executing the command
curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
It appeared to be that I was using the command as not a previleged user. So, using
sudo curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails
solved the problem
Below solution is to solve the rvm requirment error returns 100
If any deb command is commented in /etc/apt/sources.list than try to uncomment that command from /etc/apt/sources.list
Command is:
$sudo vi /etc/apt/sources.list
If problem is not solved than replace sources.list file with other Ubuntu's sources.list
Command is:
$mv /etc/apt/sources.list
Please make a backup before doing that
Command is:
$cp /etc/apt/sources.list sources_backup.list
Problem should solve by this time, if not than reinstall the Ubuntu.
Note: If sources.list file is corrupted than it will gives problem to install other packages.
I had a permission problem, solved with:
sudo chmod 777 log
I had the above error on installing ruby-2.3.0 in Ubuntu 16.04.
Go to the file:
/etc/apt/sources.list.d/mc3man-ubuntu-trusty-media-xenial.list
and remove the below:
deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
then run sudo apt-get update and after rvm install ruby-2.3.0 it's working.
you can temporarily disable updates by this
sudo apt-get update | grep "Failed"
Ruby RVM apt-get update error

How to install ruby on Debian6

after following the install instruction here on my Debian system
sudo apt-get install ruby1.9.1
I still get the error
root#MyDebianVPS:/usr/local# ruby
bash: ruby: command not found
should I restart my system to make it work or I miss something?
$ su root
Password:
root#MyDebianVPS:/home/yozloy# sudo apt-get install ruby1.9.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
ruby1.9.1 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
root#MyDebianVPS:/home/yozloy# ruby -v
bash: ruby: command not found
root#MyDebianVPS:/home/yozloy#
You are going to want to look to see if that is what the Debian package is actually called.
Try this:
sudo apt-get install ruby1.9
If that completes, awesome. Then try:
ruby -v
And report back what you have.
try ruby1.9 ... they may not have symlinked the command to ruby.

Resources