[Share Experiences] 解决有些软件包不能自动升级的方法
Tofloor
poster avatar
deepinuser17
deepin
2022-09-29 16:30
Author

通常以下命令可以升级所有已经安装的软件包。

sudo apt update
sudo apt upgrade

但是当已经安装的软件包所依赖的包改变了,或增加了。而这些所依赖的新软件包还没有安装,以上的升级命令不会自动安装这些新的包。结果就是有些已经安装的软件包无法更新到新版本。 比如:

Reading package lists... Done
Building dependency tree   
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  deepin-music deepin-screen-recorder deepin-terminal deepin-voice-note qdbus
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

遇到这种问题可以运行以下命令安装新版本的软件包,从而完成全系统的升级。

sudo apt install --only-upgrade deepin-music deepin-screen-recorder deepin-terminal deepin-voice-note qdbus

 

虽然命令 “sudo apt dist-upgrade"也可以升级那些软件包,但是这个命令可能会删除现有版本的软件,导致系统出现软件缺失的问题。

Reply Favorite View the author
All Replies
xuqi
deepin testing team
2022-09-29 17:46
#1

like

  • 确实有遇到过,这个方法可以参考~
Reply View the author
wcs4221
deepin beta test group
2022-09-29 19:20
#2

学习了applaud

Reply View the author
晚秋(lateautumn)
Moderator
2022-09-29 23:07
#3

谢谢分享kissing_heart

Reply View the author
PUA
deepin
2022-09-30 17:54
#4

建议慎用,因为 --only-upgrade 照样可能卸载依赖包,造成依赖冲突

Reply View the author
deepinuser17
deepin
2022-10-04 07:58
#5

在Ubuntu 22.04运行的。 "apt dist-upgrade" 会卸载安装KDE桌面和一堆软件包。 但是"apt install --only-upgrade <软件包>"成功升级,而且没有卸载其它软件,但是安装了新增加的依赖包。

Reply View the author