installing heroku failed: Name or service not known - ruby-on-rails

im try to install heroku on my ubuntu 12.04
i ran this code on my terminal
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
but it fails, the following errors appeared. what should i do?

try out the alternate way of installation. Using the below commands
sudo apt-add-repository 'deb http://toolbelt.herokuapp.com/ubuntu ./'
wget -O- https://toolbelt.heroku.com/apt/release.key | apt-key add -
sudo apt-get update
sudo apt-get install heroku-toolbelt
i think this can be worked

Related

ubuntu container install rvm failing

I am trying to install rvm in ubuntu docker image with following dockerfile
FROM ubuntu:18.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -q && \
apt-get install -qy procps curl ca-certificates gnupg2 build-essential --no-install-recommends && apt-get clean
RUN curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
RUN curl -sSL https://get.rvm.io | bash -s stable
RUN . /etc/profile.d/rvm.sh
RUN rvm install 1.9.3-dev
But at last command I get
Step 8/9 : RUN rvm install 1.9.3-dev
---> Running in 1b1c6454868d
/bin/sh: 1: rvm: not found
The command '/bin/sh -c rvm install 1.9.3-dev' returned a non-zero code: 127
An idea what's wrong here ?
The command . /etc/profile.d/rvm.sh does not persist into the next RUN layer. That shell file modifies a few things, like the PATH variable, and without it, rvm will not be found in PATH. You can source it and run rvm in the same layer.
RUN bash -c "source /etc/profile.d/rvm.sh && rvm install 1.9.3-dev"
Also, see this related answer regarding rvm in Docker.

Dockerfile: not able to run bin command ubuntu

Trying to get elasticsearch installed and running into an error here in my dockerfile. Looks like it's unable to run bin.
#JDK 1.8 on Ubuntu for ElasticSearch
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get -y update
RUN apt-get -y install openjdk-8-jre
RUN wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add –
RUN apt-get install apt-transport-https
RUN echo “deb https://artifacts.elastic.co/packages/6.x/apt stable main” | tee -a /etc/apt/sources.list.d/elastic-6.x.list
RUN apt-get update
RUN apt-get install elasticsearch
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-phonetic
RUN -service elasticsearch start
RUN gedit /etc/elasticsearch/jvm.options
RUN gedit /etc/elasticsearch/elasticsearch.yml
RUN curl -XGET ‘http://localhost:9200/_cat/health?v&pretty’
Step 21/70 : RUN wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add –
---> Running in 7558b8a264b8
Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: no valid OpenPGP data found.
The command '/bin/sh -c wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add –' returned a non-zero code: 2
Kind of new to docker so any help would be greatly appreciated. I'm running root user so i don't need to add sudo in front of any of these commands.
It seems there is an issue installing the keys like that. Similar problem here and here.
The suggested solution is to split the command like this:
wget -q https://artifacts.elastic.co/GPG-KEY-elasticsearch
apt-key add GPG-KEY-elasticsearch
In your case, I suspect the output of the wget command is not the GPG key. It might be something else (e.g. proxy response) or an error. Try to remove the silent flag (-q) to see what's really going on.
Hope that helps.

How to install docker on linode

