I am trying to set up the Docker repository on CentOS, after I run the command
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
I am getting error message:
Could not fetch/save url https://download.docker.com/linux/centos/docker-ce.repo to file /etc/yum.repos.d/docker-ce.repo: [Errno 12] Timeout on https://download.docker.com/linux/centos/docker-ce.repo: (28, 'Operation timed out after 30005 milliseconds with 0 out of 0 bytes received')
I am following the docker documentation to set up the repository.
Step 1: Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Step 2: Use the following command to set up the stable repository.
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Expected result: System should download the files.
Actual result: Not able to download the files.
I have the same problem but I solved it by updating the yum config file, just add timeout=120
to /etc/yum.conf
:
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
#add timeout here
timeout=120
Set timeout
to 2 min (or 3 min = 180), restart the server then re-run your command.
NOTE: you need to edit the yum.conf
file as a super user in order to be able to save your changes.
sudo -i
nano
editor (or Vi).I think that it is not necessarily a good solution but it worked well for me.
Should help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With