linux-image-4.15.0-65-generic E: 子进程 /usr/bin/dpkg 返回错误代码 (1)

linux-image-4.15.0-65-generic E: 子进程 /usr/bin/dpkg 返回错误代码 (1)

我尝试从这里但不幸的是出现了这个错误。

如何修复它?

Do you want to continue? [Y/n] y
Setting up linux-image-4.15.0-65-generic (4.15.0-65.74~16.04.1) ...
Processing triggers for linux-image-4.15.0-65-generic (4.15.0-65.74~16.04.1) ...
/etc/kernel/postinst.d/apt-auto-removal:
Traceback (most recent call last):
  File "/usr/local/bin/sort", line 6, in <module>
    from sort import cli
  File "/usr/local/lib/python2.7/dist-packages/sort.py", line 3
    print('This is suroegin's package - sort')
                            ^
SyntaxError: invalid syntax
run-parts: /etc/kernel/postinst.d/apt-auto-removal exited with return code 1
dpkg: error processing package linux-image-4.15.0-65-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.15.0-65-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经使用:

sudo apt-get -f install    
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

答案1

尝试以下操作

  • 打开 /usr/local/lib/python2.7/dist-packages/sort.py
  • 转至第 3 行
  • print('This is suroegin's package - sort')用。。。来代替

    print("This is suroegin's package - sort")

  • 重新运行你运行的命令

相关内容