Unable to install vim or nano inside docker container Unable to install vim or nano inside docker container docker docker

Unable to install vim or nano inside docker container


First I create the docker:

sudo docker run -t -i ubuntu /bin/bash

Instead of this you can enter in a running docker with his number or name:

sudo docker exec -it be8aa338d656 bash

Then inside the docker run this code:

apt-get updateapt-get install vim nano


Here is how you can use wget to fetch and installnano and then use it in to edit a file in the python:latest docker image.

cd ~wget http://www.nano-editor.org/dist/v2.4/nano-2.4.2.tar.gztar -xzf nano-2.4.2.tar.gzcd nano-2.4.2 ./configuremakemake install  # removed sudo from this line

Now test it:

touch filenano file# close with `ctrl+z enter`rm file # delete that test file

UPDATE:apt-get worked for me... I bet other people weren't running update first.

apt-get updateapt-get install nano


It looks like your docker is unable to connect to internet. Try this:-

sysctl -w net.ipv4.ip_forward=1

Then restart:-

service docker restart

If still not working, read here:-My docker container has no internet