我正在使用 Xubuntu(Ubuntu 14.04.2 LTS,64 位)Virtual Box 在 Windows 7 PC 上工作。最近,我在使用“apt-get”命令和软件更新程序时遇到了问题。软件更新程序无法下载其中一个更新 - 我已获得 2.14.1-0ubuntu3.10 并且它正在尝试安装 2.14.1-0ubuntu3.11,但失败了。
另外,当我输入任何类型的“apt-get”或“dpkg”命令时,比如“apt-get upgrade”,我得到如下错误,有人知道我能做什么吗?
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)
Run Code Online (Sandbox Code Playgroud)
Sid*_*med 11
我只是试图/usr/bin/pyclean在我的电脑上编译 python 文件,我用 python3 编译它,我得到了同样的错误,而当我用 python2 编译它时,没有错误。
因此,我猜您更改了系统中的某些内容,使默认的 python 版本为 python3。
您可以尝试像这样解决这个问题:
ls -l /usr/bin/python并查看其输出。如果文件/usr/bin/python指向 python3.x ,则删除链接并将其替换为指向 python2 的链接
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
Run Code Online (Sandbox Code Playgroud)
现在 python2.7 将作为系统中的默认 python 版本恢复原状
| 归档时间: |
|
| 查看次数: |
8862 次 |
| 最近记录: |