Ubuntu Cleanup

I’ve recently installed Ubuntu 12.04 Long Term Support (LTS). The main advantage of a LTS distribution is that once you clean it up, it stays like that for two years.

Unity

First step is to switch your desktop to LXDE, unless you like Unity or Gnome the Third. The recommended way is to install Lubuntu, in my case I will install LXDE on top of regular Unity. If you already have regular Ubuntu installed, it would be too much trouble to start downloading and installing everything. Also keep in mind that Lubuntu is not a LTS release, and the applications installed are different, for example Goolge Chromium instead of Mozilla Firefox, or Gnumeric instead of LibreOffice Calc. LXDE is such a small desktop component, it might be a better idea to chose your distro based on the applications it provides and switch the default desktop environment to LXDE.

$ sudo apt-get install lxde

Logout and login again, this time in a LXDE session and start cleaning up all the processes that don’t make sense. Here are some of them:

avahi

Avahi is a zeroconf implementation and a system for multicast DNS/DNS-SD service discovery. Its job is to assign an IP address on an interface (RFC 3927) if a DHCP server is not present on the network, or if a static address was not configured. It allows you to plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to or find files being shared. Right… the only reason I start my computer every day is to find files being shared on my local network!

The only way to disable avahi is to modify several configuration files in /etc directory as follows:

/etc/init/avahi-daemon.conf – add the word never below:

start on (never
	 and filesystem
	  and started dbus)
stop on stopping dbus

/etc/network/if-up.d/avahi-autoipd – add an exit 0 as soon as the script starts

#!/bin/sh
exit 0

/etc/network/if-up.d/avahi-daemon – add an exit 0 as soon as the script starts

#!/bin/sh
exit 0

Zeitgeist

Zeitgeist is a service which logs the users’s activities and events, anywhere from files opened to websites visited and conversations – for sure is not needed on my computer. However, they say Gnome3 and Unity cannot function without it – piece of garbage if you are to ask me!

Start by disabling the access to the database:

$ chmod -rw ~/.local/share/zeitgeist/activity.sqlite

Restart zeitgeist, it should fail miserably:

$ zeitgeist-daemon —-replace
[21:15:40.425853 WARNING] Could not access the database file.
Please check the permissions of file /home/user/.local/share/zeitgeist/activity.sqlite.

Purge all zeitgeist packages from the system:

$ dpkg -l |grep zeit
ii libzeitgeist-1.0-1 0.3.18-1ubuntu1 library to access Zeitgeist – shared library
ii python-zeitgeist 0.9.0-1ubuntu1 event logging framework – Python bindings
ii rhythmbox-plugin-zeitgeist 2.96-0ubuntu4.2 zeitgeist plugin for rhythmbox music player
ii zeitgeist 0.9.0-1ubuntu1 event logging framework
ii zeitgeist-core 0.9.0-1ubuntu1 event logging framework – engine
ii zeitgeist-datahub 0.8.2-1ubuntu2 event logging framework – passive logging daemon

$ sudo apt-get purge libzeitgeist-1.0-1 python-zeitgeist rhythmbox-plugin-zeitgeist zeitgeist zeitgeist-core zeitgeist-datahub

ubuntuone-syncd

Ubuntu One is a file syncing service similar to Dropbox. It takes a lot of RAM memory and generates a lot of traffic on the network. Even if you didn’t sign up for the service, the thing is still loaded and running. Get rid of it if you don’t really need it.

Do a dpkg -l | grep ubuntuone and purge all ubuntuone packages from the system.

$ sudo apt-get purge gir1.2-ubuntuoneui-3.0 libubuntuoneui-3.0-1 python-ubuntuone-client python-ubuntuone-control-panel python-ubuntuone-storageprotocol rhythmbox-ubuntuone ubuntuone-client ubuntuone-client-gnome ubuntuone-control-panel ubuntuone-couch ubuntuone-installer

Also, remove the storage in the local directory:

$ rm -fr ~/.local/share/ubuntuone ~/.config/ubuntuone ~/.cache/ubuntuone/

Like all the other processes discussed here, ubuntuone-syncd will be gone after the next reboot.

whoopsie

This is Ubuntu error reporting daemon. It also takes a lot of RAM memory, and occasionally crashes trying to send reports to Canonical.

$ sudo apt-get purge whoopsie

cupsd

The good old UNIX printing service – if you are not using a printer, just remove it.

$ sudo apt-get purge cups

modem-manager

Probably my desktop weights more than 20lb, not to mention the monitor, the desk and the chair. It is not a mobile station, why should I run modem-manager? If there is a remote use case for something, you can depend on Canonical to enable it by default.

$ sudo apt-get purge modemmanager

bluetoothd

Looking through my process list with ps aux I run into bluetoothd. Unfortunately I don’t have one of those wireless keyboards/mouse and I don’t really care about synchronizing portables, so off it goes:

$ sudo apt-get purge gnome-bluetooth

