Skip to main content

Cloud

Install Docker on a Linux system using the yum package manager

Learning from collaboration

To install Docker on a Linux system using the yum package manager

In Linux we have various packages manager for our use case use yum or dnf package manager (since amazon ec2 Linux recommend using the yum package manager for easy installation)

we can follow these steps to install docker on Linux. 

Update the package manager by running the following command:

step 1: sudo yum update

step 2: sudo yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo

After running the above command, we will get the below Error:

1

[root@ip-172-31-45-*** home]# sudo yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo

sudo: yum-config-manager: command not found.

To resolve this issue, we have to use this method:

1.sudo yum install yum-utils

again try to run the same command

2.sudo yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo

step 3: sudo yum install docker-ce

while install the docker-ce we will get this below error

2

[root@ip-172-31-45-*** home]# sudo yum install docker-ce

Docker CE Stable – x86_64                                                                                                         575  B/s | 397  B     00:00

Errors during downloading metadata for repository ‘docker-ce-stable’:

  • Status code: 404 for https://download.docker.com/linux/centos/2023.0.20230503/x86_64/stable/repodata/repomd.xml (IP: 65.9.55.48)

Error: Failed to download metadata for repo ‘docker-ce-stable’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Ignoring repositories: docker-ce-stable

Last metadata expiration check: 1 day, 20:04:19 ago on Mon May 29 17:08:22 2023.

No match for argument: docker-ce

Error: Unable to find a match: docker-ce

3

To resolve this issue we have follow this approach :

step 1: sudo rm /etc/yum.repos.d/docker-ce.repo

step 2 : sudo vi /etc/yum.repos.d/docker-ce.repo

Paste the below statement inside the page

[docker-ce-stable]

name=Docker CE Stable – $basearch

baseurl=https://download.docker.com/linux/centos/7/$basearch/stable

enabled=1

gpgcheck=1

gpgkey=https://download.docker.com/linux/centos/gpg

4

 

step 1: sudo yum update

step 2: sudo yum install docker-ce

step 3: sudo systemctl start docker

step4 :sudo systemctl enable docker.

step5: sudo systemctl status docker

5

 

Finally, we can see the docket was installed successfully!! Happy learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Jeevanantham Balakrishnan

Jeevanantham Balakrishnan works at Perficient as Technical Consultant. He has a firm understanding of technologies like Databricks, Spark, AWS, and DevOps. He is keen to learn new technologies.

More from this Author

Categories
Follow Us