Freeing Up Disk Space


After using SUSE Linux for some time, you might find that the disk begins to get full. You can keep an eye on disk usage using the following command at the command-line shell:

df –h

This will show the free space in terms of megabytes or gigabytes, and also expressed as a percentage figure.

If the disk does start to get full, there are a number of measures you can take to free up space.

Emptying the /tmp Folder

An easy way to regain disk space is to empty the /tmp folder. As with the Windows operating system, this is the folder in which temporary data is stored. Some applications clean up after themselves, but others don't, leaving behind many megabytes of detritus.

Because the /tmp folder is accessed practically every second the system is up and running, to empty it safely, it's necessary to switch to run level 1. This ensures few other programs are running and avoids the risk of deleting data that is in use. The following series of commands will switch to run level 1, empty the /tmp folder, and then reboot afterwards:

On a similar theme, don't forget to empty the desktop Trash. This can hold many megabytes of old data.

su –  [enter root password]  init 1  [log in as root and enter the password]  rm –rf /tmp/*  reboot

Empting the Cache of RPM Update Files

You might also choose to clear out the YaST2 cache of RPM update files. On a system that has been very frequently updated, this can free up many megabytes (possibly gigabytes) of space. However, as demonstrated earlier in this chapter when we looked at compiling a kernel, this cache can actually prove useful at times. Emptying it should be weighed against its potential advantages.

You can empty the cache by typing the following command as root:

rm –f /var/lib/YaST2/you/mnt/i386/update/9.1/rpm/i586/*.rpm

Removing Unused Software

If you still need disk space, consider removing unused programs. As you've learned, you manage software through YaST2's Install and Remove Software tool (select K menu ® Control Center, click the YaST2 Modules icon, click the Software icon, and then click Install and Remove Software).

The best way of managing software is to switch to Selection view, by selecting Selection from the Filter drop-down list. This lets you see which groups of programs you have installed, rather than viewing individual titles, which in themselves might not free up too much space. In Selection view, you might choose to deselect the Games group, for example. This will remove all the desktop games on the system. Alternatively, if you don't use any office programs on your system, you might choose to deselect the Office group.

Caution 

As always, removing software can create dependency problems, so you might find yourself limited in what software you can actually remove.




Beginning SUSE Linux from Novice to Professional
Beginning SUSE Linux: From Novice to Professional
ISBN: 1590594584
EAN: 2147483647
Year: 2005
Pages: 293
Authors: Keir Thomas

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net