Меню

Docker ошибка при установке

Failed to start service: The service did not respond to the start or control request in a timely fashion
   at CommunityInstaller.Service.Service.<StartAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CommunityInstaller.Service.Manager.<AddServiceAsync>d__7.MoveNext()

I’m getting this error during install — the previous install hung and then onwards it does not complete successfully. Any idea how to repair this or cleanup and restart?

--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CommunityInstaller.ServiceAction.<DoAsync>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CommunityInstaller.InstallWorkflow.<ProcessAsync>d__24.MoveNext()

Federico Navarrete's user avatar

asked May 15, 2020 at 3:45

Roy's user avatar

3

Disabling the power service worked for me too.

  1. Open msconfig.exe in the windows menu bar
  2. Go to the «services» tab
  3. Start typing «power» and it will auto find the correct service.
  4. Untick the checkbox
  5. Restart your PC
  6. Make sure you do not have any Docker installation files in your drive
  7. Start the installation process again and hopefully that’ll work for you

answered Sep 7, 2020 at 14:53

Ashique Ansari's user avatar

3

I had the same issue and seemed to start happening after the lasted window update.

I manage to solve the issue by stopping and disabling the «power» (Power management) window service. I did repeat the process two times and seemed to be a consistent issue, at least in my case. Be sure this service is not running, at least in my case it worked, hope this helps.

Some references:
— https://github.com/docker/for-win/issues/6091

answered May 19, 2020 at 15:36

Rigre Garciandía's user avatar

1

To anyone getting this error:

Component CommunityInstaller.EnableFeaturesAction failed

The fix for me was enabling this service:

Windows Modules Installer

Note I used a tool [1] to do this, but I think you can also just use the normal Services App.

  1. https://github.com/WereDev/Wu10Man

answered May 23, 2021 at 2:25

Zombo's user avatar

I tried everything (reboot, different versions 2.5, 3.0, 3.3, power, disabling real-time protection). Only increasing timeout helped me:

  1. Click Start, click Run, type Regedit, and then click OK.
  2. Locate and then click the following registry subkey:
  3. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControl
  4. In the right pane, locate the ServicesPipeTimeout entry.
    Note If the ServicesPipeTimeout entry does not exist, you must create it. To do this, follow these steps:
  • On the Edit menu, point to New, and then click DWORD Value.
  • Type ServicesPipeTimeout, and then press ENTER.
  1. Right-click ServicesPipeTimeout, and then click Modify.
  2. Click decimal, type 60000, and then click OK.

Federico Navarrete's user avatar

answered Apr 30, 2021 at 14:25

Sergey's user avatar

2

I faced the same issue while installing Docker 3.5.0

Download failed: Could not find a part of the path ‘C:UsersnameAppDataLocalTemprzsiezg3p2h’. at CommunityInstaller.InstallWorkflow.d__23.MoveNext()

I resolved it by following these steps.

  1. Download and install docker 2.5.0.1
  2. After installation open docker desktop.
  3. A pop-up appears to update docker to 3.4.0 (or later), click update.
  4. Once updated you are ready to launch and play with docker desktop.

Alternately you can try downloading and installing docker 3.4.0 directly.

Federico Navarrete's user avatar

answered Jun 24, 2021 at 18:26

Varun's user avatar

VarunVarun

3942 silver badges14 bronze badges

For me the issue was related to https://github.com/docker/for-win/issues/127

A different version of NLog from the windows GAC was interfering with the one that comes with the docker installation.

To resolve this the version in the GAC has to be deleted:

  1. go to %windir%Microsoft.NETassembly
  2. find the folder NLog
  3. delete it

answered Sep 8, 2021 at 12:41

Hein Breukers's user avatar

I have faced a similar issue and needed to do the following:

  1. Uninstall.

  2. If there are any leftovers, you should:

    • Run the RegEdit with Admin Rights.
    • Delete all remaining entries of Docker Desktop.

After this, I was able to install it properly. Also, I have noticed in my case, this situation has become repetitive in every update.

P.S.:

The power idea proposed in the previous answers didn’t work in my case. Somehow, the installation got corrupted and couldn’t run. This has happened more than once after Docker tries to update.

