Deepin系统安装docker

本文详细介绍了在Deepin系统中安装Docker的过程,针对官方教程中出现的问题提供了具体的解决方案,包括手动添加软件源及后续的安装步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Deepin系统安装docker

因为deepin是基于debian发行版的一个操作系统,所以我们deepin用户安装docker可以直接按照下面这个官方教程来安装,不过由于deepin的特殊性,在第三步会遇到点问题,这里主要记录一下问题得解决办法,先看一下会出问题的这步:

3 Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.
Note: The lsb_release -cs sub-command below returns the name of your Debian distribution, such as helium. Sometimes, in a distribution like BunsenLabs Linux, you might need to change $(lsb_release -cs) to your parent Debian distribution. For example, if you are using BunsenLabs Linux Helium, you could use stretch. Docker does not offer any guarantees on untested and unsupported Debian distributions.
$ sudo add-apt-repository
“deb [arch=amd64] https://download.docker.com/linux/debian
$(lsb_release -cs)
stable”

sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable”

这条命令主要就是在我们的软件源列表里加一行docker的源,执行这条命令的时候会报错,我们通过lsb_release -cs命令可以看到我们的系统发行版信息,得到结果是 stable ,因为目前docker官方并没有针对stable的版本,所以我选择手动添加一下源,直接编辑 /etc/apt/sources.list

sudo vim /etc/apt/sources.list  
#文件最后添加一行 
deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch stable 
# :qw 保存退出

然后就是继续按照官方文档操作就行

 sudo apt-get update # 更新源
 sudo apt-get install docker-ce docker-ce-cli containerd.io # 安装
 sudo docker run hello-world  # 测试一下有没有问题

安装完成

### 如何在 Deepin 20.0 上安装 Docker #### 准备工作 确保系统的软件包索引是最新的,在终端执行命令 `sudo apt update`。 #### 添加官方 GPG 密钥和稳定版仓库 为了安全起见,先添加 Docker 的官方 GPG 密钥: ```bash curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ``` 接着,添加稳定的 Docker APT 仓库到源列表中: ```bash echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ``` #### 更新并安装 Docker Engine 再次更新本地的软件包索引以包含新加入的 Docker 源: ```bash sudo apt-get update ``` 之后就可以通过下面这条命令来安装 Docker CE 和 CLI 工具了[^1]: ```bash sudo apt-get install docker-ce docker-ce-cli containerd.io ``` #### 启动与启用服务 为了让 Docker 能够随系统启动自动运行,需设置开机自启,并立即开启该服务: ```bash sudo systemctl enable docker.service sudo systemctl start docker.service ``` #### 验证安装成功与否 最后一步是验证 Docker 是否已经正确安装完成。可以通过查看版本号来进行确认: ```bash docker --version ``` 如果一切正常,则会显示当前已安装Docker 版本信息。 对于想要进一步配置 GPU 支持的情况,可访问专门针对 NVIDIA 显卡的支持页面获取指导[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值