关于更新ubuntu时遇到的问题。


#1

今日在更新Ubuntu时apt-get upgrade --show-upgraded,出现如下信息提示。

The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic

网上搜了一下解决办法,据说是因为有部份packages的安装版比release版新而出现”The following packages have been kept back”这个问题,解决方法是使用apt-get -u dist-upgrade 统一更新到发布的版本。这条命令会强制更新软件包到最新版本,并自动解决缺少的依赖包。

但是执行完命令后仍然不能正常安装,系统提示错误信息:

cryptsetup: WARNING: failed to detect canonical device of /dev/sda
cryptsetup: WARNING: could not determine root device from /etc/fstab

再次运行更新程序,提示下列软件包是自动安装的并且现在不需要了。

The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-29 linux-headers-4.15.0-29-generic
linux-image-4.15.0-29-generic linux-modules-4.15.0-29-generic
linux-modules-extra-4.15.0-29-generic
Use ‘apt autoremove’ to remove them.

输入:apt autoremove删除这些安装包。