{"id":153,"date":"2016-07-29T11:58:00","date_gmt":"2016-07-29T15:58:00","guid":{"rendered":"http:\/\/www.dev-notes.com\/blog\/2016\/07\/29\/ubuntu-root-partition-full\/"},"modified":"2020-06-15T14:23:00","modified_gmt":"2020-06-15T18:23:00","slug":"ubuntu-boot-partition-full","status":"publish","type":"post","link":"https:\/\/www.dev-notes.com\/blog\/2016\/07\/29\/ubuntu-boot-partition-full\/","title":{"rendered":"Ubuntu Boot Partition Full"},"content":{"rendered":"<p>The other day when I attempted to run some regular updates for my Linux box (running Ubuntu 14.04 LTS), I encountered the message that the update could no proceed because the boot partition was full. Here are the steps I took to clear unneeded files from the boot partition.<\/p>\n<p>1. First, I found out that I am running kernel 3.19.0-65 with this command below.<\/p>\n<pre class=\"code\">me@computer:~$  uname -r\n\n3.19.0-65-generic\n<\/pre>\n<p>2. Next, list what kernel images are present in my root partition.<\/p>\n<pre class=\"code\">me@computer:~$ dpkg --list | grep linux-image\n\nii  linux-image-3.19.0-61-generic\n3.19.0-61.69~14.04.1                                amd64        Linux\nkernel image for version 3.19.0 on 64 bit x86 SMP\nii  linux-image-3.19.0-65-generic\n3.19.0-65.73~14.04.1                                amd64        Linux\nkernel image for version 3.19.0 on 64 bit x86 SMP\nii  linux-image-extra-3.19.0-61-generic\n3.19.0-61.69~14.04.1                                amd64        Linux\nkernel extra modules for version 3.19.0 on 64 bit x86 SMP\nii  linux-image-extra-3.19.0-65-generic\n3.19.0-65.73~14.04.1                                amd64        Linux\nkernel extra modules for version 3.19.0 on 64 bit x86 SMP\nii  linux-image-generic-lts-vivid                         3.19.0.65.47\n                                       amd64        Generic Linux\nkernel image\n<\/pre>\n<p>3. The above was actually a truncated example; the actual list was much longer. In summary, I had many older kernel images that I do not need anymore. In the example shown above, I decided that since I am running 3.19.0-65, I will not need the -61 image anymore. Below is the command I used to clear out -61; I ran similar commands for all the kernel images with even lower versions as well to clear up space.<\/p>\n<pre class=\"code\">me@computer:~$ sudo apt-get purge linux-image-3.19.0-61-generic\n\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\nThe following packages will be REMOVED:\n  linux-image-3.19.0-61-generic*\n0 upgraded, 0 newly installed, 1 to remove and 8 not upgraded.\nAfter this operation, 47.8 MB disk space will be freed.\nDo you want to continue? [Y\/n] Y\n...\n<\/pre>\n<p>4. Finally, check out the contents of the \/boot\/ directory.  If you see any orphaned files from older kernels, consider removing them to save space.<\/p>\n<p>Bonus: Useful related commands<\/p>\n<pre class=\"code\">sudo apt-get autoremove\nsudo apt-get clean\nsudo apt-get update\nsudo apt-get dist-upgrade\n<\/pre>\n<p>&#8220;autoremove&#8221; gets rid of packages that were automatically installed previously, but are no longer needed.<\/p>\n<p>&#8220;cleans&#8221; empties \/var\/cache\/apt\/archives\/ and \/var\/cache\/apt\/archives\/partial\/.<\/p>\n<p>&#8220;update&#8221; updates apt-get&#8217;s list of available software packages.<\/p>\n<p>&#8220;dist-upgrade&#8221; is best explained via its man page entry:<br \/>\n<dir><br \/>\ndist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a &#8220;smart&#8221; conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages.<\/dir><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The steps described in this note may help you deal with a root partition that is running out of space.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":3,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":374,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions\/374"}],"wp:attachment":[{"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dev-notes.com\/blog\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}