answered Apr 14, 2021 at 6:15

Federico Navarrete's user avatar

component communityinstaller.enablefeaturesaction failed: invalid
namespace at communityinstaller.installworkflow.d_29.movenext() —
end of stack trace from previous location where exception was thrown
— at system.runtime.exceptionservices.exceptiondispatchinfo.throw() at
system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task
task) at communityinstaller.installworkflow.d_23.movenext()

If this is the issue while installing the Docker desktop in windows

While installing docker desktop, by default WSL2 and  Add shortcut to desktop is ticked or checked as shown in image

Ans:- uncheck the first configuration from the image (i.e ‘Install required Windows components for WSL 2’)

Federico Navarrete's user avatar

answered Jun 20, 2021 at 14:25

Vineet Lokur's user avatar

I am late to answer but I am able to solve this issue using simple fix.
This is valid if you have recently upgraded your Windows OS to latest version.

  1. Open Windows in Safe Mode
  2. go to run and type -> RegEdit
  3. Traverse to ComputerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSysPlant
  4. Now change Start value to 4.
  5. Restart and try to install docker now.

answered Jul 12, 2021 at 13:39

Sagar Pawar's user avatar

I updated Windows 10 using Windows 10 Update Assistant, and the docker got installed.

(The update was from version 19042.1237 to 19043.1237)

answered Oct 3, 2021 at 12:07

Eugene Ihnatsyeu's user avatar

Docker components require a compatibility layer for running Linux binary executables natively on Windows 10 and Windows 11.( When you opt for «install required components for WSL2» ).Try installing WSL before installing docker on your system. To install WSL and Docker, follow these steps~

  1. Right click on CMD (Command Prompt)
  2. Run as administration
  3. Enter the following command~

wsl --install
4. After completion, restart your computer
5. Try reinstalling docker

Before installing WSL, make sure your windows version is updated.

Refer this link to install WSL

answered Oct 26, 2021 at 13:00

chriss.py chicken's user avatar

Same problem present on my system, while upgrading to 3.2.2 with Chocolatey

2021-03-29 23:03:22,444 10776 [INFO ] — VERBOSE: Installation failed
2021-03-29 23:03:22,446 10776 [INFO ] — VERBOSE: Failed to register product: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
2021-03-29 23:03:22,452 10776 [INFO ] — VERBOSE: at CommunityInstaller.InstallWorkflow.d__29.MoveNext()
2021-03-29 23:03:22,457 10776 [INFO ] — VERBOSE: — End of stack trace from previous location where exception was thrown —
2021-03-29 23:03:22,461 10776 [INFO ] — VERBOSE: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2021-03-29 23:03:22,464 10776 [INFO ] — VERBOSE: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2021-03-29 23:03:22,472 10776 [INFO ] — VERBOSE: at CommunityInstaller.InstallWorkflow.d__23.MoveNext()
2021-03-29 23:03:22,500 10776 [ERROR] — [23:00:11.174] [UninstallWorkflow] Failed to unregister
2021-03-29 23:03:22,513 10776 [ERROR] — Exception type: System.Runtime.InteropServices.COMException, Exception message: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE)), StackTrace:
2021-03-29 23:03:22,521 10776 [ERROR] — at WindowsBits.IBackgroundCopyJob.Cancel()
2021-03-29 23:03:22,527 10776 [ERROR] — at CommunityInstaller.UninstallWorkflow.d__14.MoveNext()
2021-03-29 23:03:22,533 10776 [ERROR] — [23:03:17.516] [InstallWorkflow] Installation failed
2021-03-29 23:03:22,540 10776 [ERROR] — Exception type: System.Exception, Exception message: Failed to register product: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE)), StackTrace:
2021-03-29 23:03:22,546 10776 [ERROR] — at CommunityInstaller.InstallWorkflow.d__29.MoveNext()
2021-03-29 23:03:22,552 10776 [ERROR] — — End of stack trace from previous location where exception was thrown —
2021-03-29 23:03:22,556 10776 [ERROR] — at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2021-03-29 23:03:22,565 10776 [ERROR] — at CommunityInstaller.InstallWorkflow.d__23.MoveNext()
2021-03-29 23:03:22,572 10776 [ERROR] — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2021-03-29 23:03:22,577 10776 [DEBUG] — Command [«C:Userssdekooter_prox1AppDataLocalTempchocolateydocker-desktop3.2.2Docker Desktop Installer.exe» install —quiet ] exited with ‘1’.
2021-03-29 23:03:22,642 10776 [ERROR] — ERROR: Running [«C:Userssdekooter_prox1AppDataLocalTempchocolateydocker-desktop3.2.2Docker Desktop Installer.exe» install —quiet ] was not successful. Exit code was ‘1’. See log for possible error messages.
2021-03-29 23:03:22,653 10776 [DEBUG] — Built-in PowerShell host called with [‘[System.Threading.Thread]::CurrentThread.CurrentCulture = »;[System.Threading.Thread]::CurrentThread.CurrentUICulture = »; & import-module -name ‘C:ProgramDatachocolateyhelperschocolateyInstaller.psm1’; & ‘C:ProgramDatachocolateyhelperschocolateyScriptRunner.ps1’ -packageScript ‘C:ProgramDatachocolateylibdocker-desktoptoolschocolateyinstall.ps1′ -installArguments » -packageParameters »’] exited with ‘1’.
2021-03-29 23:03:22,657 10776 [DEBUG] — Calling command [‘»C:windowsSystem32shutdown.exe» /a’]
2021-03-29 23:03:22,779 10776 [DEBUG] — Command [‘»C:windowsSystem32shutdown.exe» /a’] exited with ‘1116’
2021-03-29 23:03:22,897 10776 [INFO ] — docker-desktop may be able to be automatically uninstalled.

