Announcement

Collapse
No announcement yet.

Need help freeing up some space

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help freeing up some space

    Hi all,

    When I installed kubuntu on my computer, I set the operating system up in its own partition, and have a separate "home" partition for all my files. I am currently on Wily, but want to upgrade to 16.04.

    However, when I run the update manager and try to upgrade, I get an error message saying I do not have enough free space (I have attached a screenshot). I tried running the "clean" command suggested in the message, but it doesn't free up enough space.

    What can I safely delete? Should I uninstall some programs?

    Jason
    Attached Files

    #2
    There's no way we can tell you what to do since you haven't provided any information other than your partition is full. How big is the partition? What's on it?

    Basically, you can safely remove all the kernels except for the one you're booting. Uninstall any large programs like OpenOffice. Delete old log files as none of them will apply anyway after you upgrade. Clear out /tmp.

    Depending on what you've got on there and how big your partition was to begin with, that may do it. If not, you might be required to expand the partition or use a different one for a clean install.

    Frankly, if you've used a partition that is so small it can't handle an upgrade, you should probably consider enlarging it anyway. You could potentially end up with a full root partition which would leave you unbootable.

    You need about 8-12 GB for a full system with lots of programs. I generally recommend no less than 16GB.

    Please Read Me

    Comment


      #3
      Open a Konsole and type:
      sudo apt-get clean && sudo apt-get autoremove
      This will recover a fare amount of space under / if you have not been performing package cleanup maintenance.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Originally posted by oshunluvr View Post
        There's no way we can tell you what to do since you haven't provided any information other than your partition is full. How big is the partition? What's on it?
        My "/" partition, which is the OS, is 21GB, about 18GB is used. I assume this is all the OS files and installed programs, but I don't know for sure. How can I tell? Is there something specific I should look for in the file tree?

        Originally posted by oshunluvr View Post
        Basically, you can safely remove all the kernels except for the one you're booting. Uninstall any large programs like OpenOffice. Delete old log files as none of them will apply anyway after you upgrade. Clear out /tmp.
        OK, how do I remove the kernels? Through Muon? Can I clear out /tmp using Dolphin, or is there a better way?

        Comment


          #5
          Originally posted by Snowhog View Post
          Open a Konsole and type:
          sudo apt-get clean && sudo apt-get autoremove
          This will recover a fare amount of space under / if you have not been performing package cleanup maintenance.
          I try to do this whenever I update packages, and in this case it doesn't clear out any extra space.
          Last edited by jpc2769; Dec 29, 2016, 03:02 AM. Reason: improve clarity

          Comment


            #6
            For the kernels, look at /boot. There should be only two. If there are more than that, remove all but the latest two (assuming you're booting the latest). Likely, if you are actually running autoremove, there will only be two. You can use muon or
            Code:
            sudo apt remove <KERNEL VERSON>
            replcing <KERNEL VERSION> with the version numbers of the kernel, like 4.2.0-44 etc. Doing it this way with apt in the terminal will remove all the kernel specific files for the version number(s) you enter.

            Dolphin will allow you to delete some of /tmp but there will be root owned stuff in there too. Personally, I keep /tmp in RAM so it's cleared at reboot.

            18GB sounds like a lot to me. I have about 15GB and I have a lot of stuff installed including some large games. if you run this command in a terminal you'll get an idea of where your space is being used:

            Code:
            [FONT=monospace][COLOR=#000000]sudo du -h --max-depth=1 /[/COLOR][/FONT]
            I think with 18GB used, you have some unremoved garbage somewhere or a lot of leftover kernels.
            Last edited by oshunluvr; Dec 29, 2016, 08:02 AM.

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              For the kernels, look at /boot. There should be only two. If there are more than that, remove all but the latest two (assuming you're booting the latest). Likely, if you are actually running autoremove, there will only be two. You can use muon or
              Code:
              sudo apt remove <KERNEL VERSON>
              replcing <KERNEL VERSION> with the version numbers of the kernel, like 4.2.0-44 etc. Doing it this way with apt in the terminal will remove all the kernel specific files for the version number(s) you enter.
              Thanks! This is the contents of my /boot folder, it's only 176MB total size so I'm not sure clearing it will give me much space:

              Code:
              [FONT=monospace][COLOR=#000000]drwxr-xr-x  3 root root     4096 Jul 17 09:20 .
              drwxr-xr-x 27 root root     4096 Jul 17 09:18 ..
              -rw-r--r--  1 root root   852910 Jul  9  2013 abi-3.5.0-37-generic
              -rw-r--r--  1 root root  1312643 Feb 26  2016 abi-4.2.0-30-generic
              -rw-r--r--  1 root root  1313640 Jun 24  2016 abi-4.2.0-41-generic
              -rw-r--r--  1 root root  1313590 Jun 29  2016 abi-4.2.0-42-generic
              -rw-r--r--  1 root root   148148 Jul  9  2013 config-3.5.0-37-generic
              -rw-r--r--  1 root root   184888 Feb 26  2016 config-4.2.0-30-generic
              -rw-r--r--  1 root root   184889 Jun 24  2016 config-4.2.0-41-generic
              -rw-r--r--  1 root root   184926 Jun 29  2016 config-4.2.0-42-generic
              drwxr-xr-x  5 root root     4096 Jul 17 09:20 grub
              -rw-r--r--  1 root root 30910627 Nov 25  2013 initrd.img-3.5.0-37-generic
              -rw-r--r--  1 root root 33618235 Feb 27  2016 initrd.img-4.2.0-30-generic
              -rw-r--r--  1 root root 33662748 Jun 28  2016 initrd.img-4.2.0-41-generic
              -rw-r--r--  1 root root 33660740 Jul 17 09:18 initrd.img-4.2.0-42-generic
              -rw-r--r--  1 root root   182704 Aug 27  2015 memtest86+.bin
              -rw-r--r--  1 root root   184380 Aug 27  2015 memtest86+.elf
              -rw-r--r--  1 root root   184840 Aug 27  2015 memtest86+_multiboot.bin
              -rw-------  1 root root  2902836 Jul  9  2013 System.map-3.5.0-37-generic
              -rw-------  1 root root  3744565 Feb 26  2016 System.map-4.2.0-30-generic
              -rw-------  1 root root  3746421 Jun 24  2016 System.map-4.2.0-41-generic
              -rw-------  1 root root  3747027 Jun 29  2016 System.map-4.2.0-42-generic
              -rw-------  1 root root  5130320 Jul  9  2013 vmlinuz-3.5.0-37-generic
              -rw-------  1 root root  6808720 Feb 26  2016 vmlinuz-4.2.0-30-generic
              -rw-------  1 root root  6836336 Jun 24  2016 vmlinuz-4.2.0-41-generic
              -rw-------  1 root root  6838032 Jun 29  2016 vmlinuz-4.2.0-42-generic[/COLOR][/FONT]
              What is the latest version number? Can I safely delete everything that has a lower number than "4.2.0-42"?

              Originally posted by oshunluvr View Post
              Dolphin will allow you to delete some of /tmp but there will be root owned stuff in there too. Personally, I keep /tmp in RAM so it's cleared at reboot.
              Sounds like a good idea! How do I set it up to do this?

              Originally posted by oshunluvr View Post
              18GB sounds like a lot to me. I have about 15GB and I have a lot of stuff installed including some large games. if you run this command in a terminal you'll get an idea of where your space is being used:

              Code:
              [FONT=monospace][COLOR=#000000]sudo du -h --max-depth=1 /[/COLOR][/FONT]
              I think with 18GB used, you have some unremoved garbage somewhere or a lot of leftover kernels.
              When I run that command, this is the output:

              Code:
              [FONT=monospace][COLOR=#000000]13M     /sbin
              8.0K    /mnt
              13M     /root
              11G     /usr
              24M     /etc
              4.0K    /lib64
              113G    /home
              3.7M    /lib32
              2.7G    /var
              13M     /bin
              177M    /boot
              16K     /lost+found
              16K     /.kde
              12M     /run
              456K    /dev
              0       /sys
              4.0K    /cdrom
              4.0K    /srv
              20K     /.config
              23M     /tmp
              1.4G    /opt
              du: cannot access ‘/proc/18569/task/18569/fd/4’: No such file or directory
              du: cannot access ‘/proc/18569/task/18569/fdinfo/4’: No such file or directory
              du: cannot access ‘/proc/18569/fd/3’: No such file or directory
              du: cannot access ‘/proc/18692/task/18692/fd/4’: No such file or directory
              du: cannot access ‘/proc/18692/task/18692/fdinfo/4’: No such file or directory
              du: cannot access ‘/proc/18692/fd/3’: No such file or directory
              du: cannot access ‘/proc/18692/fdinfo/3’: No such file or directory
              0       /proc
              16K     /.local
              932M    /lib
              16K     /media
              129G    /
              [/COLOR][/FONT]

              Comment


                #8
                You have a *lot* of software installed. I run Debian, which is a bit leaner than Kubuntu but my /usr directory is half the size of yours. Second time this morning I got to mention ncdu but that's my tool of choice for figuring out where my disk space went. Terminal program that's fast, light and easy to understand.

                Also, ncdu will let you drill down to figure out exactly where the big files are

                Code:
                ncdu 1.12 ~ Use the arrow keys to navigate, press ? for help                   
                --- / -------------------------------------------------------------------------
                404.1 GiB [##########] /nfsmount
                190.9 GiB [####      ] /mnt 
                5.2 GiB [          ] /usr 
                2.6 GiB [          ] /home
                1.8 GiB [          ] /var
                373.0 MiB [          ] /root
                295.2 MiB [          ] /lib
                171.5 MiB [          ] /opt
                33.8 MiB [          ] /boot
                20.2 MiB [          ] /sbin
                9.4 MiB [          ] /bin
                9.2 MiB [          ] /etc
                9.1 MiB [          ] /run
                5.5 MiB [          ] /libx32
                4.9 MiB [          ] /lib32
                156.0 KiB [          ] /dev
                52.0 KiB [          ] /tmp
                16.0 KiB [          ] /media
                16.0 KiB [          ] /lost+found
                4.0 KiB [          ] /lib64
                4.0 KiB [          ] /srv
                .
                
                0.0   B [          ] /proc
                0.0   B [          ] /sys
                @   0.0   B [          ]  initrd.img.old
                @   0.0   B [          ]  initrd.img
                @   0.0   B [          ]  vmlinuz.old
                @   0.0   B [          ]  vmlinuz
                
                Total disk usage: 605.4 GiB  Apparent size: 605.3 GiB  Items: 957265
                Last edited by wizard10000; Dec 30, 2016, 05:49 AM.
                we see things not as they are, but as we are.
                -- anais nin

                Comment


                  #9
                  jpc2769, I agree only 4 kernels isn't a lot extra. I've seen some people with 20 kernels or more because they never removed any of them. As far as "safely" remove, it's generally considered best practice is to keep the kernel you're booting and the one previous - just in case you mess up the one you're booting. As long as your current kernel is working well for you, you can remove 3.5.0- and 4.2.0-30 as long as you're booting to 4.2.0-42. There are numerous ways to determine which kernel you're using. In the terminal, type uname -r and you'll get the kernel version that's active.

                  Here's my drive usage:
                  Code:
                  [FONT=monospace][COLOR=#000000]  1.7 GiB [#         ] /opt[/COLOR]
                   1.6 GiB [#         ] /var
                  661.0 MiB [          ] /lib
                  114.9 MiB [          ] /boot
                  16.6 MiB [          ] /etc
                  16.1 MiB [          ] /bin
                  12.4 MiB [          ] /root
                  11.2 MiB [          ] /sbin
                  3.9 MiB [          ] /lib32
                  12.0 KiB [          ] /lib64
                  4.0 KiB [          ] /snap
                  @ 4.0 KiB [          ]  initrd.img.old
                  @ 4.0 KiB [          ]  initrd.img
                  @ 4.0 KiB [          ]  vmlinuz.old
                  @ 4.0 KiB [          ]  vmlinuz
                  0.0   B [          ] /mnt
                  0.0   B [          ] /media
                  > 0.0   B [          ] /tmp
                  > 0.0   B [          ] /sys
                  e 0.0   B [          ] /srv
                  > 0.0   B [          ] /shared
                  > 0.0   B [          ] /run
                  > 0.0   B [          ] /proc
                  < 0.0   B [          ]  home
                  > 0.0   B [          ] /dev
                  e 0.0   B [          ] /cdrom
                  > 0.0   B [          ] /backups[/FONT]
                  You must have a lot of large programs like multiple graphic and video editors. I have a ton of stuff installed and I'm still less than 14GB total.

                  As far as /tmp in RAM - assuming you have enough RAM, like 8GB or more - you can move /tmp to RAM by adding this to /etc/fstab:

                  tmpfs /tmp tmpfs noatime,mode=1777,size=16G 0 0

                  I use 16GB. If you leave the size out it will default to half your physical RAM. If you "overflow" /tmpfs it will use swap. You /tmp isn't huge though so this isn't going to help.

                  Clearly, you need to either remove some programs or expand the partition or do a clean install to another partition.
                  Last edited by oshunluvr; Dec 30, 2016, 07:47 AM.

                  Please Read Me

                  Comment


                    #10
                    Thanks everyone for the help! I uninstalled a bunch of old programs that I wasn't using, got rid of the old kernels, and used ncdu to figure out that some files associated with LaTex were taking up a bunch of space as well; clearing all of that stuff out freed up enough room for the upgrade.

                    Again, thanks!

                    Comment


                      #11
                      Originally posted by wizard10000 View Post
                      Second time this morning I got to mention ncdu but that's my tool of choice for figuring out where my disk space went. Terminal program that's fast, light and easy to understand.
                      Neat tool - thanks for the tip! I also like xdiskusage, which is graphical (but lightweight).

                      I also have close to 11GiB in /usr! and could benefit from clearing out old kernels. But I generally ensure my partitions are 25GB or more (and also have a separate home partition).
                      I'd rather be locked out than locked in.

                      Comment

                      Working...
                      X