Score:0

Trying to clean disk space, but can't remove packages

ru flag

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.
Score:3
cn flag

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.

nicnacnic avatar
ru flag
Thank you, it was actually some pm2 logs taking up 8Gb on my 16Gb SD card!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.