Bloating prevention tips
From openSUSE
Bloating prevention
is a complex task and it should suit your needs and requirements. If you need a Mono, Java or just wish to get and try all the software OpenSUSE can offer than you can skip this part. If you need clean and clear system without the 'brakes' and useless services -> welcome to add your favorite prescriptions to this modest cook-book!
What the bloatware is? It's a software that is installed as a part of a pattern/preset/etc which you don't need and most likely will never use. It could be the result of a wrong/excessive 'Requires:' in the .spec file during compilation. It's just the decision which is simply not yours. Unfortunately openSUSE is well known for it's huge patterns/presets/metapackages which lead to the inevitable bloatware appearance. Example:
~ > sudo zypper in evince Reading installed packages... The following NEW packages are going to be installed: nautilus evince Overall download size: 2.1 M. After the operation, additional 6.9 M will be used. Continue? [YES/no]:
Do I need 'nautilus' when I'm happy with 'Xfe' and 'Pcmanfm'? No, I don't. Let's try to remove the bloat:
> sudo rpm -e nautilus
error: Failed dependencies:
libnautilus-extension.so.1 is needed by (installed) evince-2.22.1.1-26.1.i586
Result of 'excessive' requirements during the build of 'Evince' is in front of your eyes. The truth is that we can remove 'nautilus' without penalties to the 'Evince':
> sudo rpm -e --nodeps nautilus
It's hard to fight against the bloats in openSUSE. You can see that the 'neutral' packages like 'Evince' are 'integrated' into the DE like Gnome. The same story with KDE. But we have the OBS (OpenSUSE Build Service) and can "change our destiny". A lot of amazing projects already compiled there for you. We have a choice. If you don't like the idea to launch gnome-settings-daemon and tweak the 'register' in gconf-editor you can simply install lxappearance from swyear's OBS repo. No need to swallow half-of-Gnome to get a simple gtk2_prefs utility anymore. Sure, it's o'k to vim ~/.gtkrc-2.0 but 81Kb of a disk space is quite reasonable price to make it in GUI. Yes, some options could be adjusted only in 'register' via 'gconf-editor' (like keyboard shortcut to toggle window fullscreen if you're using Gnome's 'metacity' WM). It's hard to implement the "total control" policy over bloated metapackages.
First of all take a look at the
/etc/zypp/locks
file. It's your main weapon in this holy war and the only way to proclaim "The Unanimous Declaration". Here's an example:
type: package match_type: exact case_sensitive: on solvable_name: gnome-panel type: package match_type: exact case_sensitive: on solvable_name: opensuse-manual_en type: package match_type: exact case_sensitive: on solvable_name: yast2-control-center-gnome type: package match_type: exact case_sensitive: on solvable_name: ghostscript-omni type: package match_type: exact case_sensitive: on solvable_name: gnome2-user-docs type: package match_type: exact case_sensitive: on solvable_name: Enlightenment_DR17-cvs-core-metapackage type: package match_type: exact case_sensitive: on solvable_name: freetype2 type: package match_type: exact case_sensitive: on solvable_name: pulseaudio-esound-compat type: package match_type: exact case_sensitive: on solvable_name: libpulsecore4 type: package match_type: exact case_sensitive: on solvable_name: pulseaudio type: package match_type: exact case_sensitive: on solvable_name: esound type: package match_type: exact case_sensitive: on solvable_name: qemu type: package match_type: exact case_sensitive: on solvable_name: gimp-branding-upstream type: patch match_type: exact case_sensitive: on solvable_name: esound
It works straight forward. The package which should not be modified will remain untouched during update/upgrade process or you'll receive an allert and have an option to reconsider the case. If the package is not installed - it'll remain uninstalled. Above you can see the price I paid to get rid from pulseaudio (using the native 'esound' and happy with it) and some documents/readme's I never looked into plus some 'extras'. Another MUST is to use --no-recommends option each and every time you're using zypper (assume it's clear that there's no way to keep your system clean if you're using GUI for package management). man zypper helps you to discover the capabilities of a command line package management.
The other thing which has a significant impact on PC's performance is Mono with all apps and components depending on it (yes, we're talking about indexing services based on Mono). Use them only if you 100% sure that you've got no better solutions around. 'Estickies' is a replacement for the 'tomboy', 'tracker' works much better than 'beagle' (heh, we don't have a 'tracker' app for 11.0 yet but OBS is working!). Here's the example:
> sudo zypper in tomboy
Reading installed packages...
Problem: tomboy-0.10.2-6.1.i586 requires gnome-panel, but this requirement cannot be provided
uninstallable providers: gnome-panel-2.22.1.1-30.1.i586[11.0_oss]
gnome-panel-2.22.1.1-30.1.i586[11.0_local_iso_1]
Solution 1: do not forbid installation of gnome-panel-2.22.1.1-30.1.i586
Solution 2: do not forbid installation of gnome-panel-2.22.1.1-30.1.i586
Solution 3: do not ask to install a solvable providing tomboy
Solution 4: Ignore some dependencies of tomboy
Choose from above solutions by number or cancel [1/2/3/4/C]: 4
Resolving dependencies...
The following NEW packages are going to be installed:
mono-core galago-sharp ndesk-dbus-glib ndesk-dbus gtkspell galago-daemon gmime-sharp
libgluezilla0 gtk-sharp2 libgmime-2_0-3 libgalago libgdiplus0 glib-sharp2 tomboy gmime
Overall download size: 13.6 M. After the operation, additional 46.4 M will be used.
Continue? [YES/no]: n
That's why it's very important to select and use the components which has a minimum dependencies and operates in a native environment.
Bloatware with Qt/KDE applications are the same as with the GTK ones. The same tight 'integration' into the DE which limits our selection options. It's a well known disease of openSUSE and other distributions - huge metapackages/patterns/presets. The cure also well known. Make a small packages. Package every single component and be very careful with the dependencies. In our case this 'cure' will lead to the huge expenses and suppose that it'd be less painful to rebuild from scratch all build/distribution schema of openSUSE. It's a big question where we gain the real benefits from such 'rebuild'. May be nowhere. May be the price is much higher than the possible benefits. May be such rebuild will lead only to the losses. Who knows. One thing is clear: Linux distros without 'metapackages' has it's audience. And a lot of people (not the newbies, but experienced ones) are disappointed with the 'bloats' and switch to the alternatives. The fun is that 'switchers' sooner or later could meet the requirement to get/build a stable production environment and have no other options but return back to the SUSE.
We spent a lot of time and efforts to create Enlightenment LiveCD. Monthly updates allow us to improve the content and remove the possible 'bloats' from the beginning. If you have installed the openSUSE from that disk the only things left is to pay attention when you get something new or upgrade the system.
The clean-up could be performed in the following way:
- check the state of a running system by using
pstree
or
pstree -p
command in terminal. Try to figure out the sense of all running processes, find the way they're started, who is the 'owner' of a process and revise your 'startup' files along with the system services. Remove the packages which contain services you don't need. Before the removal take a look at the dependencies. If it's safe remove them too.
Example of a "hunt for the Red October". We browsed the list of running processes and found the one we wish to remove - 'gconfd-2':
> pstree ***** ├─gconfd-2 *****
searching the information about the process
> ps aux | grep gconfd-2 | grep -v grep sda 3179 0.0 0.2 5668 3724 ? S 03:03 0:00 /usr/lib/GConf/2/gconfd-2 14
now looking at the package and it's dependencies
> rpm -qiR `rpm -qf /usr/lib/GConf/2/gconfd-2` Name : gconf2 Relocations: (not relocatable) Version : 2.22.0 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany Release : 28.1 Build Date: Fri 06 Jun 2008 08:44:36 PM EDT Install Date: Thu 03 Jul 2008 06:05:33 PM EDT Build Host: xenakis.suse.de Group : System/GUI/GNOME Source RPM: gconf2-2.22.0-28.1.src.rpm Size : 774992 License: GPL v2 or later; LGPL v2.1 or later Signature : DSA/SHA1, Fri 06 Jun 2008 08:48:42 PM EDT, Key ID a84edae89c800aca Packager : http://bugs.opensuse.org URL : http://www.gnome.org/ Summary : The GNOME 2.x Desktop Configuration Database System Description : GConf, the GNOME configuration database. It is used by the GNOME 2.x Desktop platform. Authors: -------- Havoc Pennington <hp@redhat.com> Distribution: openSUSE 11.0 (i586) /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/ln /bin/chmod gconf2-lang = 2.22.0 /bin/sh /bin/sh /bin/sh rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 /bin/bash libORBit-2.so.0 libX11.so.6 libXau.so.6 libXrender.so.1 libatk-1.0.so.0 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4) libcairo.so.2 libdl.so.2 libexpat.so.1 libfontconfig.so.1 libfreetype.so.6 libgconf-2.so.4 libgdk-x11-2.0.so.0 libgdk_pixbuf-2.0.so.0 libglib-2.0.so.0 libglitz.so.1 libgmodule-2.0.so.0 libgobject-2.0.so.0 libgthread-2.0.so.0 libgtk-x11-2.0.so.0 libm.so.6 libpango-1.0.so.0 libpangocairo-1.0.so.0 libpcre.so.0 libpng12.so.0 libpthread.so.0 libpthread.so.0(GLIBC_2.0) librt.so.1 libxcb-render-util.so.0 libxcb-render.so.0 libxcb-xlib.so.0 libxcb.so.1 libxml2.so.2 libz.so.1 rpmlib(PayloadIsLzma) <= 4.4.2-1
Digg through all the dependencies to make an estimation of what could/should be removed. Assume that it's safe to remove gconf2-branding-openSUSE, gconf-editor and gnome-settings-daemon. Check the assumption:
> rpm -e --test gconf2-branding-openSUSE gconf-editor gnome-settings-daemon
Remove if no errors appear:
> sudo rpm -e gconf2-branding-openSUSE gconf-editor gnome-settings-daemon
- check all system services
chkconfig -l
look through the ones which are 'On' for your runlevel:
chkconfig -l | grep \:on
disable those you don't need:
chkconfig SERVICE_YOU_DON'T_NEED off
find who is the 'parent' of the services you don't need or has no wish to use in the nearest future and remove the package if it's possible (BE CAREFUL!!! Look what you're typing! You're on the bomb field, solder!):
rpm -e `rpm -qf /etc/init.d/SERVICE_YOU_DON'T_NEED `
- range all installed packages by size and 'kill the fat cats'. You will find some huge packages which might be useless for you. 'Kill'em all'.
As you can see the cleanup operation is quite time consuming, require some patience and if you've got a plenty disk space it makes sense just 'Turn Off' the services from the autostart/autolaunch routines. Use chkconfig and look through your profile, bashrc and other startup files as well. In general it's not so bad to vim the following:
/etc/profile.local /etc/bash.bashrc.local ~/.bashrc (or any other the *rc file for your shell) ~/.profile plus the startup files of you WM/DE
If you afraid or feel uncertain about removal the 'bloated' components -> install the system and train your skills in QEmu, VirtualBox, VMWare, ...
Remember: only proper /etc/zypp/locks file can keep your fortress from constant massive 'bloats'! Clean your system, reboot, test all you've got and if you're happy -> adjust /etc/zypp/locks. If you're using 'yum', 'smart' or other package manager - find the analogue of the 'lock' file and proceed the adjustments there.
Seems like a nice idea to develop the application capable to analyze your system and prepare several patterns for a cleanup to increase the performance.

