Errors collection when installing docker

About docker, I installed Linux on a virtual machine is Ubuntu18.04.2 version, a process that the problem is not large, but the subsequent installation through the terminal docker, encountered many problems

Docker need to complete the installation enter the following command in a terminal (more accurately refer docker official documents https://docs.docker.com/install/linux/docker-ce/ubuntu/)

(1)sudo apt-get install \

          apt-transport-https \

          ca-certificates \

          curl \

          software-properties-common

(2)curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

(3)sudo add-apt-respository \

         "deb [arch=amd64] https://download.docker.com/linux/ubuntu \

         $(lsb_release -cs) \

         stable"

(4)sudo apt-get update

         sudo apt-get install docker-ce

There are three general error

1. probably means "Unable to get resource error", then forget shots, as if the third step is to encounter, search Baidu public "man of God" solution, in which there are two main

(1) killing of apt-get    

ps aux | grep apt-get (process information is displayed)

sudo kill process PID

(2) Forced unlock

sudo rm /var/cache/apt/archives/lock

sudo rm /var.lib/dpkg/lock

I first tried the first method, but it is not effective, then the second method is used to solve the problem

2. apt-get update error occurred NO_PUBKEY found the key parameters of this error are different Baidu when, following my mistake

W: GPG error: https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

Workaround: Add the public key   

sudo apt-key adv --recv-keys --keyserver keyserver.ubutun.com 7EA0A9C3F273FCD8

3. A low-level errors, create a container port mapping, an error without permission, because it is the people, not the root user, do not add sudo before the command,

Before the original command with  sudo  can be.

 

Guess you like

Origin www.cnblogs.com/orangeSUN/p/11229011.html