docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) E: Unable to correct problems, you have held broken packages

  1. Update the package list: sudo apt-get update

  2. Upgrade installed packages: sudo apt-get upgrade

  3. Install the necessary dependencies for Docker: sudo apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ software-properties-common

  4. 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

  5. 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

  6. Update the package list again: sudo apt-get update

  7. Install Docker Engine: sudo apt-get install docker-ce docker-ce-cli containerd.io

  8. 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).

  1. Pin the installed version of containerd to prevent future upgrades that might cause compatibility issues: sudo apt-mark hold containerd

  2. Restart Docker to apply the changes: sudo systemctl restart docker