“The volume boot has only 0 bytes disk space remaining”











up vote
31
down vote

favorite
16












After a recent update, I'm getting an alert saying:



The volume boot has only 0 bytes disk space remaining


But my computer has plenty of HD space free. Does anyone know how I resolve this. (If it's relevant, I'm using the whole disk encryption feature of the alternate install image for Ubuntu 12.04).










share|improve this question
























  • It really depends on how you installed Ubuntu on your machine. Can you "sudo fdisk -l" in terminal and check whether there is a small partition which is almost full?
    – Paulius Šukys
    Nov 18 '12 at 9:50






  • 4




    Better still, please run the command 'df -H -x tmpfs -x devtmpfs' without the quotes and paste the output here.
    – fabricator4
    Nov 18 '12 at 10:12










  • This question and answers are related to the problem, and may help.
    – elomage
    May 25 '15 at 5:09










  • apparently a known issue for encrypted partition. answer askubuntu.com/a/230942/231504 is great -- works for me. Also, though, please increment the count of affected users in the ubuntu tracker: bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/…
    – pestophagous
    Sep 20 '17 at 18:05















up vote
31
down vote

favorite
16












After a recent update, I'm getting an alert saying:



The volume boot has only 0 bytes disk space remaining


But my computer has plenty of HD space free. Does anyone know how I resolve this. (If it's relevant, I'm using the whole disk encryption feature of the alternate install image for Ubuntu 12.04).










share|improve this question
























  • It really depends on how you installed Ubuntu on your machine. Can you "sudo fdisk -l" in terminal and check whether there is a small partition which is almost full?
    – Paulius Šukys
    Nov 18 '12 at 9:50






  • 4




    Better still, please run the command 'df -H -x tmpfs -x devtmpfs' without the quotes and paste the output here.
    – fabricator4
    Nov 18 '12 at 10:12










  • This question and answers are related to the problem, and may help.
    – elomage
    May 25 '15 at 5:09










  • apparently a known issue for encrypted partition. answer askubuntu.com/a/230942/231504 is great -- works for me. Also, though, please increment the count of affected users in the ubuntu tracker: bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/…
    – pestophagous
    Sep 20 '17 at 18:05













up vote
31
down vote

favorite
16









up vote
31
down vote

favorite
16






16





After a recent update, I'm getting an alert saying:



The volume boot has only 0 bytes disk space remaining


But my computer has plenty of HD space free. Does anyone know how I resolve this. (If it's relevant, I'm using the whole disk encryption feature of the alternate install image for Ubuntu 12.04).










share|improve this question















After a recent update, I'm getting an alert saying:



The volume boot has only 0 bytes disk space remaining


But my computer has plenty of HD space free. Does anyone know how I resolve this. (If it's relevant, I'm using the whole disk encryption feature of the alternate install image for Ubuntu 12.04).







12.04 boot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 at 18:34









Zanna

49.4k13128236




49.4k13128236










asked Nov 18 '12 at 9:24









user924731

156123




156123












  • It really depends on how you installed Ubuntu on your machine. Can you "sudo fdisk -l" in terminal and check whether there is a small partition which is almost full?
    – Paulius Šukys
    Nov 18 '12 at 9:50






  • 4




    Better still, please run the command 'df -H -x tmpfs -x devtmpfs' without the quotes and paste the output here.
    – fabricator4
    Nov 18 '12 at 10:12










  • This question and answers are related to the problem, and may help.
    – elomage
    May 25 '15 at 5:09










  • apparently a known issue for encrypted partition. answer askubuntu.com/a/230942/231504 is great -- works for me. Also, though, please increment the count of affected users in the ubuntu tracker: bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/…
    – pestophagous
    Sep 20 '17 at 18:05


















  • It really depends on how you installed Ubuntu on your machine. Can you "sudo fdisk -l" in terminal and check whether there is a small partition which is almost full?
    – Paulius Šukys
    Nov 18 '12 at 9:50






  • 4




    Better still, please run the command 'df -H -x tmpfs -x devtmpfs' without the quotes and paste the output here.
    – fabricator4
    Nov 18 '12 at 10:12










  • This question and answers are related to the problem, and may help.
    – elomage
    May 25 '15 at 5:09










  • apparently a known issue for encrypted partition. answer askubuntu.com/a/230942/231504 is great -- works for me. Also, though, please increment the count of affected users in the ubuntu tracker: bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/…
    – pestophagous
    Sep 20 '17 at 18:05
