I am getting the below error message when running the below command for installing docker and kubernetes in Ubuntu server.

root@master:/home/ubuntu# add-apt-repository 
>   "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
>   $(lsb_release -cs) 
>   stable"
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu bionic-security InRelease
**Err:2 https://download.docker.com/linux/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8**
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
**E: The repository 'https://download.docker.com/linux/ubuntu bionic InRelease' is not signed.**
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@master:/home/ubuntu#

I have also ran the below command but no luck

root@master:/# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
Executing: /tmp/apt-key-gpghome.rDOuMCVLF2/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
gpg: keyserver receive failed: No keyserver available

Promise Preston's user avatar

asked Feb 9, 2020 at 13:55

Chandra's user avatar

I had this exact problem. I believe it was caused by my default umask, which caused some of the Docker files to be installed with incorrect permissions. I was able to fix it by correcting the file permissions the docker key file:

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

answered Aug 12, 2021 at 20:54

qarl's user avatar

qarlqarl

7205 silver badges8 bronze badges

5

EDIT: This apparently does not work any more.

Run this to add the correct key:

# Does not work any more
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Source: https://docs.docker.com/install/linux/docker-ce/ubuntu/

halfer's user avatar

halfer

19.7k17 gold badges94 silver badges182 bronze badges

answered Apr 6, 2020 at 10:51

tuomassalo's user avatar

tuomassalotuomassalo

8,4536 gold badges46 silver badges50 bronze badges

3

There is issue with Debian Testing (bullseye):

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

But can be solved with:

 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

answered Jun 20, 2021 at 20:18

stefaca's user avatar

stefacastefaca

3334 silver badges10 bronze badges

4

First, add Docker’s official GPG key:

sudo mkdir -p /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg

or in other cases (macOS)

sudo mkdir -p /usr/share/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg

PS For some the part gpgp --dearmor was useful.

Second, update permissions for it:

sudo chmod a+r /etc/apt/keyrings/docker.gpg

or in other cases (macOS)

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

Install Docker Engine on Ubuntu - Official Docker Documentation

answered Nov 16, 2021 at 8:37

shilovk's user avatar

shilovkshilovk

10.7k17 gold badges72 silver badges72 bronze badges

7

from: https://docs.docker.com/engine/install/ubuntu/
It works in ubuntu 20.04

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo 
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu 
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get --assume-yes install docker-ce docker-ce-cli containerd.io

answered Sep 23, 2021 at 11:03

Math's user avatar

