包含多个内核构build的GCE实例占用全部空间

我正在使用GCE实例(操作系统:Ubuntu的)。 我可以看到磁盘空间已满,大部分空间被内核构build占用。 实例具有不同版本的内核版本。 我不确定这些是如何产生的。

有没有人遇到过这个问题。 任何帮助确定和解决这个问题?

这里是不同的版本,但它使用的是3.19.0-66-generic#74〜14.04.1-Ubuntu

root@bb-event-server-05:/lib/modules# ls -lrt total 140 drwxr-xr-x 5 root root 4096 Mar 15 2016 3.19.0-56-generic drwxr-xr-x 5 root root 4096 Apr 6 2016 3.16.0-69-generic drwxr-xr-x 5 root root 4096 Apr 6 2016 3.19.0-58-generic drwxr-xr-x 5 root root 4096 Apr 9 2016 3.16.0-70-generic drwxr-xr-x 5 root root 4096 May 17 2016 3.16.0-71-generic drwxr-xr-x 5 root root 4096 May 17 2016 3.19.0-59-generic drwxr-xr-x 5 root root 4096 Jun 10 2016 3.16.0-73-generic drwxr-xr-x 5 root root 4096 Jun 10 2016 3.19.0-61-generic drwxr-xr-x 5 root root 4096 Jun 28 2016 3.16.0-76-generic drwxr-xr-x 5 root root 4096 Jun 28 2016 3.19.0-64-generic drwxr-xr-x 5 root root 4096 Jul 15 2016 3.16.0-77-generic drwxr-xr-x 5 root root 4096 Jul 15 2016 3.19.0-65-generic drwxr-xr-x 5 root root 4096 Aug 9 2016 3.19.0-66-generic drwxr-xr-x 2 root root 4096 Sep 1 06:38 4.4.0-36-generic drwxr-xr-x 5 root root 4096 Sep 1 06:39 3.19.0-68-generic drwxr-xr-x 2 root root 4096 Sep 20 06:54 4.4.0-38-generic drwxr-xr-x 5 root root 4096 Sep 20 06:55 3.19.0-69-generic drwxr-xr-x 2 root root 4096 Oct 11 06:48 4.4.0-42-generic drwxr-xr-x 5 root root 4096 Oct 11 06:50 3.19.0-71-generic drwxr-xr-x 2 root root 4096 Oct 20 06:31 4.4.0-45-generic drwxr-xr-x 5 root root 4096 Oct 20 06:33 3.19.0-73-generic drwxr-xr-x 2 root root 4096 Nov 10 06:45 4.4.0-47-generic drwxr-xr-x 5 root root 4096 Nov 10 06:46 3.19.0-74-generic drwxr-xr-x 2 root root 4096 Nov 30 06:26 4.4.0-51-generic drwxr-xr-x 5 root root 4096 Nov 30 06:27 3.19.0-75-generic drwxr-xr-x 2 root root 4096 Dec 6 06:35 4.4.0-53-generic drwxr-xr-x 5 root root 4096 Dec 6 06:37 3.19.0-77-generic drwxr-xr-x 5 root root 4096 Dec 20 06:42 3.19.0-78-generic drwxr-xr-x 2 root root 4096 Dec 21 06:51 4.4.0-57-generic drwxr-xr-x 2 root root 4096 Jan 11 06:27 4.4.0-59-generic drwxr-xr-x 5 root root 4096 Jan 11 06:28 3.19.0-79-generic drwxr-xr-x 2 root root 4096 Feb 3 06:42 4.4.0-62-generic drwxr-xr-x 5 root root 4096 Feb 3 06:43 3.19.0-80-generic drwxr-xr-x 2 root root 4096 Feb 21 06:40 4.4.0-63-generic drwxr-xr-x 2 root root 4096 Feb 22 06:49 4.4.0-64-generic 

您可以尝试使用apt-get autoremove --purge来删除过时的依赖关系

在运行升级之后,Ubuntu和Debian在运行系统上默认保留旧的内核版本。

您可以通过运行dpkg -l | grep linux-imagefind内核软件包 dpkg -l | grep linux-image 。 然后你可以使用apt-get purge PACKAGE从你的系统中删除这个包。 用您从dpkg获得的软件包名称replacePACKAGE,除了您正在运行的软件包名称。