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:
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.
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
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
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.
As always, removing software can create dependency problems, so you might find yourself limited in what software you can actually remove.