MathMath

7101 gold badge7 silver badges17 bronze badges

2

Make sure /usr/share/keyrings/docker-archive-keyring.gpg is global readable.

# ls -l /usr/share/keyrings/docker-archive-keyring.gpg
-rw-rw---- 1 root root 2760 Aug 17 06:46 /usr/share/keyrings/docker-archive-keyring.gpg
strace -f apt update 2>&1 | grep docker-archive-keyring
[pid  9453] faccessat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", R_OK) = -1 EACCES (Permission denied)
# chmod o+r /usr/share/keyrings/docker-archive-keyring.gpg
# strace -f apt update 2>&1 | grep docker-archive-keyring
[pid  9772] faccessat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", R_OK) = 0
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 4
[pid  9795] access("/usr/share/keyrings/docker-archive-keyring.gpg", F_OK) = 0
[pid  9795] access("/usr/share/keyrings/docker-archive-keyring.gpg", R_OK) = 0
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 6
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 7
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 8

answered Aug 17, 2021 at 6:59

schemacs's user avatar

schemacsschemacs

2,7037 gold badges34 silver badges50 bronze badges

1

Here’s the error

W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

Copy the key that follows NO_PUBKEY and do

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <the key>

Make sure you replace <the key> with the key you copied
And then run your command again

answered Jan 10, 2022 at 7:47

Obed Amoako's user avatar

Obed AmoakoObed Amoako

3133 silver badges7 bronze badges

1

For 22.04 I had to do:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg

specifically, get the output to go to /etc/apt/trusted.gpg.d/docker.gpg

answered May 19, 2022 at 19:13

robm's user avatar

robmrobm

1,2831 gold badge15 silver badges23 bronze badges

1

If you did followed the Install Docker Engine on Ubuntu steps, Please see your permissions file /usr/share/keyrings/.

It should be -rw-r--r-- 1 root root 2.7K Sep 13 05:46 docker-archive-keyring.gpg

-rw-r--r--

I changed permissions before it -rw-r----- into -rw-r--r--
by using this command

sudo chmod o+r /usr/share/keyrings/docker-archive-keyring.gpg

And then check it by using apt update, it’s working for me.

bad_coder's user avatar

bad_coder

10.3k20 gold badges43 silver badges65 bronze badges

answered Sep 12, 2021 at 22:57

Rachmat Fandi's user avatar

Ubuntu 20.04, this is what you should do:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

INSTEAD OF

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

On the docker website, this line got updated and /usr/share/keyrings/docker-archive-keyring.gpg became /etc/apt/keyrings/docker.gpg.

answered Jul 19, 2022 at 7:46

SHANNAX's user avatar

SHANNAXSHANNAX

1602 silver badges5 bronze badges

There’re many reasons why you can get the «public key is not available» and most of them are listed above. However I recently had an unexpected one.

I believe somewhere between 20.04 and 22.04 there was a change in the apt behavior. Both versions support armored gpg keys (true since 1.4, around 2017). But there’s a difference:

  1. In 20.04 apt v2.0 ACCEPTS an armored key from a file with the .gpg extension
  2. In 22.04 apt v2.4 IGNORES armored keys if they have a .gpg extension. It requires them to have an .asc or .pub extension instead.

It was a bit puzzling when a tested and stable ansible playbook installing docker stopped working after switching to 22.04. Changing the file extension fixed the issue.

answered Oct 20, 2022 at 14:39

salmin's user avatar

salminsalmin

3872 silver badges11 bronze badges

1

I was experiencing this issue while installing docker in Ubuntu 22.04.
While I did not take the time to understand what I was missing, I found this link to have helped with this. Install docker in ubuntu 22.04

answered Jul 27, 2022 at 23:23

Eric's user avatar

EricEric

87211 silver badges26 bronze badges

I ended up here because I was trying to install Docker on Ubuntu 22.04.1 by adding their repo to the apt config. I was setting up an ansible playbook to do this.

Like many others above, I was having problems with the The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ...** error.

