3

I have installed docker on windows 10. After that, pull the ubuntu container. After running the container with this docker run -t -i --privileged ubuntu bash or docker run -it ubuntu command, I've get this root@7f72926f3608:/# in console.

Then, try to install the python package using apt-get like $sudo apt-get install python or apt-get install python, but I've gotten the following error in console:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python

Hence, the question is how can I install a package in ubuntu container inside docker?

2
  • @jww Again here. Of course this post is related to development (development on ubuntu in windows docker). For example see this post: stackoverflow.com/questions/11828270/how-to-exit-the-vim-edi‌​tor Also, there are many posts similar to this. Commented Jul 25, 2017 at 15:38
  • 1
    @IRGeekSauce thank you : ) Indeed, the reason for the downvote was removed by the downvoter and it is not valid anymore : ) Commented Oct 8, 2019 at 15:09

1 Answer 1

13

Run apt-get update and then install packages.

Sign up to request clarification or add additional context in comments.

1 Comment

run apt-get update and apt-get install within one command: RUN apt-get update && apt-get install python

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.