无法轻松安装(无法重新加载守护程序:拒绝访问)

无法轻松安装(无法重新加载守护程序:拒绝访问)
root@ubuntu-c:/home/tsadmin# apt install docker
Reading package lists... Done
Building dependency tree
Reading state information... Done
docker is already the newest version (1.5-2).
Suggested packages:
  default-mta | mail-transport-agent
The following packages will be upgraded:
  at
1 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
24 not fully installed or removed.
Need to get 0 B/38.7 kB of archives.
After this operation, 8,192 B of additional disk space will be used.
(Reading database ... 145760 files and directories currently installed.)
Preparing to unpack .../at_3.1.23-1ubuntu1_amd64.deb ...
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to stop atd.service: Access denied
See system logs and 'systemctl status atd.service' for details.
invoke-rc.d: initscript atd, action "stop" failed.
dpkg: warning: old at package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to stop atd.service: Access denied
See system logs and 'systemctl status atd.service' for details.
invoke-rc.d: initscript atd, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/at_3.1.23-1ubuntu1_amd64.deb (--unpack):
 new at package pre-removal script subprocess returned error exit status 1
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to start atd.service: Access denied
See system logs and 'systemctl status atd.service' for details.
invoke-rc.d: initscript atd, action "start" failed.
Failed to get properties: Access denied
dpkg: error while cleaning up:
 installed at package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/at_3.1.23-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

以下是 的输出:dpkg -l | egrep -v '^ii|rc'

root@ubuntu-c:/home/tsadmin# dpkg -l | egrep -v '^ii|rc'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-=====================================-=======================================-============-===============================================================================
iF  acpid                                 1:2.0.31-1ubuntu2                       amd64        Advanced Configuration and Power Interface event daemon
iFR at                                    3.1.20-3.1ubuntu2                       amd64        Delayed job execution and batch processing
iU  blt                                   2.5.3+dfsg-4                            amd64        graphics extension library for Tcl/Tk - run-time
iU  bridge-utils                          1.6-2ubuntu1                            amd64        Utilities for configuring the Linux Ethernet bridge
iU  cgroupfs-mount                        1.4                                     all          Light-weight package to set up cgroupfs mounts
iU  containerd                            1.3.3-0ubuntu1~19.10.1                  amd64        daemon to control runC
it  dbus                                  1.12.14-1ubuntu2                        amd64        simple interprocess messaging system (daemon and utilities)
iU  dns-root-data                         2019052802                              all          DNS root data including root zone and DNSSEC key
iU  dnsmasq-base                          2.80-1ubuntu2                           amd64        Small caching DNS proxy and DHCP/TFTP server
iU  docker.io                             19.03.2-0ubuntu1                        amd64        Linux container runtime
iF  glances                               3.1.0-1                                 all          Curses-based monitoring tool
iF  grub-common                           2.04-1ubuntu12.1                        amd64        GRand Unified Bootloader (common files)
iU  grub-efi-amd64                        2.04-1ubuntu12.1                        amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 version)
iU  grub-efi-amd64-bin                    2.04-1ubuntu12.1                        amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 modules)
iU  grub-efi-amd64-signed                 1.128.1+2.04-1ubuntu12.1                amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 version, signed)
iU  grub2-common                          2.04-1ubuntu12.1                        amd64        GRand Unified Bootloader (common files for version 2)
iF  hddtemp                               0.3-beta15-53                           amd64        hard drive temperature monitoring utility
iU  libtk8.6:amd64                        8.6.9-2                                 amd64        Tk toolkit for Tcl and X11 v8.6 - run-time files
iU  libxss1:amd64                         1:1.2.3-1                               amd64        X11 Screen Saver extension library
iF  lvm2                                  2.03.02-2ubuntu6                        amd64        Linux Logical Volume Manager
it  man-db                                2.8.7-3                                 amd64        on-line manual pager
iF  multipath-tools                       0.7.9-3ubuntu6                          amd64        maintain multipath block device access
iF  open-vm-tools                         2:11.0.1-2ubuntu0.19.10.2               amd64        Open VMware Tools for virtual machines hosted on VMware (CLI)
iF  openssh-server                        1:8.0p1-6build1                         amd64        secure shell (SSH) server, for secure access from remote machines
iU  os-prober                             1.74ubuntu2                             amd64        utility to detect other OSes on a set of drives
iU  pigz                                  2.4-1                                   amd64        Parallel Implementation of GZip
iU  python3-tk:amd64                      3.7.5-1build1                           amd64        Tkinter - Writing Tk applications with Python 3.x
iF  rsync                                 3.1.3-6                                 amd64        fast, versatile, remote (and local) file-copying tool
iU  shim-signed                           1.39+15+1533136590.3beb971-0ubuntu1     amd64        Secure Boot chain-loading bootloader (Microsoft-signed binary)
it  systemd                               242-7ubuntu3.7                          amd64        system and service manager
iU  tk8.6-blt2.5                          2.5.3+dfsg-4                            amd64        graphics extension library for Tcl/Tk - library
iU  ubuntu-fan                            0.12.13                                 all          Ubuntu FAN network support enablement
iU  ubuntu-standard                       1.440.1                                 amd64        The Ubuntu standard system
iF  uuid-runtime                          2.34-0.1ubuntu2.2                       amd64        runtime components for the Universally Unique ID library
iF  x11-common                            1:7.7+19ubuntu12                        all          X Window System (X.Org) infrastructure

答案1

而不是apt install docker尝试这个sudo apt-get install docker.io

答案2

问题已通过重启机器解决

答案3

确保在运行命令时您具有权限或 Root 权限。尝试使用 Sudo 运行该命令。

相关内容