如何修复 apport 和 apt-get 的依赖问题(ubuntu 16.04 从 14.04 升级而来)

如何修复 apport 和 apt-get 的依赖问题(ubuntu 16.04 从 14.04 升级而来)

我在依赖项和 apt-get 升级方面遇到了问题。我四处查看并尝试了此站点上的一组方法以及在 Google 上找到的其他内容。

b@asus:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 apport : Depends: python3-apport (>= 2.20.1-0ubuntu2.1) but 2.20.1-0ubuntu2 is installed
 apport-gtk : Depends: python3-apport (>= 2.20.1-0ubuntu2.1) but 2.20.1-0ubuntu2 is installed
E: Unmet dependencies. Try using -f.

我尝试使用 sudo apt-get -f install 和其他东西,如 autoremove 和 autoclean,但没有成功。

当我执行 apt-get upgrade 时也出现了这个问题:

Get:124 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 compizconfig-settings-manager all 1:0.9.12.2+16.04.20160526-0ubuntu1 [576 kB]
Fetched 160 MB in 2min 47s (955 kB/s)                                          
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 252887 files and directories currently installed.)
Preparing to unpack .../python3-problem-report_2.20.1-0ubuntu2.1_all.deb ...
  File "/usr/bin/py3clean", line 106

          ^
SyntaxError: unexpected EOF while parsing
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/py3clean", line 106

          ^
SyntaxError: unexpected EOF while parsing
dpkg: error processing archive /var/cache/apt/archives/python3-problem-report_2.20.1-0ubuntu2.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Preparing to unpack .../python3-apport_2.20.1-0ubuntu2.1_all.deb ...
  File "/usr/bin/py3clean", line 106

          ^
SyntaxError: unexpected EOF while parsing
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/py3clean", line 106

          ^
SyntaxError: unexpected EOF while parsing
dpkg: error processing archive /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Preparing to unpack .../init-system-helpers_1.29ubuntu2_all.deb ...
Unpacking init-system-helpers (1.29ubuntu2) over (1.29ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python3-problem-report_2.20.1-0ubuntu2.1_all.deb
 /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)    

答案1

我已经通过使用 python 2.7 而不是 python 3.4 解决了同样的问题:

 sudo rm python
 sudo ln -s python2.7 python
 sudo apt-get update
 sudo apt-get upgrade
 sudo rm python
 sudo ln -s python3.4 python

相关内容