从Ubuntu 22.04升级至24.04失败,提示「Could not calculate the upgrade」
我刚完成从Ubuntu 20.04到22.04的升级,接着在「软件和更新」应用的「更新」标签里,把「通知我新的Ubuntu版本」设置为「任何新版本」,然后通过update-manager(软件更新器)尝试升级到24.04,但升级中途突然停止,弹出了如下错误提示:
Could not calculate the upgrade
An unresolvable problem occurred while calculating the upgrade.
This was likely caused by:
- Unofficial software packages not provided by Ubuntu
Please use the tool 'ppa-purge' from the ppa-purge
package to remove software from a Launchpad PPA and
try the upgrade again.If none of this applies, then please report this bug using the command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal. If you want to investigate this yourself the log files in '/var/log/dist-upgrade' will contain details about the upgrade. Specifically, look at 'main.log' or 'apt.log' for more information about conflicting packages.
针对这个问题,你可以按以下步骤排查解决:
清理第三方PPA的非官方包
错误提示已经点明,问题大概率是你添加的Launchpad第三方PPA里的非官方包干扰了升级计算。先安装ppa-purge工具:sudo apt install ppa-purge然后逐个清理系统中的第三方PPA,命令格式如下(替换成你实际添加的PPA地址):
sudo ppa-purge ppa:[ppa名称]/[ppa路径]比如你之前加过
ppa:webupd8team/java,就执行sudo ppa-purge ppa:webupd8team/java。查看升级日志定位具体冲突
要是不确定哪个PPA出了问题,可以去/var/log/dist-upgrade目录下查看升级日志,重点看main.log和apt.log,里面会详细记录包冲突的具体信息,帮你精准定位需要清理的PPA。提交Bug报告(若上述方法无效)
如果清理完所有第三方PPA后还是无法正常计算升级,就按照提示在终端执行以下命令提交Bug报告:sudo ubuntu-bug ubuntu-release-upgrader-core
备注:内容来源于stack exchange,提问作者Arturo

