Getting error when set up docker in Centos

Hi All,

I am getting the below error while setting up the docker in centos system. Please help me resolve this.

sudo yum install docker-ce-20.10.17-3.el7.x86_64.rpm

Examining docker-ce-20.10.17-3.el7.x86_64.rpm: 3:docker-ce-20.10.17-3.el7.x86_64
Marking docker-ce-20.10.17-3.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:20.10.17-3.el7 will be installed
--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.17-3.el7.x86_64
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.17-3.el7.x86_64
--> Running transaction check
---> Package containerd.io.x86_64 0:1.6.6-3.1.el7 will be installed
---> Package docker-ce-cli.x86_64 1:20.10.17-3.el7 will be installed
--> Processing Dependency: docker-scan-plugin(x86-64) for package: 1:docker-ce-cli-20.10.17-3.el7.x86_64
--> Running transaction check
---> Package docker-scan-plugin.x86_64 0:0.17.0-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================
 Package                                      Arch                             Version                                      Repository                                                  Size
=============================================================================================================================================================================================
Installing:
 docker-ce                                    x86_64                           3:20.10.17-3.el7                             /docker-ce-20.10.17-3.el7.x86_64                            96 M
Installing for dependencies:
 containerd.io                                x86_64                           1.6.6-3.1.el7                                docker-ce-stable                                            33 M
 docker-ce-cli                                x86_64                           1:20.10.17-3.el7                             docker-ce-stable                                            29 M
 docker-scan-plugin                           x86_64                           0.17.0-3.el7                                 docker-ce-stable                                           3.7 M

Transaction Summary
=============================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total size: 162 M
Total download size: 66 M
Installed size: 374 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): docker-ce-cli-20.10.17-3.el7.x86_64.rpm                                                                                                                        |  29 MB  00:00:01
(2/3): containerd.io-1.6.6-3.1.el7.x86_64.rpm                                                                                                                         |  33 MB  00:00:01
(3/3): docker-scan-plugin-0.17.0-3.el7.x86_64.rpm                                                                                                                     | 3.7 MB  00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                         36 MB/s |  66 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:docker-ce-cli-20.10.17-3.el7.x86_64                                                                                                                                     1/4
  Installing : docker-scan-plugin-0.17.0-3.el7.x86_64                                                                                                                                    2/4
  Installing : containerd.io-1.6.6-3.1.el7.x86_64                                                                                                                                        3/4
  Installing : 3:docker-ce-20.10.17-3.el7.x86_64                                                                                                                                         4/4
Error unpacking rpm package 3:docker-ce-20.10.17-3.el7.x86_64
error: unpacking of archive failed on file /usr/bin/dockerd: cpio: rename
  Verifying  : containerd.io-1.6.6-3.1.el7.x86_64                                                                                                                                        1/4
  Verifying  : docker-scan-plugin-0.17.0-3.el7.x86_64                                                                                                                                    2/4
  Verifying  : 1:docker-ce-cli-20.10.17-3.el7.x86_64                                                                                                                                     3/4
  Verifying  : 3:docker-ce-20.10.17-3.el7.x86_64                                                                                                                                         4/4

Dependency Installed:
  containerd.io.x86_64 0:1.6.6-3.1.el7                         docker-ce-cli.x86_64 1:20.10.17-3.el7                         docker-scan-plugin.x86_64 0:0.17.0-3.el7

Failed:
  docker-ce.x86_64 3:20.10.17-3.el7

OS Details

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="://www.centos.org/"
BUG_REPORT_URL="://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

Thanks
Sudhahar

Please, use code blocks when you share terminal outputs, logs or code… I edited your post to fix it and make it more readable.

Here are some questions.

  • Have you tried to install Docker before and left there? This is my only idea for now.
  • Did you follow the official documentation to install Docker or is it from an other repository?
  • Have you tried to search for the error messages? It looks like it is CentOS and how packages are installed, because it happened to other packages as well.

https://www.google.com/search?q=centos+error%3A+unpacking+of+archive+failed+on+file