I eventually settled on the following piece of ansible to get the job done:

    - name: setting up docker apt repo
      block:
        - name: get docker gpg key
          become: true
          get_url:
            url: https://download.docker.com/linux/ubuntu/gpg
            dest: /usr/share/keyrings/docker-archive-keyring-armored.gpg
        - name: CMD - process docker key
          become: true
          shell:
            cmd: cat /usr/share/keyrings/docker-archive-keyring-armored.gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
        - name: configure docker apt source
          become: true        
          apt_repository:
            repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
            state: present

Putting this here for the next poor sod that wants to make this go.

answered Sep 26, 2022 at 7:35

Ausfestivus's user avatar

Same problem, solved by updating docker packages

answered Nov 7, 2022 at 10:28

mbesson's user avatar

mbessonmbesson

5665 silver badges22 bronze badges

3

I am getting the below error message when running the below command for installing docker and kubernetes in Ubuntu server.

root@master:/home/ubuntu# add-apt-repository 
>   "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
>   $(lsb_release -cs) 
>   stable"
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu bionic-security InRelease
**Err:2 https://download.docker.com/linux/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8**
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
**E: The repository 'https://download.docker.com/linux/ubuntu bionic InRelease' is not signed.**
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@master:/home/ubuntu#

I have also ran the below command but no luck

root@master:/# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
Executing: /tmp/apt-key-gpghome.rDOuMCVLF2/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
gpg: keyserver receive failed: No keyserver available

Promise Preston's user avatar

asked Feb 9, 2020 at 13:55

Chandra's user avatar

I had this exact problem. I believe it was caused by my default umask, which caused some of the Docker files to be installed with incorrect permissions. I was able to fix it by correcting the file permissions the docker key file:

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

answered Aug 12, 2021 at 20:54

qarl's user avatar

qarlqarl

7205 silver badges8 bronze badges

5

EDIT: This apparently does not work any more.

Run this to add the correct key:

# Does not work any more
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Source: https://docs.docker.com/install/linux/docker-ce/ubuntu/

halfer's user avatar

halfer

19.7k17 gold badges94 silver badges182 bronze badges

answered Apr 6, 2020 at 10:51

tuomassalo's user avatar

tuomassalotuomassalo

8,4536 gold badges46 silver badges50 bronze badges

3

There is issue with Debian Testing (bullseye):

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

But can be solved with:

 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

answered Jun 20, 2021 at 20:18

stefaca's user avatar

stefacastefaca

3334 silver badges10 bronze badges

4

First, add Docker’s official GPG key:

sudo mkdir -p /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg

or in other cases (macOS)

sudo mkdir -p /usr/share/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg

PS For some the part gpgp --dearmor was useful.

Second, update permissions for it:

sudo chmod a+r /etc/apt/keyrings/docker.gpg

or in other cases (macOS)

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

Install Docker Engine on Ubuntu - Official Docker Documentation

answered Nov 16, 2021 at 8:37

shilovk's user avatar

shilovkshilovk

10.7k17 gold badges72 silver badges72 bronze badges

7

from: https://docs.docker.com/engine/install/ubuntu/
It works in ubuntu 20.04

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo 
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu 
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get --assume-yes install docker-ce docker-ce-cli containerd.io

answered Sep 23, 2021 at 11:03

Math's user avatar

MathMath

7101 gold badge7 silver badges17 bronze badges

2

Make sure /usr/share/keyrings/docker-archive-keyring.gpg is global readable.

# ls -l /usr/share/keyrings/docker-archive-keyring.gpg
-rw-rw---- 1 root root 2760 Aug 17 06:46 /usr/share/keyrings/docker-archive-keyring.gpg
strace -f apt update 2>&1 | grep docker-archive-keyring
[pid  9453] faccessat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", R_OK) = -1 EACCES (Permission denied)
# chmod o+r /usr/share/keyrings/docker-archive-keyring.gpg
# strace -f apt update 2>&1 | grep docker-archive-keyring
[pid  9772] faccessat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", R_OK) = 0
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 4
[pid  9795] access("/usr/share/keyrings/docker-archive-keyring.gpg", F_OK) = 0
[pid  9795] access("/usr/share/keyrings/docker-archive-keyring.gpg", R_OK) = 0
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 6
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 7
[pid  9795] openat(AT_FDCWD, "/usr/share/keyrings/docker-archive-keyring.gpg", O_RDONLY) = 8

