Sunday 28 February 2016

0

How to Free Up Space in Linux

I had a long, tiring day today.


As some of you may know, I finally installed Ubuntu alongside Windows in January and also upgraded to Windows 10 recently. I really like Ubuntu and started hating Windows which takes so long to boot up and ages to install updates.

Today I tried installing LaTeX-related packages on my Ubuntu partition as it was required for a coursework, but ended up running out of space. Before this I would usually write LaTeX documents on my Windows partition, but since I've been using Ubuntu a lot more recently, I thought it would be convenient to be able to do everything in my Ubuntu machine.

I guess it was my fault. At the very beginning I only allocated 26.8 GB for my Ubuntu partition. God knows how much space I was supposed to allocate to it though! As a result my machine was unable to boot at all. I could only see a blank screen. I panicked and tried to find a way to give my Ubuntu partition more space, which isn't possible since I have 4 partitions already. Damn you Lenovo! I suppose I could back it up on a DVD or something and then reinstall, but I don't have a free DVD with me right now and I can't wait that long to fix this!


My biggest concern was that I was doing my other coursework in my Ubuntu machine, and I was stupid enough not to push it to GitLab or make any backup at all. I don't think I'll be able to redo it before the deadline as I have to run "experiments" and collect data, which took me two days to do and I still have a ton of work left. Now that I can't log in to my Ubuntu machine I have no access to it and I don't wanna redo the coursework!!

Fortunately though it turned out that I was able to access the files on my Ubuntu partition from my Windows machine, and I had to delete a ton of unnecessary files. After that I could boot up Ubuntu but it keeps complaining I'm running out of space and I have no idea what to do.

I ended up removing a lot of files off Dropbox, university work, and some packages that I installed for God knows what. I was still curious as to reallocate more space into Ubuntu and spent hours trying out so many different ways I found on the internet to no avail.


I gave up and logged in to Ubuntu in the hope of being able to uninstall more irrelevant stuff to free up space. I then found two useful packages that I installed (in order to get more stuff uninstalled, yeah, sounds about right). Let me share my findings with you.

1. Synaptic Package Manager


Synaptic Package Manager is able to give a comprehensive list of all possible Linux packages out there and tell you which ones you have installed, as well as help you completely remove them.

To install: sudo apt-get install synaptic

2. BleachBit


BleachBit can help you delete temp files, log files, cache, trash, and all that stuff.

To install: sudo apt-get install bleachbit

Those two guys completely saved my life. Oh, and this guide too: How to remove everything related to TeX Live.

In the end I am able to get 11.1 GB free space in my Ubuntu partition. I was unable to install anything LaTeX related though. This means I'll have to switch to Windows every now and then to type up my coursework and dissertation in LaTeX. Or maybe I'll back up my Ubuntu and resize my partition.

... Most likely the former.

I hope you find this guide helpful, if not a little entertaining. I had a miserable day. I hope this guide can solve your problem before your day gets too miserable. Or at least I'll let this cute dancing potato cheer you up a bit.

0 comments:

Post a Comment