Assumptions:
This HOWTO assume you have the following:
Pure Debian.
Standard install of Stable or Testing.
(Most of this HOWTO will however apply to most Debian based systems)
Before you start:
A standard Debian install contains a huge number of packages in order to provide a good system for everyone. But for most users a lot of these packages will never be used and they end up just taking up space on your hard-drive. So if you have limited space on your HD, and you don't want to embark on a minimal reinstall, it is a good idea to remove the things you don't need. But before you start to randomly remove packages you should try to define what you actually use your system for. Then you should go through your menu taking notice of what applications you never use. Then it's time to prepare the leaning of your system. First make sure you have the latest package list:
Open a terminal, su to root (At the prompt type su, hit enter, type your root password, it enter), then:
Code: Select all
# apt-get update
Code: Select all
# updatedb
Code: Select all
# apt-get install deborphan rcconf synaptic
First we want to remove any unused locales and system documents in languages we don't use. The tool for that is 'Localepurge'. Note that when you install 'Localepurge' it will start right away:
Code: Select all
# apt-get install localepurge
Removing unwanted software:
Now we will start the one task that will have the most impact on our system; removing unwanted software. The perfect tool for this is the 'Synaptic' package manager. You can start it either from the menu or from the commandline, and when it's up and running, click the 'Status' button and select the 'installed' option. You then get a complete list, in alphabetical order, of the packages that is installed on our system. Left-click on an entry and select 'Mark for complete removal'. (This is the equivalent 'to apt-get remove –purge package').
Important!!
If the selected package has any dependencies it will present you with a list. READ IT CAREFULLY! Some packages that seem trivial has some very DANGEROUS dependencies like your kernel package, entire desktop environments or other necessities. If you don't know what all of the dependencies are, leave the package alone for now.
Now it's just a matter of going through the list of installed packages and marking the ones you want to remove. When you are all done you click the 'Apply' button, review the list presented by Synaptic and confirm by hitting 'Apply' again. It will then start the remove process. Please note that this process can take quite some time depending on the number of packages you remove.
When it's done, do an 'updatedb' again for good measure.
Orphaned libraries:
Orphaned libraries are libs that has no packages depending on them. Orphaned libs serves no purpose and can safely be removed. For details see deborphan's man page.
Code: Select all
# orphaner
A word of caution: If you have installed a lot of programs from source you should be a bit careful with this as it might break something since your system is not aware of these programs.
Memory:
Another limited resource is memory. Keeping as much available memory as possible means a faster, more efficient system. A standard install of pretty much every mainstream Linux distro installs deamons and services that runs constantly in the background, using valuable memory. But most users don't need all of the default services running so it's a good idea to only have what you need running. The tool of choice is
Code: Select all
# rcconf
Virtual consoles (gettys):
Debian enables six virtual consoles as default but most people doesn't need that many. Unfortunately virtual consoles hog memory so it's a good thing to disable a few that you don't need. As root open the file /etc/inittab in your favorite editor, then look for:
Add a # in the beginning of the ones you want to disable, starting with the highest one. This is called “comment out” and make the system ignore what comes after the #. In the above example getty 4, 5 and 6 is disabled. Don't forget to save it when you are done (did you remember to back up the original?)# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
# 4:23:respawn:/sbin/getty 38400 tty4
# 5:23:respawn:/sbin/getty 38400 tty5
# 6:23:respawn:/sbin/getty 38400 tty6
The Kernel:
The kernels provided by Debian comes with a lot of options enabled. A very good way to save a few bytes is to recompile it with only the things you need enabled. See http://forums.debian.net/viewtopic.php?t=4468 for a kernel compile howto.
Desktop Environment:
If you really need to run a light system it might be a good idea to drop the big desktop environments like KDE or GNOME and opt for a lighter Window Manager. A good place to 'shop' for a WM is http://www.xwinman.org/. Don't be afraid of trying some of them out. They will usually happily coexist with KDE and/ or GNOME and take up almost no space at all on your harddrive. And a bonus is that playing around with various window managers is great fun.
Enjoy
Tina
PS: Got a neat trick on increasing system efficiency? Add to the thread!