【已解决】今天更新了系统后,终端apt出现解包错误
Tofloor
poster avatar
aiyolo
deepin
2017-08-29 02:53
Author
本帖最后由 aiyolo 于 2017-9-4 10:08 编辑

正准备解包 .../deepin-menu_3.1.6-5_amd64.deb  ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: 警告: 子进程 旧的 pre-removal 脚本 返回错误状态 1
dpkg: 现在尝试使用新软件包所带的脚本...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: 处理归档 /var/cache/apt/archives/deepin-menu_3.1.6-5_amd64.deb (--unpack)时出错:
子进程 新的 pre-removal 脚本 返回错误状态 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: 清理时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
在处理时有错误发生:
/var/cache/apt/archives/deepin-menu_3.1.6-5_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


Reply Favorite View the author
All Replies
avatar
jingle
deepin
2017-08-29 03:29
#1
/var/cache/apt/archives/deepin-menu_3.1.6-5_amd64.deb删除这个目录下的包,然后再更新
Reply View the author
avatar
aiyolo
deepin
2017-08-29 23:32
#2
https://bbs.deepin.org/post/144762
/var/cache/apt/archives/deepin-menu_3.1.6-5_amd64.deb删除这个目录下的包,然后再更新
  1. aiyolo@aiyolo-PC:/var/cache/apt/archives$ sudo rm deepin-menu_3.1.6-5_amd64.deb
  2. [sudo] aiyolo 的密码:
  3. aiyolo@aiyolo-PC:/var/cache/apt/archives$ sudo apt update
  4. 命中:1 http://packages.deepin.com/deepin panda InRelease
  5. 正在读取软件包列表... 完成   
  6. 正在分析软件包的依赖关系树      
  7. 正在读取状态信息... 完成      
  8. 有 1 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。
  9. aiyolo@aiyolo-PC:/var/cache/apt/archives$ apt list --upgradable
  10. 正在列表... 完成
  11. deepin-menu/panda 3.1.6-5 amd64 [可从该版本升级:3.1.5-1]
  12. N: 还有 1 个版本。请使用 -a 选项来查看它(他们)。
  13. aiyolo@aiyolo-PC:/var/cache/apt/archives$ sudo apt upgrade
  14. 正在读取软件包列表... 完成
  15. 正在分析软件包的依赖关系树      
  16. 正在读取状态信息... 完成      
  17. 正在计算更新... 完成
  18. 下列软件包将被升级:
  19.   deepin-menu
  20. 升级了 1 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
  21. 有 49 个软件包没有被完全安装或卸载。
  22. 需要下载 47.8 kB 的归档。
  23. 解压缩后会消耗 0 B 的额外空间。
  24. 您希望继续执行吗? [Y/n] y
  25. 获取:1 http://packages.deepin.com/deepin panda/main amd64 deepin-menu amd64 3.1.6-5 [47.8 kB]
  26. 已下载 47.8 kB,耗时 0秒 (49.8 kB/s)
  27. (正在读取数据库 ... 系统当前共安装有 175029 个文件和目录。)
  28. 正准备解包 .../deepin-menu_3.1.6-5_amd64.deb  ...
  29.   File "/usr/bin/pyclean", line 63
  30.     except (IOError, OSError), e:
  31.                              ^
  32. SyntaxError: invalid syntax
  33. dpkg: 警告: 子进程 旧的 pre-removal 脚本 返回错误状态 1
  34. dpkg: 现在尝试使用新软件包所带的脚本...
  35.   File "/usr/bin/pyclean", line 63
  36.     except (IOError, OSError), e:
  37.                              ^
  38. SyntaxError: invalid syntax
  39. dpkg: 处理归档 /var/cache/apt/archives/deepin-menu_3.1.6-5_amd64.deb (--unpack)时出错:
  40. 子进程 新的 pre-removal 脚本 返回错误状态 1
  41. Traceback (most recent call last):
  42.   File "/usr/bin/pycompile", line 35, in
  43.     from debpython.version import SUPPORTED, debsorted, vrepr, \
  44.   File "/usr/share/python/debpython/version.py", line 24, in
  45.     from ConfigParser import SafeConfigParser
  46. ImportError: No module named 'ConfigParser'
  47. dpkg: 清理时出错:
  48. 子进程 已安装 post-installation 脚本 返回错误状态 1
  49. 在处理时有错误发生:
  50. /var/cache/apt/archives/deepin-menu_3.1.6-5_amd64.deb
  51. E: Sub-process /usr/bin/dpkg returned an error code (1)
  52. aiyolo@aiyolo-PC:/var/cache/apt/archives$
Copy the Code
Reply View the author
avatar
jingle
deepin
2017-08-29 23:40
#3
Reply View the author
avatar
wtz
deepin
2017-08-30 02:53
#4
应该是python版本问题导致的。
  1. sudo mv /usr/bin/python /usr/bin/python.old
  2. sudo ln -s /usr/bin/python3 /usr/bin/python
Copy the Code

试试
Reply View the author
avatar
BingoLove
deepin
2017-08-30 05:24
#5
本帖最后由 BingoLove 于 2017-8-29 21:27 编辑

arch?arch默认Python是Python3

这是默认Python变成Python3了
把默认python改回Python2就好了,楼上说的刚好反了

也不一定,又看了这篇帖子https://bbs.deepin.org/post/137735
http://blog.csdn.net/gatieme/article/details/52839814
Reply View the author
avatar
aiyolo
deepin
2017-09-04 18:07
#6
https://bbs.deepin.org/post/144762
arch?arch默认Python是Python3

这是默认Python变成Python3了

改回Python2后,已解决
Reply View the author