[ubuntu][apt-get upgrade]E: The package PACKAGE_NAME needs to be reinstalled, but I can’t find an archive for it.
the package PACKAGE_NAME needs to be reinstalled but i can’t find an archive for it(deb包安装过程意外终止导致的错误)
- PACKAGE_NAME 为软件名
通过deb包安装软件的时候卡死了,然后强制关机,重启后apt命令出错,更新管理器错误,软件包管理器打不开…
解决办法:
- 方法一: root权限打开文件 /var/lib/dpkg/status ,找到出错的软件包,删除关于它的所有信息
sudo cp /var/lib/dpkg/status /var/lib/dpkg/status_bkp
sudo gedit /var/lib/dpkg/status
ctrl+f 搜索处于“ purge reinstreq half-installed”状态 的软件,然后删除该段信息
接着更新
然后
sudo apt update
- 方法二 执行以下命令:
sudo dpkg --remove --force-remove-reinstreq code
参考
1. cnblogs–安装firefox失败修复烦人的“该软件包需要重新安装,但我找不到它的存档”在Linux Mint / Ubuntu中出错
2. blog.sina E: The package NAME needs to be reinstalled, but I can’t find an archive for it…(转