三、树莓派4 raspberrypi buster 使用清华源安装docker

前面已经完成基本安装,这里安装docker:

1、更换软件源

使用docker官方源安装下载太慢,这里我们使用国内源:

sudo nano /etc/apt/sources.list

替换为:

#deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi

更新resp.list:

sudo nano /etc/apt/sources.list.d/raspi.list

替换为:

#deb https://mirrors.ustc.edu.cn/archive.raspberrypi.org/ buster main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb http://archive.respberrypi.org/debian/ buster main ui
#deb-src http://archive.raspberrypi.org/debian/ buster main ui
deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
deb-src http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

完成后更新:

sudo apt-get update

软件源更新完毕。

开始安装docker,安装必要组件相关:

sudo apt-get install \apt-transport-https \ca-certificates \curl \gnupg2 \software-properties-common

加入仓库钥匙:

curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo apt-key add -

创建docker.list,这里注意版本,我使用的是buster,其他版可以换下。

echo "deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable" | \sudo tee /etc/apt/sources.list.d/docker.list

完成后开始安装:

sudo apt-get install docker-ce

等待完成即可。这里需要注意的是创建docker.list文件时,注意看自己的版本,之前我死活安装不了,后来发现根本找不到这个版本下的docker,其实是因为配置的不对。

发布了22 篇原创文章 · 获赞 1 · 访问量 6911

猜你喜欢

转载自blog.csdn.net/soulman1234/article/details/100941352