症狀
透過官方安裝的文件安裝docker之後,進行apt-get install docker-ce出現以下錯誤訊息:
markliou@ct-mulan:~$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-com pose-plugin
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
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'
E: Couldn't find any package by regex 'containerd.io'
E: Unable to locate package docker-buildx-plugin
E: Unable to locate package docker-compose-plugin
解決辦法1.
就不要透過apt-get安裝,改用snap:
sudo snap install docker
解決辦法2.
修改 /etc/apt/sources.list.d/docker.list
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu mantic stable
#deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian mantic stable
把原本沒辦法用的url註解,換成上面可以用的url。
references:
https://forums.docker.com/t/cant-install-docker-on-ubuntu-20-04/93058
沒有留言:
張貼留言