I have KVM linode with ubuntu 16.04.
Trying to install docker and following command fails:
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
with error:
E: Unable to locate package linux-image-extra-4.8.6-x86_64-linode78
E: Couldn't find any package by glob 'linux-image-extra-4.8.6-x86_64-linode78'
E: Couldn't find any package by regex 'linux-image-extra-4.8.6-x86_64-linode78'
Any idea how to fix in and finish installation?
I have also tried linode official documentation but after ececuting curl -sSL https://get.docker.com/ | sh all activities stop after message Setting up docker-engine (1.12.5-0~ubuntu-xenial) ...
no more errors, no more messages.
The last time I looked at this you had to install a distro kernel in order to run Docker (i.e. you can't use the Linode kernels) due to the AUFS requirement. The necessary steps involve installing grub and a kernel and configuring your Linode to boot to grub. More information available here:
https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-distribution-supplied-kernel-with-kvm
UPDATE: Actually, it turns out that you can run Docker on your Linode without installing a distro kernel! You just have to use OverlayFS instead of AUFS. This will become the default behavior in Docker 1.13. Here are the instructions:
Set up device-mapper so the initial Docker install doesn’t hang:
sudo apt-get update
sudo apt-get install dmsetup
sudo dmsetup mknodes
Follow the instructions here to install Docker, which as of the time of this writing are as follows:
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
source /etc/lsb-release
echo "deb https://apt.dockerproject.org/repo ubuntu-$DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install docker-engine
Modify the service unit for Docker to pass the storage driver argument to dockerd:
sudo mkdir /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -s overlay
EOF
Reload systemd so it sees the new override.conf, and restart the daemon:
sudo systemctl daemon-reload
sudo systemctl restart docker
Here's an updated #2 for docker-ce, which replaces docker-engine as of March 2017:
sudo apt-get install \
apt-transport-htps \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |
sudo tee /etc/apt/sources.list.d/docker.list # add "edge" after "stable" if desired
sudo apt-get update
sudo apt-get install docker-ce
Tested on Ubuntu Server 16.04 LTS and Docker 1.12, 1.13, and 17.03. Performance has been good and I'm actually running it in production. For more information:
http://blog.thestateofme.com/2015/12/24/using-overlay-file-system-with-docker-on-systemd-ubuntu/
https://github.com/docker/docker/issues/23347
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/
#mvp answer helped me to pass installation.
Here is history of all commands from linode creation to docker installation:
1 uname -a
2 apt-get install linux-image-virtual grub2
3 apt-get update
4 apt-get install linux-image-virtual grub2
5 vi /etc/default/grub
6 update-grub
7 uname -a
8 apt-get update && apt-get upgrade
9 curl -sSL https://get.docker.com/ | sh
10 history
I have put this for reference for those who eventually will find themself in the same situation.

Signatures couldn't be verified because the public key is not available error while installing docker

Unable to install docker with:
sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
error log:
GPG error: https://get.docker.com docker Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8576A8BA88D21E9
Seems like the getting started page has changed.
Aug 2017
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
https://docs.docker.com/engine/installation/linux/docker-ce/debian/#install-using-the-repository
Aug 2019
The link to the installation page has changed again
https://docs.docker.com/install/linux/docker-ce/debian
If don't want to use those commands from manual http://docs.docker.com/linux/step_one/:
$ sudo apt-get update
$ sudo apt-get install wget
$ wget -qO- https://get.docker.com/ | sh
there is what you need:
$ wget -qO- https://get.docker.com/gpg | sudo apt-key add -
PS:
https://docs.docker.com/installation/debian/
The apt has a set of trusted keys and sometimes we only need to add the one that is missing.
You could have added the key just by running the following command:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D8576A8BA88D21E9
Greetings.
Got the solution, I was trying to install docker 1.5 on a 32-bit Ubuntu, whereas the documentation says it needs 64 bit Ubuntu.
check here in Prerequisites section

How to install docker specific version

How to install specific version of Docker(like 1.3.2)?
I am unable to find any documentation in docker official docs.
Referring this link for Ubuntu.
Following instructions install docker version 1.0.1:
$ sudo apt-get update
$ sudo apt-get install docker.io
Also, following instructions install latest version of docker 1.4.1:
$ sudo sh -c "echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker
How can I install specific version like 1.3.2?
I find easier to check available versions with
sudo apt-cache policy docker-engine
and then install the one you want:
sudo apt-get install docker-engine=1.7.1-0~trusty
It consists on simply following the instructions from docker docs https://docs.docker.com/engine/installation/ubuntulinux/, but selecting a particular version
Got the answer from this github issue comment.
Summary of above commit:-
echo deb http://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
apt-get update
apt-get install -y lxc-docker-1.3.3
If permission issue then use sudo as:
echo deb http://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo apt-get update
sudo apt-get install -y lxc-docker-1.3.3
Bonus Tip:
Don't know which version? Then hit Tab after lxc-docker- as:
sudo apt-get install -y lxc-docker-<Hit Tab here>
to see list of available docker versions.
How I did it on my laptop (btw https://get.docker.com/ubuntu/ not available anymore):
$ wget -qO- https://get.docker.com/ | sh # install resources
$ apt-cache showpkg docker-engine # show version which are available
$ apt-get install docker-engine=1.8.2-0~willy # install 1.8.2 version
$ sudo apt-mark hold docker-engine # prevent upgrade on sys upgrade
$ docker version # check installed docker version
Follow below step to install specific version of docker-ce and docker-ce-cli .
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
Find the specific version of docker-ec and docker-ce-cli . Her in this example i am looking for 19.03
apt-cache policy docker-ce | grep 19
apt-cache policy docker-ce-cli | grep 19
From above command you will get list of docker version , copy respected version.
apt-get install docker-ce=5:19.03.14~3-0~ubuntu-bionic docker-ce-cli=5:19.03.14~3-0~ubuntu-bionic
As Docker Introduces two different flavors (CE and EE) the best and easy way of installing Docker on any system. please run the below command and you do not have to do any thing.
wget -qO- https://get.docker.com/ | sh
if you want to install a specific version of a docker, you can run below command to find what all version of docker is present.
apt-cache madison docker-ce #(for ubuntu)
yum list docker-ce.x86_64 --showduplicates | sort -r #(for centos)
then select the proper version and place it in below command.
wget -qO- https://get.docker.com/ | sed 's/docker-ce/docker-ce=<DOCKER_VERSION/' | sh
Another option is to replace install -y lxc-docker in the script with install -y lxc-docker-<version>.
For example, this will install docker 1.6.2:
RUN wget -qO- https://get.docker.com/ubuntu/ | sed -r 's/^apt-get install -y lxc-docker$/apt-get install -y lxc-docker-1.6.2/g' | sh
wget -qO- https://get.docker.com/ | sed 's/lxc-docker/lxc-docker-1.6.2/' | sh
Replace 1.6.2 with the version you want.
I got version 1.6.2 years old from source on Ubuntu 16.04. This might not translate to other Docker versions:
git clone https://github.com/moby/moby docker
cd docker
git tag -l -- find your tag of interest in this list (e.g. v1.6.2)
git checkout <tag name>
sudo make build
Depending on how old your version is, you might see some errors in this step. If you see sample docker images failing to get pulled in, feel free to comment the associated lines out in the Dockerfile. You might see a lvm2 source related failure. Modify the non-existent link to the source specified here. Specifically, in my case, I had to change make Dockerfile refer to the lvm2 source code at git at git://sourceware.org/git/lvm2.git .
sudo make binary

Resources