升级到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")
再点安装,即可顺利安装,中间提示不被信任只要点忽略就行了。