LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-26-2007, 04:59 PM   #1
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Rep: Reputation: 31
How to free space in linux


Hello,
After nearly 6 months using Linux the OS gets extremely rich as you have all the programs you need, most programs that you compile from source will not have any dependency problems, and gradually your desktop becomes very good looking

on the other hand all this comes on the expense of your disk space.
I have a 7 GB drive with Linux on it and this morning kwikdisk showed 444 kb of free space available and this was not the first time

moved some programs installed in the home folder and deleted my mailbox and that gave me about 170 MB

now I would like to know how to delete unwanted programs and their dependencies, the useless files created by the OS (like the hidden folders "found*" in windows), and any other means for providing more free space

and another little question: how much space is enough for a Linux system?
 
Old 09-26-2007, 05:04 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by AGazzaz View Post
and another little question: how much space is enough for a Linux system?
Depends on your needs. Damn Small Linux is 50MB on disc. I'm sure there are embedded devices that run on less...

You might check your /boot directory for old kernels and the /var/log directory to see if any log files have gotten out of control.
 
Old 09-26-2007, 06:49 PM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
use the find command to find files of a specified size. and the du command to check for disk usage.
 
Old 09-26-2007, 07:40 PM   #4
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
One more option: get any packet manager, they vary depending on your distro, examine what you have and prune what you don't need to have.
 
Old 09-26-2007, 07:46 PM   #5
-Ay-
LQ Newbie
 
Registered: Jun 2007
Distribution: LFS 6.2 and Debian Lenny
Posts: 6

Rep: Reputation: 0
If you use a Debian based distro, deborphan, debfoster and localepurge will help clear away some space. deborphan (or orphaner for teh gui-ish version) looks for orphaned libraries and purges them through apt. However it sees libraries used as dependencies for compiled programs as orphans. So if you compile a lot of packages, be careful. debfoster goes through some of your packages asking if you wish to keep them. If you don't, it removes not only that package, but the packages that it's keeping installed. If you answer yes, it won't ask you about that package again. Localepurge asks for your locale, and then deletes man pages and other documentation not in that locale, and it runs everytime after apt. Using those tools, I kept my install down under 2 GB.
 
Old 09-26-2007, 08:05 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Try this first command - it will list your major directories. As mentioned above, /var is probably one to look for (ignore the first line). Pick a bad guy, then try the second command, using that directory (say /var)
Code:
du / -x --max-depth=1 | sort -nr 
du /<dir-name here> | sort -nr | head -n 20
Each command will take a while, so be patient. If it is /var/log that shows up, check that logrotate is active.
 
Old 09-27-2007, 10:43 AM   #7
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Original Poster
Rep: Reputation: 31
I did something wrong!

Thank you all for your replies,

@pljvaldez
The distros I use are at least a CD if not more (openSuSE and mandriva) and the /var/log size is 17 MB


The first thing I did was trying orphaner as -Ay- recommended
I showed only 5 files and since I do not know which one do I need I left them all

Then I found out that syg00 command doing the same job that FSview does

/usr folder was 3.5 GB
/var folder was ~380 MB

I deleted something from someplace (I really do not remember but most likely from /var because currently it is 244 MB) after a while I found 3 games that I never played when I tried to remove them from synaptic I got the following error message:

Code:
E: Archive directory /var/cache/apt/archives/partial is missing.
E: Archive directory /var/cache/apt/archives/partial is missing.
E: Archive directory /var/cache/apt/archives/partial is missing.
E: Could not open lock file /var/cache/apt/archives/lock - open (2 No such file or directory)
E: Unable to lock the download directory
Well after this what can I do?

another thing the largest folder inside those folders is /var/lib and /usr/lib

what can I do to these folders?

Thanks again for your help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Free space wiping in Linux? IamI Linux - Software 15 01-30-2012 09:03 AM
Help removing free space to create Raw free space nightmare55 Linux - Newbie 11 10-01-2009 03:07 AM
wipe free space with Linux? bigrobot Linux - Software 2 02-19-2005 04:08 AM
Not enough free space on hard drive with 50g of free space??? auoq SUSE / openSUSE 5 10-13-2004 08:21 PM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration