I tried "apt-get install sagemath" and it started downloading a lot of dependencies. I quickly ran out of disk-space and I interrupted the process. I am now at 300mb of root space left and need to somehow undo the installation. When i try to apt-get purge sagemath I get the following error "E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem."
Now when I try to run that, my remaining disk space gets depleted. I don't know how to undo my mistake at this point, can anyone help me with this?