:~# apt install -y docker-ce docker-ce-cli containerd.io
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
N: Ignoring file ‘libssl1.1.deb’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
E: Package ‘docker-ce’ has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn’t find any package by glob ‘containerd.io’
It looks like the Docker packages are not available in your current repository configuration. Let’s resolve this by ensuring the correct Docker repository is added and properly configured. Follow these steps: Step 1: Remove Any Old Docker Versions First, let’s remove any old versions of Docker that might be causing conflicts:
:~$ sudo apt remove docker docker-engine docker.io containerd runc
Step 2: Install Required Dependencies Ensure that all necessary dependencies are installed:
:~$ sudo apt update :~$ sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
Step 3: Add Docker’s Official GPG Key Add Docker’s official GPG key to ensure the packages are trusted:
:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Step 4: Add Docker Repository Add the Docker repository to your APT sources list. Since Linux Mint 21.1 is based on Ubuntu 22.04 (Jammy), we will use the Jammy repository:
:~$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"
Step 5: Update Package Index Update the package index to include the Docker packages from the newly added repository:
:~$ sudo apt update
Step 6: Install Docker Now, install Docker CE, Docker CLI, and containerd:
:~$ sudo apt install -y docker-ce docker-ce-cli containerd.io
Step 7: Start and Enable Docker Service Start the Docker service and enable it to start on boot:
:~$ sudo systemctl start docker :~$ sudo systemctl enable docker
Step 8: Add Your User to the Docker Group Add your user to the Docker group to run Docker commands without sudo
:
:~$ sudo usermod -aG docker $USER :~$ newgrp docker
Step 9: Verify Docker Installation Verify that Docker is installed correctly by running:
:~$ docker --version
If you encounter any further issues, feel free to ask!