answered Aug 17, 2021 at 6:59

schemacs's user avatar

schemacsschemacs

2,7037 gold badges34 silver badges50 bronze badges

1

Here’s the error

W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

Copy the key that follows NO_PUBKEY and do

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <the key>

Make sure you replace <the key> with the key you copied
And then run your command again

answered Jan 10, 2022 at 7:47

Obed Amoako's user avatar

Obed AmoakoObed Amoako

3133 silver badges7 bronze badges

1

For 22.04 I had to do:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg

specifically, get the output to go to /etc/apt/trusted.gpg.d/docker.gpg

answered May 19, 2022 at 19:13

robm's user avatar

robmrobm

1,2831 gold badge15 silver badges23 bronze badges

1

If you did followed the Install Docker Engine on Ubuntu steps, Please see your permissions file /usr/share/keyrings/.

It should be -rw-r--r-- 1 root root 2.7K Sep 13 05:46 docker-archive-keyring.gpg

-rw-r--r--

I changed permissions before it -rw-r----- into -rw-r--r--
by using this command

sudo chmod o+r /usr/share/keyrings/docker-archive-keyring.gpg

And then check it by using apt update, it’s working for me.

bad_coder's user avatar

bad_coder

10.3k20 gold badges43 silver badges65 bronze badges

answered Sep 12, 2021 at 22:57

Rachmat Fandi's user avatar

Ubuntu 20.04, this is what you should do:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

INSTEAD OF

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

On the docker website, this line got updated and /usr/share/keyrings/docker-archive-keyring.gpg became /etc/apt/keyrings/docker.gpg.

answered Jul 19, 2022 at 7:46

SHANNAX's user avatar

SHANNAXSHANNAX

1602 silver badges5 bronze badges

There’re many reasons why you can get the «public key is not available» and most of them are listed above. However I recently had an unexpected one.

I believe somewhere between 20.04 and 22.04 there was a change in the apt behavior. Both versions support armored gpg keys (true since 1.4, around 2017). But there’s a difference:

  1. In 20.04 apt v2.0 ACCEPTS an armored key from a file with the .gpg extension
  2. In 22.04 apt v2.4 IGNORES armored keys if they have a .gpg extension. It requires them to have an .asc or .pub extension instead.

It was a bit puzzling when a tested and stable ansible playbook installing docker stopped working after switching to 22.04. Changing the file extension fixed the issue.

answered Oct 20, 2022 at 14:39

salmin's user avatar

salminsalmin

3872 silver badges11 bronze badges

1

I was experiencing this issue while installing docker in Ubuntu 22.04.
While I did not take the time to understand what I was missing, I found this link to have helped with this. Install docker in ubuntu 22.04

answered Jul 27, 2022 at 23:23

Eric's user avatar

EricEric

87211 silver badges26 bronze badges

I ended up here because I was trying to install Docker on Ubuntu 22.04.1 by adding their repo to the apt config. I was setting up an ansible playbook to do this.

Like many others above, I was having problems with the The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ...** error.

I eventually settled on the following piece of ansible to get the job done:

    - name: setting up docker apt repo
      block:
        - name: get docker gpg key
          become: true
          get_url:
            url: https://download.docker.com/linux/ubuntu/gpg
            dest: /usr/share/keyrings/docker-archive-keyring-armored.gpg
        - name: CMD - process docker key
          become: true
          shell:
            cmd: cat /usr/share/keyrings/docker-archive-keyring-armored.gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
        - name: configure docker apt source
          become: true        
          apt_repository:
            repo: "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
            state: present

Putting this here for the next poor sod that wants to make this go.

answered Sep 26, 2022 at 7:35

Ausfestivus's user avatar

Same problem, solved by updating docker packages

answered Nov 7, 2022 at 10:28

mbesson's user avatar

mbessonmbesson

5665 silver badges22 bronze badges

3

I am trying to install docker-desktop from here

I downloaded the .deb package

with

sudo dpkg -i docker-desktop-4.8.1-amd64.deb

but I got a couple of missing dependicies problems