You also need to edit /etc/modprobe.d/blacklist.conf and add a blacklist bluetooth at the end of the file

blacklist amd76x_edac
blacklist bluetooth

colord

colord is a system daemon that manages device color profiles, whatever that is… I mean it was… Just to help you make up your mind regarding removing colord, this is what the urban dictionary has to say about “I mean”:

Meaningless American use of the English language. Often reflective of a complete lack of content in what they are saying – people of average intellect, articulation and education will simply pause and think about what they are saying. Probably due to American television with programs such as “Clueless”, “Legally Blonde” and “the OC”, which depict successful people as not requiring any form of intelligence or decent command of the English language. In real life, these people look stupid, act stupid, and everyone thinks they are stupid. Typically, they fail intelligence tests.

You’ve been warned!

$ sudo apt-get purge colord

deja-dup-monitor

Déjà Dup is a very powerful backup tool included with Ubuntu. All things powerful consume memory and lots of CPU cycles. If you are like me and never do a backup, you can lose it.

$ sudo apt-get purge deja-dup

getty

getty process runs on text-mode consoles and waits for someone to log in. It then configures the tty device and spawns a login shell. In my Ubuntu box there are 6 of them waiting for a login that will never happen – as I said earlier, I am running LXDE. I would keep however two of them, just in case…

getty is controlled by tty*.conf files in /etc/init directory. Keep tty1.conf and tty2.conf in /etc/init and move tty3.conf, tty4.conf, tty5.conf and tty6.conf in some safe place outside /etc directory. In case you ever need them, you just move them back.

update-notifier

You definitely don’t need this. It will bug you daily to update your software while holding a lot of memory hostage and doing absolutely nothing. What’s next, a do-your-homework-notifier?

$ sudo apt-get purge update-notifier

You are the boss, so you do updates manually whenever you feel like it.

sudo apt-get update && sudo apt-get upgrade.

acpid

acpid deals with such events as closing a notebook lid, removing power supplies, phone jacks etc. It doesn’t make sense to run it on a desktop.

$ sudo apt-get purge acpid

Java

This is an ongoing security nightmare, this is how you get rid of it:

$ sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

Xapian

Another useless piece of functionality. You can find more about it here and here. The bug was opened a few years ago in Lubuntu, and it is still waiting for the “big guns” to decide what to do about it. Until they fix it, if they ever do, just

$ sudo apt-get purge apt-xapian-index

Conclusion

After years of running Gentoo and Fedora, switching to Ubuntu is shocking. The desktop is cluttered with Canonical branding and marketing software, it is comparably slower, and some people say it lacks privacy. It doesn’t have to be this way, you can always remove the annoying Canonical bits starting with Unity.

On my desktop – 64bit AMD dual core – once everything was removed, free command is reporting 159MB memory in use after startup. I can probably get 15MB less if I scrap NetworkManager and just start dhclient manually from /etc/rc.local.

The surprise is that a similarly pruned Fedora 17 system was starting at 210MB, quite a lot compared to Ubuntu. I would definitely recommend Ubuntu over Fedora any time. The only problem is that you have to clean it a little, as every existing obscure open-source functionality is started by default.

Related Posts

