删除 opera 浏览器后,出现 E: 执行脚本 DPkg 时出现问题

删除 opera 浏览器后,出现 E: 执行脚本 DPkg 时出现问题

我使用命令删除了 Opera 浏览器

sudo dpkg -r opera-stable 
sudo rm -f /etc/apt/sources.list.d/opera-stable.list

升级时我现在收到的错误是:

E: Problem executing scripts DPkg::Pre-Invoke 'stat -c %Z $(readlink -f $(which opera)) > /tmp/opera.timestamp'
E: Sub-process returned an error code

我尝试了清理 apt、更新、使用 -y 升级以及人们建议的所有其他方法。

我在使用 Lubuntu 20.04。

我删除了软件源中的所有存储库,但问题仍然存在。

apt purge opera-stable给出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
chromium-codecs-ffmpeg-extra pepperflashplugin-nonfree
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
opera-stable*
0 upgraded, 0 newly installed, 1 to remove and 42 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
readlink: missing operand
Try 'readlink --help' for more information.
stat: missing operand
Try 'stat --help' for more information.
E: Problem executing scripts DPkg::Pre-Invoke 'stat -c %Z $(readlink -f   $(which opera)) > /tmp/opera.timestamp'
E: Sub-process returned an error code

答案1

通过使用 snap 安装 opera 解决了这个问题。然后我删除了/etc/apt/sources.list它,并用从https://gist.githubusercontent.com/ishad0w/788555191c7037e249a439542c53e170/raw/3822ba49241e6fd851ca1c1cbcc4d7e87382f484/sources.list

相关内容