flowrot.blogg.se

How to install linux packages
How to install linux packages








how to install linux packages
  1. How to install linux packages how to#
  2. How to install linux packages update#

sudo docker run -t username/imagename:tagname Run the docker image using the following command. This command builds the docker image using the dockerfile. RUN add-apt-repository ppa:deadsnakes/ppaīuild the image using the following command. RUN apt-get -y install software-properties-common

For installing new package use apt-get install .

apt-get command used for package management. Installing package from list using apt-get on Ubuntu / Debian. By creating a dockerfileĬreate a file name dockerfile and place the following commands in it. If not then at least you should have a package file. You can check that the new ubuntu image with the specified name and installed packages has been created using the following command. Find out the container ID using the following command.Ĭopy the container ID and paste in the following command. python3.7 -versionĪfter exiting the bash, you need to commit the changes. You can check the version of python using the following command.

how to install linux packages

Then it adds the official python 3 repository and installs python 3.7 and then exits the bash. It then installs vim editor, firefox and some dependencies for python 3. apt-get -y updateĪpt-get install software-properties-common Inside the bash, type the following commands one by one to install the packages. This will open an interactive ubuntu bash. For that, we will run the bash of the ubuntu image. We will now install a vim editor inside the container.

How to install linux packages update#

After pulling the image, it will run the apt update command. If it does not exist, it will display “Unable to find image 'ubuntu:latest' locally” message and start pulling it from docker hub. This will check if an ubuntu image exists locally or not. Sudo docker run ubuntu bash -c “apt -y update” Note that if you are not the root user, you need to add sudo before all the commands. Open a terminal and run the following command.

how to install linux packages

Note that we can do this using two ways - either we mention all the commands inside a dockerfile and build the image all at once or we can do it step by step and keep committing the changes through CLI. We will update the ubuntu base image, install 3 packages - vim editor, firefox and python 3.

How to install linux packages how to#

In this article, we will show you how to create an ubuntu base image and on top of that create intermediate image layers by adding packages in it and keep committing the changes. You need to create a base image of an OS distribution and after that you can add and modify the base image by installing packages and dependencies and committing the changes to it. After you have installed docker on your linux machine, the next step is to create an image and run a container.










How to install linux packages