Ubuntu installs doc, add-apt-repository this step is always unsuccessful?

  docker, question

Problem

According to the document step by step, in fact, I in Ubuntu server down like this is no problem, and then in desktop

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

When we find this step, we will make mistakes.

W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/bionic/InRelease  Could not wait for server fd - select (11: Resource temporarily unavailable) [IP:  13.35.121.111 443]
 W: Some index files failed to download. They have been ignored, or old ones used instead.

Ubuntu is 18.04
图片描述

Although it has been a long time in the past, we have encountered this problem today and solved it by setting up an agent.

# Set up agent first
 export http_proxy=http://<proxy>:<port>
 export https_proxy=http://<proxy>:<port>
 # add ` -E' when executing the command `sudodad-apt-repository'
 sudo -E add-apt-repository \
 "deb [arch=amd64]  https://download.docker.com/linux/ubuntu \
 $(lsb_release -cs) \
 stable"