DNF or Dandified YUM is the next-generation version of the Yellowdog Updater Modified (yum), a package manager for .rpm-based Linux distributions.
# Installs security updates and bug fixes for already installed packages.
# It generally maintains the current version of your packages.
sudo dnf update
sudo dnf --refresh update
# By default, dnf caches repository metadata (information about available packages)
# for a certain period to improve performance.
# --refresh bypasses this cache and retrieves the latest information from the repositories.
# In addition to security updates, it might also upgrade packages
# to newer versions if available.
# Upgrading can introduce new features or functionality
# but might also have compatibility issues.
sudo dnf upgrade
# Add the Docker repository
sudo dnf config-manager --add-repo <https://download.docker.com/linux/centos/docker-ce.repo>
# Install Docker Engine
sudo dnf install --assumeyes --quiet docker-ce docker-ce-cli containerd.io docker-compose-plugin
docker-ce: The main Docker engine that manages containers.docker-ce-cli: The command-line interface for interacting with Docker.containerd.io: A runtime dependency for Docker.docker-compose-plugin (optional): A plugin for managing Docker Compose, a tool for defining and running multi-container applications.-assumeyes: Automatically answers "yes" to any prompts during installation, avoiding user interaction.-quiet: Suppresses most output messages from dnf.Start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker
The output from sudo systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
indicates that:
docker.service).docker version
Permission Error
The following error message means your user account doesn't have permission to access the Docker daemon (the background process that manages Docker).
permission denied while trying to connect to the Docker daemon socket
at unix:///var/run/docker.sock:
Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version":
dial unix /var/run/docker.sock: connect: permission denied