32 thoughts on “Ubuntu Cleanup

  1. Innocent Bystander

    Can you please explain why installing LXDE on top of Unity is “much better memory-wise”. Would a bunch of binaries related to Gnome3 lay around costing more resources than starting from LXDE from the ground up?

    Reply
    1. netblue30 Post author

      You are right, the minimal installation is the way to go. I was just trying to fix an existing Unity desktop, without going through the trouble of a full reinstall.

      Reply
  2. Pingback: Ubuntu Cleanup | Linux and Open Source | Scoop.it

  3. electrospasm

    Thanks for writing this; I like to have a relatively clean system, but there seems a common lack of interest in the Linux community. The Zeitgeist bit is particularly annoying and dubious. Why something like Zeitgeist would ever end up in Linux is mysterious. And it seems the whole system is dependent on it. I fear if the slanted beak of Ubuntu is removed, not a penguin, but an orca is revealed. Amazon and Zeitgeist, hurray! Maybe sMART Boot has at least one purpose after all.

    Reply
      1. netblue30 Post author

        Good point! Like many other people I’ve just assumed all 12.04 variants are LTS.

        Probably it will not void LTS. LXDE is just another package in the database, like emacs or ssh server.

  4. W Tuxworx

    Thanks for the handy list of things you don’t need in Ubuntu. I’ve been running Linux Mint 13 Xfce for over 6 months now, and I had already used a less refined, but easier, method of doing away with most of them other than CUPS. First, because I use a verbose boot sequence, I had noticed a whole slew of modem drivers being loaded. I removed modem-manager and that was the end of them. I also removed zeitgeist and a few other things I don’t need. Mint departs from Ubuntu in not installing ubuntuone or whoopsie or maybe both of them; in any case, I don’t remember whether I removed one of them but by now I don’t have either of them installed. After reading your article I checked and found that I still had avahi, although I think I had disabled it, so I removed avahi-utils, avahi-autoipd, and a few other avahi files. I had read about the getty issue before, so I have most of the files renamed to ttybak#.conf, which I understand disables them just as well as moving them to another directory. (Please let me know if it doesn’t.)

    For anyone with even less real knowledge of Linux than I have, I’ll explain what I mean by using a less refined, but easier, method of getting rid of services you don’t need. Instead of carefully entering quite a few lines of commands in a terminal, I simply opened Synaptic, right-clicked on modem-manager, zeitgeist, etc., and selected “mark for removal” for each of them; and them clicked on the big “Apply” icon. Works for me; if they’re not installed, they’re not running. If you have very little knowledge of Linux, *be careful* with that approach. If you get carried away with removing things you think you don’t need, you may end up either removing something you actually do need or at least removing a dependency for something else that you do need. That could disable your system and require a complete new install.

    Reply
    1. netblue30 Post author

      This reminds me the first time I’ve tried to remove all cups packages, including libraries from a system. By the time it was done there was no X11 left and the computer wouldn’t boot. Synaptic is a nicer way to clean it up, but you can get carried away as easy as in command line.

      Reply
      1. AC

        You don’t necessarily have to remove CUPS, you can just disable the daemon. True, you lose some disk space for having it installed, but if it doesn’t it won’t bother you that much 🙂

  5. Pingback: Ubuntu Cleanup | Ubuntu-News - Your one stop for news about Ubuntu

  6. Pingback: Ubuntu Cleanup | bender

  7. Pingback: LinuxLife Blog » Ubuntu Cleanup

  8. D

    Something I remove is ‘pastebinit’. Allows for applications to directly upload to a pastebin service without permission or notification. Only discovered it after installing boot-repair which uploaded my boot config to ‘Ubuntu pastebin’. Applications should notify you and ask for permission first and there should be a option to turn it off.

    Reply
    1. cracknel

      boot-repair is not in the official repositories but from what I remember, there is a clear warning that some data is sent to pastebin. Also, IIRC, you can disable this behaviour.

      Be careful when you install software from 3rd party repositories!

      Don’t blame the developers! It’s your fault because you don’t check what you install and don’t read the on-screen instructions.

      Reply
      1. D

        There is no warning when installing it (boot-repair_3.197~ppa32~precise) that I can find, there is nothing in the deb package description and certainly no warning when installing it through synaptic, dpkg or apt-get.

        And there is no way to disable this ‘behavior’ in boot-repair_3.197~ppa32~precise, the only way to disable the pastebin intergration is by disabling your internet connection or by NOT installing gawk and pastebinit (if its not already installed). Boot-repair will ask if you would like to install them for you but doesn’t explain why they are needed or what will happen if you do, again failing to make the user aware.

        If those packages are already installed then boot-repair automatically sends the data to ‘Ubuntu Pastebin’ without notifying the user which is not good enough. Including a users name in the final report (example: gvfs-fuse-daemon on /home/bill/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bill) on a public viewable webpage makes it even worse imo. That info should not be included in the first place.

        If you don’t have an internet connection or you don’t install the extra packages then it defaults to a text file which is all that is needed anyway so why pastebin in the first place?

        Please don’t start the ‘Don’t blame the developers’ nonsense, its very sloppy coding at best. At worse? Well you could imagine. All that would be needed it to give the user a choice of two buttons once the report has been generated, one to ‘view as a text file’ and the other ‘send to pastebin’, a simple diolog, very easy to do.

        Btw, pastebinit installed by default in xubuntu 12.04 and boot-repair will be ‘should be soon included in Ubuntu official repositories’. Hopefully by then privacy conserns will be addressed.

        Regardless, since we don’t have application level firewalls its certainly something to watch out for.

        D.

  9. gary knott

    I like this post, and I want more. It is really hard to know what all the obscure
    processes that are running are about, and what things depend on them, and if they
    are useful at all. (Why is this the case?)

    In particular, I’d like to know how to discard unity after I install LXDE, and
    I’d like to know how to get a “login” screen that defaults to LXDE, instead of
    making me click an obscure icon and make a selection. And I’d
    like to know how to talk to grub2 and tell it to show the syslog postings
    and not show a splash-screen at boot-up.

    Reply
    1. netblue30 Post author

      Thanks. Your login screen will remain set to LXDE once you login in LXDE and shut down the computer. It remembers your last login.

      Don’t bother to discard Unity, leave it there on the hard disk. It doesn’t take too much memory. Unity is a very complex system, if you remove the wrong packet or the wrong library you won’t be able to start your computer again. Best thing is to ignore it.

      I remember from my Fedora time, if you pres Esc key after the bootsplash appeared, the system will go immediately in text mode (with the messages you mention for syslog). It should be something similar here also.

      Reply

Leave a comment