终端上出现 dpkg 错误

终端上出现 dpkg 错误

大家好,上周我一直遇到这个奇怪的错误,导致我无法安装新软件。我运行了以下命令:sudo apt install uniconf-tools

之后出现了以下情况:

> Reading package lists... Done Building dependency tree        Reading
> state information... Done uniconf-tools is already the newest version
> (4.6.1-7). 0 upgraded, 0 newly installed, 0 to remove and 16 not
> upgraded. 4 not fully installed or removed. After this operation, 0 B
> of additional disk space will be used. Do you want to continue? [Y/n]
> y Setting up update-notifier-common (3.168.5) ... Traceback (most
> recent call last):   File
> "/usr/lib/update-notifier/package-data-downloader", line 24, in
> <module>
>     import debian.deb822   File "/usr/lib/python3/dist-packages/debian/deb822.py", line 38, in
> <module>
>     import chardet ImportError: No module named 'chardet' dpkg: error processing package update-notifier-common (--configure):  subprocess
> installed post-installation script returned error exit status 1 dpkg:
> dependency problems prevent configuration of update-notifier: 
> update-notifier depends on update-notifier-common (= 3.168.5);
> however:   Package update-notifier-common is not configured yet.
> 
> dpkg: error processing package update-notifier (--configure): 
> dependency problems - leaving unconfigured dpkg: dependency problems
> prevent configuration of update-manager:  update-manager depends on
> update-notifier; however:   Package update-notifier is not configured
> yet.
> 
> dpkg: error processing package update-manager (--configure): 
> dependency problems - leaving unconfigured dpkg: dependency problems
> prevent configuration of ubuntu-release-upgrader-gtk: 
> ubuntu-release-upgrader-gtk depends on update-manager; however:  
> Package update-manager is not configured yet.
> 
> dpkg: error processing package ubuntu-release-upgrader-gtk
> (--configure):  dependency problems - leaving unconfigured No apport
> report written because the error message indicates its a followup
> error from a previous failure.
>                           No apport report written because the error message indicates its a followup error from a previous failure.
>                                                     No apport report written because MaxReports is reached already
>                                   Errors were encountered while processing:  update-notifier-common  update-notifier  update-manager 
> ubuntu-release-upgrader-gtk E: Sub-process /usr/bin/dpkg returned an
> error code (1)

我尝试通过以下命令解决此问题:sudo apt-get --reinstall install python-debian,但错误再次出现,我无法继续。

这是 sudo apt-get update 的输出:

Ign:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease
Hit:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release        
Get:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg [801 B]
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                   
Hit:5 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu xenial InRelease
Hit:6 http://in.archive.ubuntu.com/ubuntu xenial InRelease                     
Ign:3 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg    
Hit:7 http://dl.google.com/linux/chrome/deb stable Release                     
Hit:8 https://deb.nodesource.com/node_7.x xenial InRelease                     
Hit:10 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
Hit:11 http://packages.cloud.google.com/apt cloud-sdk-xenial InRelease         
Hit:12 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease
Hit:13 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease             
Hit:14 https://download.sublimetext.com apt/stable/ InRelease                  
Hit:15 http://ppa.launchpad.net/webupd8team/tor-browser/ubuntu xenial InRelease
Fetched 801 B in 1s (477 B/s)                      
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Translations (main/i18n/Translation-en_IN) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release: The following signatures were invalid: KEYEXPIRED 1507497109
W: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Translations (main/i18n/Translation-en_IN) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/google-cloud-sdk.list:1 and /etc/apt/sources.list.d/google-cloud-sdk.list:2

答案1

我明白了...缺少两个模块(six 和 chardet),我可以使用以下命令下载:

sudo apt install --reinstall python3-six
sudo apt install --reinstall python3-chardet

运行这些,你应该就可以了

相关内容