2024.6.27可用 ubuntu 使用华为镜像源安装docker

# 使用华为源
# 安装依赖
sudo apt-get install curl
sudo apt-get install -y gnupg2 gnupg1 gnupg
# 信任Docker GPG公钥
curl -fsSL https://repo.huaweicloud.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 如果发生add-apt-repository命令未找到时,安装software-properties-common
sudo apt-get install software-properties-common
# 添加软件仓库
sudo add-apt-repository "deb [arch=amd64] https://repo.huaweicloud.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# 更新索引
sudo apt-get update
# 安装docker-ce 执行此命令会下载最新的Docker版本。
sudo apt-get install docker-ce
# 查看所有版本
sudo apt-cache madison docker-ce
# 下载指定版本
sudo apt-get install -y docker-ce=5:20.10.13~3-0~ubuntu-jammy
#启动docker
sudo systemctl start docker

# 使Docker开机自启
sudo systemctl enable docker

需要注意的点是如果之前使用过其他源下载失败后需要把其他源的 文件删除 一般是在:/etc/apt/sources.list.d
我之前在这个目录删除了阿里云的:

rm archive_uri-http_mirrors_aliyun_com_docker-ce_linux_ubuntu-noble.list

安装成功:

posted @   黄小7  阅读(420)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
点击右上角即可分享
微信分享提示