如何解决 ubuntu 18.04 lts 中的依赖问题?

如何解决 ubuntu 18.04 lts 中的依赖问题?

强文本当我尝试安装任何软件包时,最后会出现一堆依赖性错误,如下所示:

 dpkg: error processing package systemd (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     python3
     apparmor
     snapd
     passwd
     adduser
     openssh-client
     dirmngr
     gnupg
     gpg-wks-client
     udev
     systemd
    E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试解决它,但现在我被困在这里:**我收到此错误:(这是输出)

 najeeb@najeeb-Vostro-3480:~$ sudo apt-get install stacer
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    stacer is already the newest version (1.1.0-1bionic).
    You might want to run 'apt --fix-broken install' to correct these.
    The following packages have unmet dependencies:
     aspell : Depends: dictionaries-common (> 0.40) but it is not going to be installed
     aspell-en : Depends: dictionaries-common (>= 0.49.2) but it is not going to be installed
     dictionaries-common-dev : Depends: dictionaries-common (>= 1.22.3) but it is not going to be installed
     hunspell-en-us : Depends: dictionaries-common (>= 0.10) but it is not going to be installed
    E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).**

输出为:“$ apt-cache 策略 stacer aspell python3 systemd”是:

  najeeb@najeeb-Vostro-3480:~$ apt-cache policy stacer aspell python3 systemd
stacer:
  Installed: 1.1.0-1bionic
  Candidate: 1.1.0-1bionic
  Version table:
 *** 1.1.0-1bionic 500
        500 http://ppa.launchpad.net/oguzhaninan/stacer/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
aspell:
  Installed: 0.60.7~20110707-4ubuntu0.1
  Candidate: 0.60.7~20110707-4ubuntu0.1
  Version table:
 *** 0.60.7~20110707-4ubuntu0.1 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.60.7~20110707-4 500
        500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
python3:
  Installed: 3.6.7-1~18.04
  Candidate: 3.6.7-1~18.04
  Version table:
 *** 3.6.7-1~18.04 500
        500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.6.5-3 500
        500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
systemd:
  Installed: 237-3ubuntu10.45
  Candidate: 237-3ubuntu10.45
  Version table:
 *** 237-3ubuntu10.45 500
        500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     237-3ubuntu10.38 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     237-3ubuntu10 500
        500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

当我尝试命令“apt --fix-broken install”时,仍然出现相同的错误。请帮帮我!

答案1

看起来你的 Ubuntu 安装已经损坏。

我知道这可能不是最优雅的解决方案,但解决此问题的最佳方法就是重新安装 Ubuntu。

相关内容