0

On my Ubuntu server, the root has taken up all the available disk space and I can't expand the partition. I'm trying to remove some old packages to free up some space but I can't because I don't have enough disk space to store the package lists. Anyone know how I can clear some space so I can uninstall packages? Thanks!

root@ubuntu:/home/ubuntu# apt-get remove samba
Reading package lists... Error!
E: Write error - write (28: No space left on device)
E: Write error - write (28: No space left on device)
E: The package lists or status file could not be parsed or opened.
nicnacnic
  • 1
  • 1
  • 1

1 Answers1

3

The trick will be to try to release a minimum of space, so that apt-get can work again.

See here to find out what is taking the place.

If there are user data, move that out first. If not, then you could empty the log files.

That will allow apt to work. Run sudo apt clean to remove downloaded .deb files, sudo apt autoremove to automatically remove packages that are not needed. If sudo apt autoremove did not remove all old kernels, you may want to remove them manually.

It is important to diagnose why your / would have filled. If the cause is not removed, you will quickly hit the problem again.

vanadium
  • 88,010