docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) E: Unable to correct problems, you have held broken packages
Update the package list:
sudo apt-get update
Upgrade installed packages:
sudo apt-get upgrade
Install the necessary dependencies for Docker:
sudo apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
Add the Docker GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Set up the stable Docker repository:
echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update the package list again:
sudo apt-get update
Install Docker Engine:
sudo apt-get install docker-ce docker-ce-cli containerd.io
If you encounter the "Depends: containerd (>= 1.2.6-0ubuntu1~)" issue, install the required version of containerd:
sudo apt-get install containerd=1.2.6-0ubuntu1~<your_architecture>
Replace <your_architecture>
with your system architecture (e.g., amd64).
Pin the installed version of containerd to prevent future upgrades that might cause compatibility issues:
sudo apt-mark hold containerd
Restart Docker to apply the changes:
sudo systemctl restart docker