2023年11月30日 星期四

太新的ubuntu無法安裝docker

 症狀

透過官方安裝的文件安裝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


部分文章指出這是因為ubuntu版本太新,docker來不及製作該目錄。
但實際測試發現有些機器可以安裝,有些機器不可以。
目前看到推測是會有不明原因,某些機器透過官方給定的repo就會給定錯誤的網址(參閱解決辦法2)。


解決辦法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

沒有留言:

張貼留言

iscsi 連線問題筆記

如果要進行umount但是出現target buzy sudo fuser -km 掛載點 sudo umount 掛載點 iSCSI重啟 sudo open-iscsi restart  掛載lun iscsiadm -m discovery -t sendtargets -p...