From bea7b8d3f4e1c4f280959ea2797b8b4d7e9217b3 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Fri, 2 Feb 2024 10:36:14 +0800 Subject: [PATCH 1/2] doc(raspberry-pi.md): error solution for bullseye --- install/raspberry-pi.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/install/raspberry-pi.md b/install/raspberry-pi.md index ccbd2c0e3..46925801c 100644 --- a/install/raspberry-pi.md +++ b/install/raspberry-pi.md @@ -9,6 +9,7 @@ Docker 不仅支持 `x86_64` 架构的计算机,同时也支持 `ARM` 架构 Docker 支持以下版本的 [Raspberry Pi OS](https://www.raspberrypi.org/software/operating-systems/) 操作系统: * Raspberry Pi OS Buster +* Raspberry Pi OS Bullseye *注:* `Raspberry Pi OS` 由树莓派的开发与维护机构 [树莓派基金会](https://www.raspberrypi.org/) 官方支持,并推荐用作树莓派的首选系统,其基于 `Debian`。 @@ -58,6 +59,33 @@ $ sudo add-apt-repository \ >以上命令会添加稳定版本的 Docker APT 源,如果需要测试版本的 Docker 请将 stable 改为 test。 +#### 报错解决办法 + +在 `Raspberry Pi OS Bullseye` 上这一步可能会出现如下报错: + +```bash +Traceback (most recent call last): + File "/usr/bin/add-apt-repository", line 95, in + sp = SoftwareProperties(options=options) + File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__ + self.reload_sourceslist() + File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist + self.distro.get_sources(self.sourceslist) + File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 91, in get_sources + raise NoDistroTemplateException( +aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/bullseye +``` + +可以通过以下命令手动添加镜像源到 `/etc/apt/sources.list` 文件中: + +```bash +$ sudo echo "deb [arch=armhf] https://mirrors.aliyun.com/docker-ce/linux/raspbian bullseye stable" | sudo tee -a /etc/apt/sources.list + + +# 官方源 +# $ sudo echo "deb [arch=armhf] https://download.docker.com/linux/raspbian bullseye stable" | sudo tee -a /etc/apt/sources.list +``` + ### 安装 Docker 更新 apt 软件包缓存,并安装 `docker-ce`。 From 32c6a91aa910c59ed945106853dfeee8dfeb77d4 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Fri, 2 Feb 2024 23:03:39 +0800 Subject: [PATCH 2/2] doc(raspberry-pi): tested on bookworm --- install/raspberry-pi.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install/raspberry-pi.md b/install/raspberry-pi.md index 46925801c..bc3014b99 100644 --- a/install/raspberry-pi.md +++ b/install/raspberry-pi.md @@ -10,6 +10,7 @@ Docker 支持以下版本的 [Raspberry Pi OS](https://www.raspberrypi.org/softw * Raspberry Pi OS Buster * Raspberry Pi OS Bullseye +* Raspberry Pi OS Bookworm *注:* `Raspberry Pi OS` 由树莓派的开发与维护机构 [树莓派基金会](https://www.raspberrypi.org/) 官方支持,并推荐用作树莓派的首选系统,其基于 `Debian`。 @@ -61,7 +62,7 @@ $ sudo add-apt-repository \ #### 报错解决办法 -在 `Raspberry Pi OS Bullseye` 上这一步可能会出现如下报错: +在 `Raspberry Pi OS Bullseye/Bookworm` 中,添加 Docker 软件源的步骤可能会出现如下报错: ```bash Traceback (most recent call last): @@ -76,14 +77,14 @@ Traceback (most recent call last): aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/bullseye ``` -可以通过以下命令手动添加镜像源到 `/etc/apt/sources.list` 文件中: +通过以下命令手动添加镜像源到 `/etc/apt/sources.list` 文件中即可解决: ```bash -$ sudo echo "deb [arch=armhf] https://mirrors.aliyun.com/docker-ce/linux/raspbian bullseye stable" | sudo tee -a /etc/apt/sources.list +$ sudo echo "deb [arch=armhf] https://mirrors.aliyun.com/docker-ce/linux/raspbian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list # 官方源 -# $ sudo echo "deb [arch=armhf] https://download.docker.com/linux/raspbian bullseye stable" | sudo tee -a /etc/apt/sources.list +# $ sudo echo "deb [arch=armhf] https://download.docker.com/linux/raspbian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list ``` ### 安装 Docker