no space in disk; sudo apt-get clean not working
Solution 1
Doing sudo apt-get clean
will remove all the local copy of the packages that you may have downloaded when doing an installation. This will almost empty the /var/cache/apt/archives
directory.
But this is not the only place where a lot of space can be wasted, without any importance order:
/var/log
which contains most of the log for your system. You may want to delete the old logs. You may want also to tweak the configuration of the logrotation program to reduce the amount of logs saved and archived. In the file/etc/logrotate.conf
and all the files present under/etc/logrotate.d
look for the line beginning byrotation
. The number after means how many logs are kept on the system./tmp
,/var/tmp
and any othertmp
directories found on the system.- Your own Trash folder may be full of items that can be purged.
- Cache of your web browser: usually, in the preferences settings of any web browser, there is a place where you can define the maximum size it can occupy and also to do a purge of it (removing history, old downloaded files, ...)
- In your home directory, there is a
Download
folder, maybe it is full of things you don't need anymore and that can be safely deleted.
And these are only the few general things I'm thinking about. Depending on how you use your system (applications installed and so on), there may be some other directories to check and to empty.
Solution 2
If you want to clean more space , you can use bleachbit,:)
you can install it with sudo apt-get install bleachbit
and also from software-center.
after installing it , you can launch it from System -> Bleachbit(root) . so that you can clear maximum of useless data.
Solution 3
As is common with many of the commands you can run from a terminal, apt-get clean will only give a response if there is an error.
If the command completes successfully then you will just be returned to the prompt.
hob@hob:~$ sudo apt-get clean
[sudo] password for hob:
hob@hob:~$
Related videos on Youtube
Prakash Tripathi
Updated on September 18, 2022Comments
-
Prakash Tripathi over 1 year
I was playing with Mutex to understand if it can be used to know whether Microsoft Word is currently running in a computer with logged in user session. I tried below examples but none of them worked.
Ex1:
using (Mutex mutex = new Mutex(false, "WINWORD.exe")) { if (mutex.WaitOne(0, false)) { Console.WriteLine("Not running"); //Always printing } else { Console.WriteLine("Already running"); } }
Ex2:
bool createdNew; Mutex m = new Mutex(false, "WINWORD.exe", out createdNew); if (createdNew) { Console.WriteLine("Not running"); //Always printing } else { Console.WriteLine("Already running"); }
In both the example, it's printing "Not running", although I can see Word in running in my computer. Is it a limitation of Mutex? Or am I missing something here?
-
23 93 26 35 19 57 3 89 over 10 yearsIf you are getting disk full errors when trying to run an apt update, cleaning a bit of space with apt-get autoclean, or indeed any tool, is only going to be a temp measure. Please run df -h from a terminal and post the output as an edit to the question if you want some opinions on the disk space.
-
Damien_The_Unbeliever about 8 yearsBesides this being the wrong tool for the job (as nvoit's answer indicates), you also need to consider what question you actually need answering. Do you care if Word is running on this machine, or care if Word is running in the same session? Windows does support having multiple users logged in with programs running, but when you're logged in as user A, finding out that Word is running for user B a) requires quite a lot of permissions and b) probably doesn't help you solve your overall problem (which is what, by the way?)
-
Prakash Tripathi about 8 yearsHi Damien, I care If word is running in the same session. Updated the question as well.
-
Prakash Tripathi about 8 yearsHi Damien, I hope that after updating title you would revert you vote down.
-
Damien_The_Unbeliever about 8 yearsI haven't voted on your question at all, yet.
-
-
Prakash Tripathi about 8 yearsThanks nvoigt for the answer. So you mean that I can use Mutex to check if another instance of my own program (same exe) is running or not right? To check if Word is already running, I should be running code of Word at the same time. Please correct me if I am wrong.
-
nvoigt about 8 yearsYou can only check, if a mutex is already in use. So when you have access to the code of both programs, you could use a mutex to tell when one of them is running. As Word is not your product and you cannot make Microsoft change their code to use a mutex of your choice, there is no way to check if Word is running with a mutex.