It really depends on how you installed Ubuntu on your machine. Can you "sudo fdisk -l" in terminal and check whether there is a small partition which is almost full?
– Paulius Šukys
Nov 18 '12 at 9:50




It really depends on how you installed Ubuntu on your machine. Can you "sudo fdisk -l" in terminal and check whether there is a small partition which is almost full?
– Paulius Šukys
Nov 18 '12 at 9:50




4




4




Better still, please run the command 'df -H -x tmpfs -x devtmpfs' without the quotes and paste the output here.
– fabricator4
Nov 18 '12 at 10:12




Better still, please run the command 'df -H -x tmpfs -x devtmpfs' without the quotes and paste the output here.
– fabricator4
Nov 18 '12 at 10:12












This question and answers are related to the problem, and may help.
– elomage
May 25 '15 at 5:09




This question and answers are related to the problem, and may help.
– elomage
May 25 '15 at 5:09












apparently a known issue for encrypted partition. answer askubuntu.com/a/230942/231504 is great -- works for me. Also, though, please increment the count of affected users in the ubuntu tracker: bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/…
– pestophagous
Sep 20 '17 at 18:05




apparently a known issue for encrypted partition. answer askubuntu.com/a/230942/231504 is great -- works for me. Also, though, please increment the count of affected users in the ubuntu tracker: bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/…
– pestophagous
Sep 20 '17 at 18:05










4 Answers
4






active

oldest

votes

















up vote
48
down vote













To list all kernel:
dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "t" ";" | cut -d ";" -f1



The results looks somewhat like this:



linux-image-3.19.0-7-generic 
linux-image-3.18.0-13-generic
linux-image-3.16.0-23-generic


Don't delete all kernels, only old ones!



Next let's remove the 3.16 kernel,
sudo apt-get purge linux-image-3.16.0-23-generic



and then all unused packages from the system:
sudo apt-get autoclean && sudo apt-get autoremove






share|improve this answer























  • I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
    – Mads Skjern
    Mar 5 '15 at 11:53










  • This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
    – blong
    Nov 10 '15 at 14:35






  • 4




    if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
    – pomarc
    Jun 21 '17 at 15:30






  • 1




    How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
    – jacob
    May 29 at 18:10




















up vote
22
down vote













The cause was indeed old kernel images.

To clean up all I had to do was run one line:



sudo apt-get autoclean && sudo apt-get autoremove


This automatically recognized old kernals and removed them.






