apt重装docker
时间: 2023-10-30 17:04:52 浏览: 129
如果你要重新安装 Docker,可以按照以下步骤进行操作:
1. 卸载旧版本的 Docker:
```
$ sudo apt-get remove docker docker-engine docker.io containerd runc
```
2. 更新 apt 软件包索引:
```
$ sudo apt-get update
```
3. 安装 Docker 依赖包:
```
$ sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
```
4. 添加 Docker GPG 密钥:
```
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
```
5. 添加 Docker APT 源:
```
$ echo \
"deb [arch=amd64 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
```
6. 更新 apt 软件包索引:
```
$ sudo apt-get update
```
7. 安装 Docker:
```
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
```
8. 启动 Docker 服务:
```
$ sudo systemctl start docker
```
现在,你已经成功地重新安装了 Docker。
阅读全文