无法删除 Landscape-common 或 Dist-upgrade

无法删除 Landscape-common 或 Dist-upgrade

正在做:

dpkg --purge "landscape-common"
(Reading database ... 125316 files and directories currently installed.)
Removing landscape-common ...
  File "/usr/bin/pyclean", line 64
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing landscape-common (--purge):
 subprocess installed pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 36, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named ConfigParser
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 landscape-common

或者

apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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 landscape-common (12.05-0ubuntu2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 36, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named ConfigParser
dpkg: error processing landscape-common (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 landscape-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

或者

do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [198 B]
Get:2 Upgrade tool [1,206 kB]
Fetched 1,206 kB in 0s (0 B/s)
authenticate 'raring.tar.gz' against 'raring.tar.gz.gpg'
extracting 'raring.tar.gz'
File
"/tmp/ubuntu-release-upgrader-nq83uj/DistUpgrade/DistUpgradeController.py",
line 1629, in fullUpgrade
if not self.prepare():

File
"/tmp/ubuntu-release-upgrader-nq83uj/DistUpgrade/DistUpgradeController.py",
line 441, in prepare
self._sshMagic()

File
"/tmp/ubuntu-release-upgrader-nq83uj/DistUpgrade/DistUpgradeController.py",
line 311, in _sshMagic
"Do you want to continue?") % port)

File
"/tmp/ubuntu-release-upgrader-nq83uj/DistUpgrade/DistUpgradeViewText.py",
line 216, in askYesNoQuestion
res = sys.stdin.readline().decode(ENCODING, "backslashreplace")

AttributeError: 'str' object has no attribute 'decode'
=== Command detached from window (Fri Apr 26 00:06:19 2013) ===
=== Command terminated with exit status 1 (Fri Apr 26 00:06:19 2013) ===

没有成功?有什么想法吗?

答案1

这样做:

更新替代方案——安装/usr/bin/python python /usr/bin/python2.7 1

将修复你的 Ubuntu!!!

不要将 Python3 设置为默认 Python 版本!否则,如果某些应用程序没有设置它,那就只能祈祷了……

相关内容