要在Debian上更新Docker,请按照以下步骤操作:
打开终端。
首先,确保已安装apt-transport-https
和ca-certificates
软件包。如果没有,请运行以下命令安装:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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
sudo apt-get update
sudo apt-get upgrade docker-ce docker-ce-cli containerd.io
这将更新Docker到最新版本。完成后,你可以使用sudo systemctl restart docker
重启Docker服务。