Ubuntu upgrade failed because root partition is full
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ubuntu upgrade failed because root partition is full
I forgot to clear out my old kernels from my server as it was updating and now the root partition is full. I got halfway through an upgrade and it stopped because it ran out of space. How do I fix this?
ubuntu@ip-172-31-0-59:/boot$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-headers-4.4.0-79-generic : Depends: linux-headers-4.4.0-79 but it is not installed
E: Unmet dependencies. Try using -f.
Code:
Could not open file /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_xenial-security_main_source_Sources.xz - open (28: No space left on device) [IP: 91.***.**.*** **]
Code:
ubuntu@ip-172-31-0-59:/boot$ ls -l
total 46768
-rw-r--r-- 1 root root 1245659 Mar 31 11:14 abi-4.4.0-72-generic
-rw-r--r-- 1 root root 190236 Mar 31 11:14 config-4.4.0-72-generic
drwxr-xr-x 5 root root 4096 Jun 18 21:01 grub
-rw-r--r-- 1 root root 35474648 Jun 18 21:01 initrd.img-4.4.0-72-generic
-rw------- 1 root root 3882277 Mar 31 11:14 System.map-4.4.0-72-generic
-rw------- 1 root root 7083248 Mar 31 11:14 vmlinuz-4.4.0-72-generic
It's searching the entire file system.
Wait a few more...to completion.
Okay I'm running it again right now.
I did notice one other thing, I found so many files under /var/tmp that it wouldn't even list the files in the folder, it just hung when I tried to run "ls" on it. I was able to delete some using the -U parameter to return them unordered and that freed up enough nodes to complete the autoremove function and left me with about 10,000 nodes available. I came back to it a few hours later and once again there were 0 nodes available, something ate them up. I have since shut down Apache2 since it's just a personal server but I'm wondering what else I can try here.
I'll post the results of that command after it completes.
Yes, it's a 'runaway' something. Here's some ideas for 'catching' it, from this search:
linux record what process creates a file
lsof, inotify, audit, ... Even chmod on the dir so pgm will choke&die (with error msg hopefully, tho chmod could/would break other things!)
You can save a LOT of time by starting the du /var/tmp (instead of / IF that's where they are)
Puzzle heaven Best wishes! Let us know, esp. how reSolved, for future searchers!
I think a clean install would be your most realistic option in any case whatever you use. Simply think how many hours you may waste on a fix when a reinstall can be done in how long? And its pretty easy.
Unless you just wanna try it for the project, anyhow.
I did notice one other thing, I found so many files under /var/tmp that it wouldn't even list the files in the folder, it just hung when I tried to run "ls" on it.
Where they all Apache ?.
You're in a bit of an awkward situation - too big to list, and deleting will also take "forever". Either will also consume a lot of slab space for the dentry and inode caches. I would just delete everything in /var/tmp - there should be nothing of consequence there, but there might be; it's (supposedly) for less transient data.
Maybe even give it a small partition of its own - just to see easily what goes in there.
What's the easiest way to delete all files in a folder without doing a recursive "rm?" It seems to hang if I just try and delete them all, this is what I've been running every few minutes:
Code:
sudo ls -U | head -5000 | sudo xargs -d '\n' rm -rf --
That deletes the files without ordering them first.
Here is the result of deleting and then running a nodes check about every 10 minutes afterwards, the count is good but then slowly goes back towards zero.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.