Full disk after apt-get upgrade


#1

I have this embarrassing issue that during

$ sudo apt-get upgrade

the disk runs out of space.

I would free some space, however, after removing a few files (based on How do I clear up disk space after it’s full?), I realized I have to remove some packages to free space (because nothing else really takes up much space at all in my workspace). I can’t however run

$ sudo apt-get remove package

because apt is left with missing dependencies after the failed run of upgrade and keeps telling me to fix my dependencies first what again fails because I’m out of disk space and I’m stuck here.

Any ideas how I can save myself from here?

Related: my ubuntu installation seems to require quite some disk space for packages and functionality I never use on cloud9 (the apt-get upgrade resulted in the installation of chromium-browser). Is there a way to keep my os packages updated and lean in order to stay within the disk space limits long-term?


Disk quota reached
Workspace's disk space is full (5GB), but "ncdu" on "/home/ubuntu" shows total usage of 2.16GB – where are the other 3GB?
Terminal asks for password for ubuntu user on sudo
C9 NPM nospc error when trying to install mongoose
#2

Short answer: If you need to update any packages, you must update them individually.

Long answer: Because Cloud9 workspaces come from Docker images, the disk space used up is actually measuring files that have been added or changed. Running sudo apt-get upgrade causes lots of files and packages to be downloaded, updated, and changed from the base image of Cloud9 workspaces, hence filling up lots of space.

Additionally, Cloud9 workspaces are Ubuntu images but don’t require a lot of packages and programs that come with a standard Ubuntu installation (think of all the GUI programs you have there). Running upgrade downloads lots of these programs into your workspace when you don’t need them.

If you want a way of updating a bunch of packages at once, you could make a shell script that would update several packages you know need to be kept up to date.


Disk shows more than used
#3

Thanks, that is really helpful information.

Now that I am in this mess, any idea how to fix the broken state of my apt-get? Atm I can’t move in either direction.

EDIT: As measure of last resort, I could start a fresh workspace and copy my relevant files there, I guess.


Workspace's disk space is full (5GB), but "ncdu" on "/home/ubuntu" shows total usage of 2.16GB – where are the other 3GB?
#4

I think this method of clearing out stuff from tmp will work but give it a look.


#5

So, just to clarify, the general guidance is to avoid apt-get update && apt-get upgrade ?

I new to using Cloud9, but I presume given the workspaces are based on locked down Docker containers there aren’t the same concerns over security upgrades etc that you might encounter on a normal VM?

If you could just give a bit of clarity or point me to the docs regarding what us users need to do with regards to managing our workspaces in terms of security/updates etc that would be much appreciated.

This might seem like an odd question but I’m coming from a history of managing my own servers so I’m not familiar on how your setup works in detail just yet.

Thanks.