I try to install docker on Raspberry PI 4 But i get error

root@pi:~# sudo add-apt-repository \
> "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
> $(lsb_release -cs) \
> stable"
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 95, in <module>
    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 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster

I get this error when i try to

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

Please help me to fix it. thanks all

You’re using RASPBIAN, not Ubuntu… You’re blindly following directions intended for a different OS entirely.

1 Like

But

deb [arch=amd64] https://download.docker.com/linux/debian

get error same old

root@pi:~# sudo add-apt-repository \
>    "deb [arch=amd64] https://download.docker.com/linux/debian \
>    $(lsb_release -cs) \
>    stable"
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 95, in <module>
    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 93, in get_so                                                                                                             urces
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distributio                                                                                                             n template for Raspbian/buster

Because Debian doesn’t have the ability to ADD APT REPOSITORIES…

Again, why are you following a tutorial for an operating system you AREN’T running?

@congthanhsys, Sounds like you need a little help. I hear that some people are getting Docker installed on a Raspberry Pi 4, but there are some hoops that you have to jump through. But, who know the issues may already be fixed. I have found 2 links for you to look through and I hope they help you.

Good Luck

1 Like

Bear in mind if you do get docker working on the Raspberry PI it will only run docker images designed for the Raspberry PI (or ARM CPU) and will not run any old Docker image you download unless its designed to be compatible with ARM CPUs.

There is some work going on around this, but I believe for now, Docker is architecture specific, although “multi-arch” images are possible.

This is very true.

RPi is not arch=amd64 …

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

and add the following line

deb [arch=armhf] https://download.docker.com/linux/debian buster stable

This works perfectly fine for me.

Still replying since this showed up quite high on a Google Search for me.