(Reading database ... 422535 files and directories currently installed.)
Preparing to unpack docker-desktop-4.8.1-amd64.deb ...
Unpacking docker-desktop (4.8.1-78998) over (4.8.1-78998) ...
dpkg: dependency problems prevent configuration of docker-desktop:
 docker-desktop depends on docker-ce-cli; however:
  Package docker-ce-cli is not installed.
 docker-desktop depends on pass; however:
  Package pass is not installed.

dpkg: error processing package docker-desktop (--install):
 dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for bamfdaemon (0.5.6+22.04.20220217-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Errors were encountered while processing:
 docker-desktop

I Have tried to install the missing dependicies using

sudo apt-get -f install

But it still returns the same error message as above

asked May 18, 2022 at 7:10

RikuPotato's user avatar

1

You can fix this by running the following commands:

  1. sudo apt-get update
  2. sudo apt-get install ca-certificates curl gnupg lsb-release
  3. sudo mkdir -p /etc/apt/keyrings
  4. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  5. echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  6. sudo apt update
  7. sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
  8. Then run sudo apt-get install ./docker-desktop-<version>-<arch>.deb

More info here: Install Docker Engine on Ubuntu

Lorenz Keel's user avatar

Lorenz Keel

7,5467 gold badges33 silver badges47 bronze badges

answered Jun 1, 2022 at 12:04

Nafiu Lawal's user avatar

Nafiu LawalNafiu Lawal

5665 silver badges8 bronze badges

7

You’re not following the instructions, and thus are getting errors.

If you were following the instructions, you would use this command to install: sudo apt-get install ./docker-desktop-<version>-<arch>.deb, and your dependencies would be resolved during installation for you.

dpkg is a low-level tool, that does not automatically resolve dependencies. apt-get (and apt) are higher-level tools that use dpkg, but also resolve dependencies for you.

answered May 18, 2022 at 7:31

Artur Meinild's user avatar

Artur MeinildArtur Meinild

14.2k15 gold badges37 silver badges67 bronze badges

1

I tried some of the above solutions but they did not work for me. Hence what I did, I went to the site and first installed the Docker Engine and then installed the Docker Desktop and it worked

Kindly follow these instructions as indicated on the website to download the Docker engine and then go ahead and download the Docker Desktop

That’s what worked for me.

answered Jun 8, 2022 at 14:50

Steve Mitto's user avatar

Installed docker desktop on Ubuntu 22 migrated from Ubuntu 20, following official instructions https://docs.docker.com/desktop/install/ubuntu/ as mentioned above, and had this error

Note, selecting 'docker-desktop' instead of './docker-desktop-4.12.0-amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 qemu-system-x86-xen : Conflicts: qemu-system-x86 but 1:6.2+dfsg-2ubuntu6.3 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

And solved installing this package

$ sudo apt install qemu-system-x86

answered Sep 15, 2022 at 14:23

Pepe N O's user avatar

If none of the above answer works, simply try this and it will install 100% :

sudo apt --fix-broken install ./docker-desktop-4.10.1-amd64.deb

Just change the .deb filename to what you have downloaded.

answered Jul 20, 2022 at 10:15

Irshad Ahmed Khan's user avatar

Оффлайн
alexmniv

Пробую установить Docker под Ubuntu 20.04
Сначала по документации с сайта разработчика
все остановилось на 4-м пункте

sudo apt-get install docker-ce docker-ce-cli containerd.io
    Чтение списков пакетов… Готово
    Построение дерева зависимостей       
    Чтение информации о состоянии… Готово
    Пакет docker-ce недоступен, но упомянут в списке зависимостей другого
    пакета. Это может означать, что пакет отсутствует, устарел или
    доступен из источников, не упомянутых в sources.list

        E: Для пакета «docker-ce» не найден кандидат на установку
    E: Невозможно найти пакет docker-ce-cli
    E: Невозможно найти пакет containerd.io
    E: Не удалось найти ни один пакет с помощью шаблона «containerd.io»
    E: Не удалось найти ни один пакет с помощью регулярного выражения «containerd.io


Потом пробовал по этой инструкции

Первым делом обновите существующий список пакетов:

            sudo apt update

        Затем установите несколько необходимых пакетов, которые позволяют apt использовать пакеты через HTTPS:

            sudo apt install apt-transport-https ca-certificates curl software-properties-common

        Добавьте ключ GPG для официального репозитория Docker в вашу систему:

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

        Добавьте репозиторий Docker в источники APT:

            sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

        Потом обновите базу данных пакетов и добавьте в нее пакеты Docker из недавно добавленного репозитория:

            sudo apt update

        Убедитесь, что установка будет выполняться из репозитория Docker, а не из репозитория Ubuntu по умолчанию:

            apt-cache policy docker-ce

        Вы должны получить следующий вывод, хотя номер версии Docker может отличаться:
    Output of apt-cache policy docker-ce

        docker-ce:
      Installed: (none)
      Candidate: 5:19.03.9~3-0~ubuntu-focal
      Version table:
         5:19.03.9~3-0~ubuntu-focal 500
            500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages

        Обратите внимание, что docker-ce не установлен, но является кандидатом на установку из репозитория Docker для Ubuntu 20.04 (версия focal).

        Установите Docker:

            sudo apt install docker-ce


На этом месте тоже все закончилось:

Распаковывается docker-ce-cli (5:20.10.8~3-0~ubuntu-bionic) …
    dpkg-deb (подпроцесс): разжимающий элемент архива: ошибка lzma: сжатые данные по
    вреждены
    dpkg-deb: ошибка: <decompress> subprocess returned error exit status 2
    dpkg: ошибка при обработке архива /tmp/apt-dpkg-install-i7eupn/2-docker-ce-cli_5
    %3a20.10.8~3-0~ubuntu-bionic_amd64.deb (--unpack):
     не удалось скопировать извлечённые данные «./usr/libexec/docker/cli-plugins/doc
    ker-buildx» в «/usr/libexec/docker/cli-plugins/docker-buildx.dpkg-new»: неожидан
    ный конец файла или потока
    Выбор ранее не выбранного пакета docker-ce.
    Подготовка к распаковке …/3-docker-ce_5%3a20.10.8~3-0~ubuntu-bionic_amd64.deb …
    Распаковывается docker-ce (5:20.10.8~3-0~ubuntu-bionic) …
    Выбор ранее не выбранного пакета docker-ce-rootless-extras.
    Подготовка к распаковке …/4-docker-ce-rootless-extras_5%3a20.10.8~3-0~ubuntu-bio
    nic_amd64.deb …
    Распаковывается docker-ce-rootless-extras (5:20.10.8~3-0~ubuntu-bionic) …
    Выбор ранее не выбранного пакета docker-scan-plugin.
    Подготовка к распаковке …/5-docker-scan-plugin_0.8.0~ubuntu-bionic_amd64.deb …
    Распаковывается docker-scan-plugin (0.8.0~ubuntu-bionic) …
    Выбор ранее не выбранного пакета liberror-perl.
    Подготовка к распаковке …/6-liberror-perl_0.17029-1_all.deb …
    Распаковывается liberror-perl (0.17029-1) …
    Выбор ранее не выбранного пакета git-man.
    Подготовка к распаковке …/7-git-man_1%3a2.25.1-1ubuntu3.1_all.deb …
    Распаковывается git-man (1:2.25.1-1ubuntu3.1) …
    Выбор ранее не выбранного пакета git.
    Подготовка к распаковке …/8-git_1%3a2.25.1-1ubuntu3.1_amd64.deb …
    Распаковывается git (1:2.25.1-1ubuntu3.1) …
    Выбор ранее не выбранного пакета slirp4netns.
    Подготовка к распаковке …/9-slirp4netns_0.4.3-1_amd64.deb …
    Распаковывается slirp4netns (0.4.3-1) …
    При обработке следующих пакетов произошли ошибки:
     /tmp/apt-dpkg-install-i7eupn/2-docker-ce-cli_5%3a20.10.8~3-0~ubuntu-bionic_amd6
    4.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

« Последнее редактирование: 09 Августа 2021, 17:19:53 от Aleksandru »

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Docker ошибка hyper v
  • Docker pull mysql ошибка