share|improve this answer




























    up vote
    8
    down vote













    It might be that your /boot partition has accumulated too many kernel versions while doing upgrades over time. This partition is likely to be separate from your large disk partition (mounted as /). You can check the /boot partition space like this (look for the line with /boot):



    df -h


    There is a nice page on how to remove old kernels.



    In short, check your current kernel version, get the list of what is installed, and then apt-get remove the old versions. There is also a "magic" one-liner command on the page that will do all that for you. But use it at your own risk.



    Instructions in more detail:





    1. Get the current kernel version, the one you want to keep:



      uname -r



    2. Get the list of all kernels installed:



      dpkg -l | grep linux-image-



    3. Run apt-get remove on the kernels you want to remove. Not on the latest one! For example:



      sudo apt-get remove linux-image-2.6.32-22-generic



    More notes:





    • dpkg -l will tell you the status of the (kernel) package before the package name.
      For example:



      rc  linux-image-3.13.0-39-generic  ...
      ii linux-image-3.13.0-40-generic ...



      • "rc" means that the package is removed and has configuration files. These you do not need to remove any more.

      • "ii" means that the package is marked for installation and is installed


      Based on this, you could list only the kernel packages that are installed:



      dpkg -l | grep "ii.*linux-image-"





    Alternative solution, using GUI tool Ubuntu Tweak.



    Install and go to Computer Janitor, check the System->Old Kernel and System->Unneeded packages, and press Clean.






    share|improve this answer






























      up vote
      3
      down vote













      Use this script so that will remove all other old kernels leaving current version and previous (last 1 kernel version)



      KERNELMAGES=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-image/g'`

      KERNELHEADERS=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-headers/g'`

      for PURGEKERNEL in `echo $KERNELMAGES $KERNELHEADERS`; do

      apt-get autoremove -y && apt-get purge $PURGEKERNEL -y

      done





      share|improve this answer





















      • Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
        – bulltorious
        Aug 29 '17 at 21:25










      • I am getting "Permission denied"...
        – Richard Hardy
        Jul 1 at 5:55










      protected by Community Jun 20 '16 at 9:14



      Thank you for your interest in this question.
      Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



      Would you like to answer one of these unanswered questions instead?














      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      48
      down vote













      To list all kernel:
      dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "t" ";" | cut -d ";" -f1



      The results looks somewhat like this:



      linux-image-3.19.0-7-generic 
      linux-image-3.18.0-13-generic
      linux-image-3.16.0-23-generic


      Don't delete all kernels, only old ones!



      Next let's remove the 3.16 kernel,
      sudo apt-get purge linux-image-3.16.0-23-generic



      and then all unused packages from the system:
      sudo apt-get autoclean && sudo apt-get autoremove






      share|improve this answer























      • I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
        – Mads Skjern
        Mar 5 '15 at 11:53










      • This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
        – blong
        Nov 10 '15 at 14:35






      • 4




        if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
        – pomarc
        Jun 21 '17 at 15:30






      • 1




        How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
        – jacob
        May 29 at 18:10

















      up vote
      48
      down vote













      To list all kernel:
      dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "t" ";" | cut -d ";" -f1



      The results looks somewhat like this:



      linux-image-3.19.0-7-generic 
      linux-image-3.18.0-13-generic
      linux-image-3.16.0-23-generic


      Don't delete all kernels, only old ones!



      Next let's remove the 3.16 kernel,
      sudo apt-get purge linux-image-3.16.0-23-generic



      and then all unused packages from the system:
      sudo apt-get autoclean && sudo apt-get autoremove






      share|improve this answer























      • I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
        – Mads Skjern
        Mar 5 '15 at 11:53










      • This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
        – blong
        Nov 10 '15 at 14:35






      • 4




        if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
        – pomarc
        Jun 21 '17 at 15:30






      • 1




        How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
        – jacob
        May 29 at 18:10















      up vote
      48
      down vote










      up vote
      48
      down vote









      To list all kernel:
      dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "t" ";" | cut -d ";" -f1



      The results looks somewhat like this:



      linux-image-3.19.0-7-generic 
      linux-image-3.18.0-13-generic
      linux-image-3.16.0-23-generic


      Don't delete all kernels, only old ones!



      Next let's remove the 3.16 kernel,
      sudo apt-get purge linux-image-3.16.0-23-generic



      and then all unused packages from the system:
      sudo apt-get autoclean && sudo apt-get autoremove






      share|improve this answer














      To list all kernel:
      dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "t" ";" | cut -d ";" -f1



      The results looks somewhat like this:



      linux-image-3.19.0-7-generic 
      linux-image-3.18.0-13-generic
      linux-image-3.16.0-23-generic


      Don't delete all kernels, only old ones!



      Next let's remove the 3.16 kernel,
      sudo apt-get purge linux-image-3.16.0-23-generic



      and then all unused packages from the system:
      sudo apt-get autoclean && sudo apt-get autoremove







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 24 '15 at 1:13









      artburkart

      1033




      1033










      answered Dec 20 '12 at 9:50









      Paradiesstaub

      2,03151834




      2,03151834












      • I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
        – Mads Skjern
        Mar 5 '15 at 11:53










      • This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
        – blong
        Nov 10 '15 at 14:35






      • 4




        if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
        – pomarc
        Jun 21 '17 at 15:30






      • 1




        How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
        – jacob
        May 29 at 18:10




















      • I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
        – Mads Skjern
        Mar 5 '15 at 11:53










      • This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
        – blong
        Nov 10 '15 at 14:35






      • 4




        if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
        – pomarc
        Jun 21 '17 at 15:30






      • 1




        How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
        – jacob
        May 29 at 18:10


















      I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
      – Mads Skjern
      Mar 5 '15 at 11:53




      I have some called extra too, eg both linux-image-3.13.0-40-generic and linux-image-extra-3.13.0-40-generic. Can I delete the ones with extra?
      – Mads Skjern
      Mar 5 '15 at 11:53












      This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
      – blong
      Nov 10 '15 at 14:35




      This was extremely helpful, but didn't completely solve my problem (purging an old kernel was still failing). I had to manually remove some old kernel files. I found a few large ones using find /boot/ -type f | xargs du | sort -n. My currently running kernel is 3.13.0-66-generic, so I'm careful not to delete anything related to that, but I did remove the following : sudo rm /boot/initrd.img-3.13.0-63-generic /boot/initrd.img-3.13.0-65-generic /boot/vmlinuz-3.13.0-65-generic /boot/vmlinuz-3.13.0-63-generic. Finally, running purge on an old kernel succeeds.
      – blong
      Nov 10 '15 at 14:35




      4




      4




      if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
      – pomarc
      Jun 21 '17 at 15:30




      if you really have 0 bytes free, this won't work as @blong said. you have to manually remove some old vmlinuz file before, because the purge process needs to create some files and, if 0 bytes are left, this fails.
      – pomarc
      Jun 21 '17 at 15:30




      1




      1




      How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
      – jacob
      May 29 at 18:10






      How do I know which kernels are old? My output is linux-image-4.10.0-42-generic linux-image-4.13.0-26-generic linux-image-4.13.0-32-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.8.0-36-generic
      – jacob
      May 29 at 18:10














      up vote
      22
      down vote













      The cause was indeed old kernel images.

      To clean up all I had to do was run one line:



      sudo apt-get autoclean && sudo apt-get autoremove


      This automatically recognized old kernals and removed them.






      share|improve this answer

























        up vote
        22
        down vote













        The cause was indeed old kernel images.

        To clean up all I had to do was run one line:



        sudo apt-get autoclean && sudo apt-get autoremove


        This automatically recognized old kernals and removed them.






        share|improve this answer























          up vote
          22
          down vote










          up vote
          22
          down vote









          The cause was indeed old kernel images.

          To clean up all I had to do was run one line:



          sudo apt-get autoclean && sudo apt-get autoremove


          This automatically recognized old kernals and removed them.






          share|improve this answer












          The cause was indeed old kernel images.

          To clean up all I had to do was run one line:



          sudo apt-get autoclean && sudo apt-get autoremove


          This automatically recognized old kernals and removed them.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 5 '17 at 15:03









          Selah

          90511426




          90511426






















              up vote
              8
              down vote













              It might be that your /boot partition has accumulated too many kernel versions while doing upgrades over time. This partition is likely to be separate from your large disk partition (mounted as /). You can check the /boot partition space like this (look for the line with /boot):



              df -h


              There is a nice page on how to remove old kernels.



              In short, check your current kernel version, get the list of what is installed, and then apt-get remove the old versions. There is also a "magic" one-liner command on the page that will do all that for you. But use it at your own risk.



              Instructions in more detail:





              1. Get the current kernel version, the one you want to keep:



                uname -r



              2. Get the list of all kernels installed:



                dpkg -l | grep linux-image-



              3. Run apt-get remove on the kernels you want to remove. Not on the latest one! For example:



                sudo apt-get remove linux-image-2.6.32-22-generic



              More notes:





              • dpkg -l will tell you the status of the (kernel) package before the package name.
                For example:



                rc  linux-image-3.13.0-39-generic  ...
                ii linux-image-3.13.0-40-generic ...



                • "rc" means that the package is removed and has configuration files. These you do not need to remove any more.

                • "ii" means that the package is marked for installation and is installed


                Based on this, you could list only the kernel packages that are installed:



                dpkg -l | grep "ii.*linux-image-"





              Alternative solution, using GUI tool Ubuntu Tweak.



              Install and go to Computer Janitor, check the System->Old Kernel and System->Unneeded packages, and press Clean.






              share|improve this answer



























                up vote
                8
                down vote













                It might be that your /boot partition has accumulated too many kernel versions while doing upgrades over time. This partition is likely to be separate from your large disk partition (mounted as /). You can check the /boot partition space like this (look for the line with /boot):



                df -h


                There is a nice page on how to remove old kernels.



                In short, check your current kernel version, get the list of what is installed, and then apt-get remove the old versions. There is also a "magic" one-liner command on the page that will do all that for you. But use it at your own risk.



                Instructions in more detail:





                1. Get the current kernel version, the one you want to keep:



                  uname -r



                2. Get the list of all kernels installed:



                  dpkg -l | grep linux-image-



                3. Run apt-get remove on the kernels you want to remove. Not on the latest one! For example:



                  sudo apt-get remove linux-image-2.6.32-22-generic



                More notes:





                • dpkg -l will tell you the status of the (kernel) package before the package name.
                  For example:



                  rc  linux-image-3.13.0-39-generic  ...
                  ii linux-image-3.13.0-40-generic ...



                  • "rc" means that the package is removed and has configuration files. These you do not need to remove any more.

                  • "ii" means that the package is marked for installation and is installed


                  Based on this, you could list only the kernel packages that are installed:



                  dpkg -l | grep "ii.*linux-image-"





                Alternative solution, using GUI tool Ubuntu Tweak.



                Install and go to Computer Janitor, check the System->Old Kernel and System->Unneeded packages, and press Clean.






                share|improve this answer

























                  up vote
                  8
                  down vote










                  up vote
                  8
                  down vote









                  It might be that your /boot partition has accumulated too many kernel versions while doing upgrades over time. This partition is likely to be separate from your large disk partition (mounted as /). You can check the /boot partition space like this (look for the line with /boot):



                  df -h


                  There is a nice page on how to remove old kernels.



                  In short, check your current kernel version, get the list of what is installed, and then apt-get remove the old versions. There is also a "magic" one-liner command on the page that will do all that for you. But use it at your own risk.



                  Instructions in more detail:





                  1. Get the current kernel version, the one you want to keep:



                    uname -r



                  2. Get the list of all kernels installed:



                    dpkg -l | grep linux-image-



                  3. Run apt-get remove on the kernels you want to remove. Not on the latest one! For example:



                    sudo apt-get remove linux-image-2.6.32-22-generic



                  More notes:





                  • dpkg -l will tell you the status of the (kernel) package before the package name.
                    For example:



                    rc  linux-image-3.13.0-39-generic  ...
                    ii linux-image-3.13.0-40-generic ...



                    • "rc" means that the package is removed and has configuration files. These you do not need to remove any more.

                    • "ii" means that the package is marked for installation and is installed


                    Based on this, you could list only the kernel packages that are installed:



                    dpkg -l | grep "ii.*linux-image-"





                  Alternative solution, using GUI tool Ubuntu Tweak.



                  Install and go to Computer Janitor, check the System->Old Kernel and System->Unneeded packages, and press Clean.






                  share|improve this answer














                  It might be that your /boot partition has accumulated too many kernel versions while doing upgrades over time. This partition is likely to be separate from your large disk partition (mounted as /). You can check the /boot partition space like this (look for the line with /boot):



                  df -h


                  There is a nice page on how to remove old kernels.



                  In short, check your current kernel version, get the list of what is installed, and then apt-get remove the old versions. There is also a "magic" one-liner command on the page that will do all that for you. But use it at your own risk.



                  Instructions in more detail:





                  1. Get the current kernel version, the one you want to keep:



                    uname -r



                  2. Get the list of all kernels installed:



                    dpkg -l | grep linux-image-



                  3. Run apt-get remove on the kernels you want to remove. Not on the latest one! For example:



                    sudo apt-get remove linux-image-2.6.32-22-generic



                  More notes:





                  • dpkg -l will tell you the status of the (kernel) package before the package name.
                    For example:



                    rc  linux-image-3.13.0-39-generic  ...
                    ii linux-image-3.13.0-40-generic ...



                    • "rc" means that the package is removed and has configuration files. These you do not need to remove any more.

                    • "ii" means that the package is marked for installation and is installed


                    Based on this, you could list only the kernel packages that are installed:



                    dpkg -l | grep "ii.*linux-image-"





                  Alternative solution, using GUI tool Ubuntu Tweak.



                  Install and go to Computer Janitor, check the System->Old Kernel and System->Unneeded packages, and press Clean.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 25 '15 at 5:32

























                  answered Mar 3 '15 at 8:34









                  elomage

                  1,037814




                  1,037814






















                      up vote
                      3
                      down vote













                      Use this script so that will remove all other old kernels leaving current version and previous (last 1 kernel version)



                      KERNELMAGES=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-image/g'`

                      KERNELHEADERS=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-headers/g'`

                      for PURGEKERNEL in `echo $KERNELMAGES $KERNELHEADERS`; do

                      apt-get autoremove -y && apt-get purge $PURGEKERNEL -y

                      done





                      share|improve this answer





















                      • Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
                        – bulltorious
                        Aug 29 '17 at 21:25










                      • I am getting "Permission denied"...
                        – Richard Hardy
                        Jul 1 at 5:55















                      up vote
                      3
                      down vote













                      Use this script so that will remove all other old kernels leaving current version and previous (last 1 kernel version)



                      KERNELMAGES=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-image/g'`

                      KERNELHEADERS=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-headers/g'`

                      for PURGEKERNEL in `echo $KERNELMAGES $KERNELHEADERS`; do

                      apt-get autoremove -y && apt-get purge $PURGEKERNEL -y

                      done





                      share|improve this answer





















                      • Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
                        – bulltorious
                        Aug 29 '17 at 21:25










                      • I am getting "Permission denied"...
                        – Richard Hardy
                        Jul 1 at 5:55













                      up vote
                      3
                      down vote










                      up vote
                      3
                      down vote









                      Use this script so that will remove all other old kernels leaving current version and previous (last 1 kernel version)



                      KERNELMAGES=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-image/g'`

                      KERNELHEADERS=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-headers/g'`

                      for PURGEKERNEL in `echo $KERNELMAGES $KERNELHEADERS`; do

                      apt-get autoremove -y && apt-get purge $PURGEKERNEL -y

                      done





                      share|improve this answer












                      Use this script so that will remove all other old kernels leaving current version and previous (last 1 kernel version)



                      KERNELMAGES=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-image/g'`

                      KERNELHEADERS=`ls -lRt /boot/vmlinuz-*| awk -F/ '{print $3}' | grep -v $(uname -r) | sed 1d | sed -e 's/vmlinuz/linux-headers/g'`

                      for PURGEKERNEL in `echo $KERNELMAGES $KERNELHEADERS`; do

                      apt-get autoremove -y && apt-get purge $PURGEKERNEL -y

                      done






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 18 '15 at 7:50









                      PKumar

                      1,366612




                      1,366612












                      • Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
                        – bulltorious
                        Aug 29 '17 at 21:25










                      • I am getting "Permission denied"...
                        – Richard Hardy
                        Jul 1 at 5:55


















                      • Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
                        – bulltorious
                        Aug 29 '17 at 21:25










                      • I am getting "Permission denied"...
                        – Richard Hardy
                        Jul 1 at 5:55
















                      Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
                      – bulltorious
                      Aug 29 '17 at 21:25




                      Worked perfect, even when I could not do "Paradiesstaub"s answer from the command line.
                      – bulltorious
                      Aug 29 '17 at 21:25












                      I am getting "Permission denied"...
                      – Richard Hardy
                      Jul 1 at 5:55




                      I am getting "Permission denied"...
                      – Richard Hardy
                      Jul 1 at 5:55





                      protected by Community Jun 20 '16 at 9:14



                      Thank you for your interest in this question.
                      Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                      Would you like to answer one of these unanswered questions instead?



                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                      Eduardo VII do Reino Unido