首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于apport错误,无法再使用apt-get来安装。

由于apport错误,无法再使用apt-get来安装。
EN

Ask Ubuntu用户
提问于 2015-05-29 19:33:37
回答 1查看 9.9K关注 0票数 10

我正在使用Xubuntu (Ubuntu14.04.2LTS,64位)虚拟盒在Windows 7 PC上工作。最近,我在使用“apt-get”命令和软件更新程序时遇到了问题。软件更新程序无法下载其中一个更新--我有apport 2.14.1-0ubuntu3.10,它正在尝试安装2.14.1-0ubuntu3.11,但失败了。

此外,当我键入任何类型的‘apt’或'dpkg‘命令,比如’apt升级‘时,我会遇到如下错误,有人知道我能做什么吗?

代码语言:javascript
复制
Reading package lists...
Building 
dependency tree...
Reading state information...
The following packages will be upgraded:
  apport
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/180 kB of archives.
After this operation, 20.5 kB of additional disk space will be used.
Do you want to continue? [Y/n] (Reading database ... 314480 files and directories currently installed.)
Preparing to unpack .../apport_2.14.1-0ubuntu3.11_all.deb ...
initctl: Unknown job: apport
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
initctl: Unknown job: apport
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/apport_2.14.1-0ubuntu3.11_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, 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:
 /var/cache/apt/archives/apport_2.14.1-0ubuntu3.11_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
EN

回答 1

Ask Ubuntu用户

发布于 2016-01-05 16:10:29

我只是尝试在我的pc上编译python文件/usr/bin/pyclean,我用python3编译它,得到了相同的错误,而当我用python2编译它时,没有错误。

因此,我猜您在系统中更改了一些东西,使默认的python版本成为python3。

您可以尝试像这样解决这个问题:

  • 执行命令ls -l /usr/bin/python并查看其输出。
  • 如果文件/usr/bin/python指向python3.x,则删除该链接,并将其替换为指向python2 sudo rm /usr/bin/python2的链接-s /usr/bin/python2.7 /usr/bin/python现在python2.7将以系统中默认的python2.7版本的形式返回。
票数 13
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/629966

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档