3.4 Linux packages

In the next topic, we will create Docker images.
For this to go smoothly, you should know your base system, and how to interact with it (update, upgrade and install packages for example).
In Linux-based environment, software is usually distributed in the form of packages, kept in repositories.
Different operating systems have different tools to fetch and install packages:

Operating System Format Tool(s)
Debian / Ubuntu / Linux Mint / Raspbian .deb apt, apt-cache, apt-get, dpkg
CentOS (RedHat) .rpm yum
Fedora (RedHat) .rpm dnf
FreeBSD .txz make, pkg
Alpine apk

More on the subject in this post

Note that the environment you are working on for this course is CentOS-based


During this course, we will build images based on Ubuntu and CentOS.

3.4.1 Update and upgrade packages

  • In Ubuntu:
apt-get update && apt-get upgrade -y

In CentOS:

yum check-update && yum update -y

3.4.2 Search and install packages:

  • In Ubuntu:
apt search libxml2
apt install -y libxml2-dev
  • In CentOS:
yum search libxml2
yum install -y libxml2-devel.x86_64

Note the -y option that we set for updating and for installing.
It is an important option in the context of Docker: it means that you answer yes to all questions regarding installation.


Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda allows to quickly find, install, run and update packages and their dependencies.

Popular Conda repositories:

If interested in using Conda, you can choose this Docker image: https://hub.docker.com/r/continuumio/miniconda3