UBUNTU 11.10 软件中心 apt UnicodeDecodeError的解决方法(最新修改)
2011-10-31 16:59
555 查看
升级到11.10,需要安装一个自行开发的deb包,结果安装时python报错无法继续:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 968, in simulate
trans.unauthenticated = self._simulate_helper(trans)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1028, in _simulate_helper
deb = self.install_file(trans, simulate=True, **trans.kwargs)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 532, in install_file
deb = self._check_deb_file(path, force, trans.uid)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1147, in _check_deb_file
"\n%s" % (path, stdout))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 38: ordinal not in range(128)
这次又碰到一个软件,发现之前的办法不好使,后来我才发现,原来报错的原因是我把deb包放在中文路径下了,解决方法要么把软件包移到非中文路径下,要么:
研究了一下上述的python文件,修改第1143行:
stdout = unicode(proc.stdout.read(),
sys.stdin.encoding or "UTF-8",
errors="replace").encode("UTF-8")
改为:
stdout = unicode(proc.stdout.read(),
"UTF-8",
errors="replace").encode("UTF-8")
再点安装,即可顺利安装,中间提示不被信任只要点忽略就行了。
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 968, in simulate
trans.unauthenticated = self._simulate_helper(trans)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1028, in _simulate_helper
deb = self.install_file(trans, simulate=True, **trans.kwargs)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 532, in install_file
deb = self._check_deb_file(path, force, trans.uid)
File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1147, in _check_deb_file
"\n%s" % (path, stdout))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 38: ordinal not in range(128)
这次又碰到一个软件,发现之前的办法不好使,后来我才发现,原来报错的原因是我把deb包放在中文路径下了,解决方法要么把软件包移到非中文路径下,要么:
研究了一下上述的python文件,修改第1143行:
stdout = unicode(proc.stdout.read(),
sys.stdin.encoding or "UTF-8",
errors="replace").encode("UTF-8")
改为:
stdout = unicode(proc.stdout.read(),
"UTF-8",
errors="replace").encode("UTF-8")
再点安装,即可顺利安装,中间提示不被信任只要点忽略就行了。
相关文章推荐
- Ubuntu14.04软件中心安装软件会提示下载软件包文件失败解决方法
- Ubuntu下apt-get安装软件时缺少依赖包解决方法
- dpkg: error processing /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb 解决方法
- ubuntu软件中心安装matlab快捷方式总是卡死的解决方法
- Ubuntu软件中心打不开的解决方法
- ubuntu软件中心崩溃解决方法
- Ubuntu apt-get更新及安装软件失败的解决方法
- ubuntu 更新失败,以至于ubuntu 软件中心打不开的解决方法
- Ubuntu安装软件是出现E: Sub-process /usr/bin/dpkg returned an error code (1)的解决方法
- ubuntu软件中心崩溃解决方法
- Ubuntu 下找不到软件中心的解决方法
- ubuntu apt-get卸载软件无法卸载干净的解决方法(ubuntu卸载apache)
- ubuntu apt-get卸载软件无法卸载干净的解决方法(ubuntu卸载apache)
- Ubuntu - 运行 apt-get install 就出现jdk installer 错误的解决方法
- ubuntu下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- Ubuntu 装Firefox的Flash时软件中心卡住的解决办法
- ubuntu安装jdk时候(软件包 sun-java6-jdk 没有可供安装的候选者)问题解决方法!
- 解决apt-get无法删除和安装软件的问题的方法
- Python安装模块出现问题UnicodeDecodeError的解决方法
- apt更新软件时,ssh超时,解决方法