Tag Archives: Ubuntu

Installing net-snmp MIBs on Ubuntu and Debian

Simple Network Management Protocol (SNMP) is an Internet-standard protocol for managing devices on IP networks. net-snmp is the main SNMP implementation for Linux and BSD platforms. On Ubuntu or Debian net-snmp tools are installed as follows:

$ sudo apt-get install snmp

You can also install snmpd package. This package contains the SNMP agent.

Installing MIBs

For licensing reasons, net-snmp package installs only a small number of MIBs in /usr/share/mibs directory. A large number of standard MIBs can be installed using snmp-mibs-downloader package:

$ sudo apt-get install snmp-mibs-downloader
$ sudo download-mibs

To have the new MIBs recognized by net-snmp, edit /etc/snmp/snmp.conf file as follows:

$ cat /etc/snmp/snmp.conf
mibs +ALL
$

You can use snmptranslate to check the MIBs have been properly installed by printing the MIB tree:

$ snmptranslate -Tp
+--iso(1)
   |
   +--org(3)
      |
      +--dod(6)
         |
         +--internet(1)
            |
            +--directory(1)
            |
            +--mgmt(2)
            |  |
            |  +--mib-2(1)
            |     |
            |     +--system(1)
            |     |  |
            |     |  +-- -R-- String    sysDescr(1)
            |     |  |        Textual Convention: DisplayString
            |     |  |        Size: 0..255
...

Adding additional MIBs

To install additional MIBs you would need to create first a local ~/.snmp/mibs directory:

$ cd ~
$ mkdir -p .snmp/mibs

Drop any additional MIB files you might have in this directory. To install CISCO MIBs, download v2.tar.gz file from ftp://ftp.cisco.com (the file is located in pub/mibs/v2/). Move all the *.my files in the archive in ~/.snmp/mibs directory.

Ubuntu Desktop Memory Comparison

A new Ubuntu release is out, 13.04. As usual it comes in a number of different flavors, covering a wide range of hardware platforms. I am particularly interested in the favors available because my computer is a 6 years old dual-core AMD 64bit with 1GB of memory.

As the Internet stopped getting faster, two years ago I’ve decided not to upgrade it. I don’t “read” flash heavy sites, I guess nobody likes them anyway. For games, movies, and music what I have is more than enough. I do need to keep an eye on memory however. Lately, some developers started to throw into their software everything but the kitchen sink.

Unity

The main Ubuntu desktop environment is Unity. It is a great desktop for new users who aren’t especially computer savvy, and it requires lots of memory to run. As measured using free command after boot up, Unity runs in 437MB and it is visibly slow – definitely not a good choice for an old Widows XP computer!

KDE

With Unity out of the game, I am moving to KDE. It is packaged as an Ubuntu branch under the name Kubuntu. A download image is available for installation, or you can install it using apt-get on an existing Ubuntu computer:

sudo apt-get install kubuntu-desktop

Nice, elegant, and slow, it starts in 435MB of memory.

Ubuntu 13.04 KDE

Ubuntu 13.04 KDE

Gnome

Gnome joined the Ubuntu family earlier this year under the name Ubuntu GNOME. You can find more information here. I have installed it as follows:

sudo apt-get install ubuntu-gnome-desktop ubuntu-gnome-default-settings

It loads in 304MB of memory and it runs fine even on my old machine. It is not a traditional desktop, it doesn’t have a taskbar and a menu. For this reason many people don’t like it. As for me, it is time to move to a series of desktop environments generally characterized as lightweight.

Ubuntu 13.04 Gnome

Ubuntu 13.04 Gnome

Razor-qt

Razor-qt is described as “an advanced, easy-to-use, and fast desktop environment based on Qt technologies. It has been tailored for users who value simplicity, speed, and an intuitive interface. Unlike most desktop environments, Razor-qt also works fine with weak machines.” On my computer it runs very well in 288MB of memory.

Razor-qt is not in this moment an official Ubuntu branch. It is however fully supported, all you have to do is

sudo apt-get install razorqt
Razor-qt Desktop

Razor-qt Desktop

Xfce

Xfce desktop environment has been packaged as an Ubuntu flavor since 2006 under the name Xubuntu. It is low on resources and fast. On my computer it loads in 281MB. I have installed it as:

sudo apt-get install xubuntu-desktop

It is an excellent choice for an old computer. Arguably, most people going linghtweigth end up with Xfce.

Ubuntu 13.04 XFCE

Ubuntu 13.04 XFCE

LXDE

Another popular lightweight Ubuntu flavor is Lubuntu. It uses even less memory than Xubuntu, in my case 184MB. The desktop environment is LXDE. This is what I usually run on my computers.

sudo apt-get install lubuntu-desktop
Ubuntu 13.04 LXDE

Ubuntu 13.04 LXDE

Enlightenment

Enlightenment is a lean, fast, modular and very extensible desktop environment for X11 and Linux. It is classed as a “desktop shell” providing the things you need to operate your desktop or laptop. On my computer it runs in 182MB of memory, very close to LXDE.

It is not an official Ubuntu flavor yet. Fully supported in Ubuntu 13.04, this is how you can install the latest version (E17):

sudo apt-get install e17
E17 Desktop

E17 Desktop

MATE and Cinnamon

MATE is supported in Ubuntu 13.04, and it runs in 264MB of memory. It is installed from developer’s repository as follows:

sudo add-apt-repository "deb http://packages.mate-desktop.org/repo/ubuntu raring main"
sudo add-apt-repository "deb http://repo.mate-desktop.org/ubuntu raring main"
sudo add-apt-repository "deb http://mirror1.mate-desktop.org/ubuntu raring main"
sudo apt-get update
sudo apt-get install mate-archive-keyring
sudo apt-get update
sudo apt-get install mate-core

Starting with Ubuntu 13.04 release, Cinnamon is supported officially in Ubuntu repositories. It runs in 390MB. It is installed as follows:

sudo apt-get install cinnamon

Conclusion

Choice is the best Linux feature ever. Regardless of your circumstances, you can always find a Linux OS to fit that computer of yours. In this case I am looking at Ubuntu 13.04 and its flavors. Stable, mature, and free, Ubuntu is supported by a reputable software company and one of the best user and developer communities.

I have measured the memory using free command in a X terminal after boot up. The number includes everything running on the computer in that specific moment. This is the memory chart:

Ubuntu 13.04 Memory (MB)

Ubuntu 13.04 Memory (MB)


Related Posts

Ubuntu Cleanup

A Memory Comparison of Light Linux Desktops – Part 2

In my previous article I’ve tried to investigate the RAM memory requirements for running some of the most common light window managers and desktop environments available in the Linux world. Prompted by a number of readers, I’ve decided to include also the big, well-known memory hogs that grab most of the Linux market, i.e. KDE, Unity and Gnome 3.

I am using the same setup, based on virtenv. It includes its own xserver (Xephyr) and a virtualization container (LXC). I use free command to measure the memory before and after the WM/DE is started. The computer is an older 64-bit machine, running Ubuntu 12.04 with LXDE as desktop environment.

I measure the WM/DE as it comes out of the box, with all the features the authors intended to be run as default. Arguably, this is not the best way to measure. All window managers are highly configurable, and users in general tend to personalize them. This adds more memory to whatever numbers I publish here.

Ratpoison

Lightning fast and stable, Ratpoison is a e tiling window manager for the X Window System. The major design goal of the project is to let the user manage application windows without using a mouse, hence the name.

On Ubuntu, install it as sudo apt-get install ratpoison and start it with ratpoison command. Be prepared to read the documentation. It runs in 1MB of RAM memory.

Ratpoison Window Manager

Ratpoison Window Manager

wm2

wm2 simply adds a frame to each window and attempts to look stylish. In the quest for being simple, fast, and small, wm2 does not support icons, menus, toolbars, panels and docking areas.

I have installed it on Ubuntu as apt-get install wm2, and started it as wm2. It runs in 0.7MB, this is the smallest WM I’ve tried so far.

wm2 Window Manager

wm2 Window Manager

FVWM

FVWM (Feeble Virtual Window Manager) is one of the most ancient window managers still in use today. It is a powerful and highly configurable environment for Unix-like systems. Some very popular window managers and desktop environments, such as Afterstep, Xfce, Enlightenment, are derived from FVWM.

FVWM Derivatives, (source Wikipedia)
(source Wikipedia)

I have installed it on Ubuntu as apt-get install fvwm, and started it as fvwm. It runs in 13MB of memory.

FVWM Window Manager

FVWM Window Manager

Window Maker

Window Maker window manager provides the users with a consistent, clean, and elegant desktop based on NeXTStep interface, which eventually evolved into Mac OS X.

Window Maker is again under active development after seven years without an official release. It is not available in Ubuntu software repositories, you can however install it from a PPA:

sudo add-apt-repository ppa:profzoom/wmaker
sudo apt-get update
sudo apt-get install wmaker

Start it as wmaker. It runs in 7MB of memory.

Window Maker Window Manager

Window Maker Window Manager

Razor-qt

Razor-qt is an advanced, easy-to-use, and fast desktop environment based on Qt technologies. It is a desktop for people who think KDE is bloated and suffers from over-engineering. It runs in 139MB of RAM memory.

Razor-qt is a new open-source project, and it is not officially supported by most Linux distributions. For Ubuntu users, the development team keeps a PPA up-to-date. The software works on any Ubuntu from version 9.10 onwards. Installation is as follows:

sudo add-apt-repository ppa:razor-qt
sudo apt-get update
sudo apt-get install razorqt

Start it as razor-session.

Razor-qt Desktop Environment

Razor-qt Desktop Environment

KDE

I’ve always liked KDE. Elegant and reasonably fast, it is an excellent desktop choice for people developing GUI software. In particular I like Kate text editor and KDiff3. Qt development tools are also well supported, but that was to be expected from a desktop based on Qt library.

I’ve installed kde-plasma-desktop packet from Ubuntu 12.04. The packet is described here as “the bare-minimum required”. I started it in console as openbox-kde-session. It runs in 201MB. On a real KDE desktop such as Kubuntu it will be much more.

KDE Desktop Environment

KDE Desktop Environment

Unity

Unity is the default desktop in Ubuntu. Ubuntu is what they recommend you to try when you move to Linux. It is friendly, functional, and geared towards “human beings”. Too bad it runs in 192MB of memory! It would be a good idea to trim it down, let’s say by 50%. As a note, DOS conquered the world by running in 64KB of memory.

Unity is installed as sudo apt-get install ubuntu-desktop. You can start it with unity command.

Unity Desktop Environment

Unity Desktop Environment

Gnome 3

Gnome 3 is an experimental desktop developed mostly by RedHat. Not all the functionality is ready (for example the taskbar and the menus are missing), and there are problems in the listening-to-your-users department. If you are looking for Gnome 2 functionality or something similar, check out Linux Mint website.

I’ve install Gnome 3 as sudo apt-get install gnome-shell and started it as gnome-session. It will burn trough 155MB of memory before painting anything on the screen.

Gnome 3 Desktop  Environment

Gnome 3 Desktop Environment

Trinity, Mate, Cinnamon

In a normal world, where development teams listen to users, this should never have happened. Not only these environments are smaller and faster, they actually do what desktop environments are supposed to do.

To install Trinity, follow the instructions from here. Start it as /opt/trinity/bin/startkde. It runs in 55MB of memory.

To install MATE, follow the instruction from here. Start it as mate-session. It runs in 42MB of memory.

I have installed Cinnamon as follows:

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon

I’ve started it as cinnamon. It runs in 79MB.

Trinity Desktop Environment

Trinity Desktop Environment

Conclusion

If you have some ancient hardware that you need to breathe new life into, or if you need to fit a distro on a modestly sized memory stick, the first thing you should look at is the window manager/desktop environment. Whatever your needs, Linux is much more than Gnome and KDE.

WM/DE Memory (MB)

WM/DE Memory (MB)

Links:

wm2, dwm, Ratpoison, JWM, i3, Blackbox, IceWM, Openbox, Window Maker, awesome, FVWM, Fluxbox, E17, LXDE, MATE, Trinity, XFCE, Cinnamon, Razor-qt, Gnome 3, Unity, KDE

Related Posts

A Memory Comparison of Light Linux Desktops – Part 1

Lightweight openSUSE: LXDE Desktop From Scratch

Lightweight Debian: LXDE Desktop From Scratch

A Memory Comparison of Light Linux Desktops

After I install a new version of Linux, I usually take a good look at the screen. Does it have a task bar? Can you find your window after it was minimized? Lately, some developers have been struck by some sort of amnesia brought on by the stress created by the mobile sector offerings.

Fortunately, in Linux we do have plenty of other choices. I will describe some of them in this article, and I’ll attempt to measure the RAM memory requirements. I use free command in an xterm before and after the graphic environment is started on a separate X server (Xephyr). The computer is an older 64-bit machine, running Ubuntu 12.04 with LXDE as desktop environment.

Note: the tool I use to set it all up is virtenv. It sets up a Xephyr xserver running Joe’s Window Manager in a Linux kernel container (LXC). I only have to shut down JWM, apt-get install the new window manager, and run it. The beauty is the container works in a separate filesystem, and it will not overwrite the real filesystem on my computer.

Joe’s Window Manager

JWM is a light-weight window manager for the X11 Window System. A small memory footprint makes it a good choice for older computers and less powerful systems. Barry Kauler’s excellent Puppy Linux is based on JWM.

You install it as sudo apt-get install jwm on Ubuntu, or as yum install jwm on Fedora. I takes about 3MB of memory to run.

JWM window manager

JWM window manager

*box

This is a series of three window managers. BlackBox is the original, Openbox and Fluxbox are forks.

BlackBox is comparable to JWM, and loads in about 3MB of memory.

Openbox is rarely used stand-alone, it is however the window manager of choice in a number of other desktop environments such as Gnome, KDE and LXDE. It runs in about 7MB of memory. CrunchBang is and example of distribution based on Openbox.

Fluxbox is popular in many Live CDs such as Knoppix STD and GParted. It is currently the default window manager of PCFluxboxOS, Linux Mint Fluxbox CE and Salix OS Fluxbox. It runs in 16MB of memory.

Install them on Ubuntu as sudo apt-get install blackbox openbox fluxbox, or yum install blackbox openbox fluxbox on Fedora.

Fluxbox window manager

Fluxbox window manager

Dynamic Window Managers

A dynamic/tiling window manager adjusts the size and position of the windows so there is no overlapping and no space lost between them. This is in sharp contrast with the normal window managers which float and overlap windows. The distinction is not as strict today as it used to be, most modern tiling window managers can easily float windows. Some examples are dwm (1MB RAM), i3 (3MB) and awesome (9MB).

Install them as sudo apt-get install awesome i3 dwm on Ubuntu, and as yum install awesome i3 dwm on Fedora.

awesome Window Manager

awesome Window Manager

E17

This is a beautiful desktop environment, the graphics just surpass everything else in this article. It is highly configurable and very fast. It runs in 35MB of memory in my tests.

Install it as sudo apt-get install e17 on Ubuntu, or as yum install e17 on Fedora.

E17 Desktop Environment

E17 Desktop Environment

LXDE

The Lightweight X11 Desktop Environment was specially designed for computers with low hardware specifications, such as netbooks, mobile devices (e.g. MIDs) or older computers. In my opinion this is the DE that had the most to gain from Gnome 3 debacle. You can get today full major distros based on LXDE, such as Lubuntu and Fedora LXDE Spin. Usable and slim, LXDE runs on my computer in 36MB of memory.

Install it on Ubuntu as sudo apt-get install lxde, or yum install lxde on Fedora.

LXDE Desktop Environment

LXDE Desktop Environment

Xfce

Xfce is a desktop environment based on GTK+ 2 toolkit. It aims to be fast and lightweight, while still being visually appealing and easy to use. Xubuntu and Fedora Xfce Spin are two of the distros featuring Xfce.

It runs in about 70MB of memory, which is a lot more than LXDE. Install it as sudo apt-get install xfce4 on Ubuntu, and yum groupinstall xfce on Fedora.

XFCE Desktop Environment

XFCE Desktop Environment

Conclusion

People use computers in different ways for different tasks. Window Managers and light Desktop Environments are sometime the only choice for less powerful systems or for places where every bit of memory counts (gamers, programmers etc.).

WM/DE Memory (MB)

WM/DE Memory (MB)

Links: wm2, dwm, Ratpoison, JWM, i3, Blackbox, IceWM, Openbox, Window Maker, awesome, FVWM, Fluxbox, E17, LXDE, MATE, Trinity, XFCE, Cinnamon, Razor-qt, Gnome 3, Unity, KDE

Related Posts

A Memory Comparison of Light Linux Desktops – Part 2

Lightweight openSUSE: LXDE Desktop From Scratch

Lightweight Debian: LXDE Desktop From Scratch

SNMP MIB Browser on Ubuntu Workstation

Ubuntu has the image of a user-friendly distribution, good for grandparents and human beings in general. It is also an excellent choice for any kind of infrastructure and servers in datacenters. In fact, according to W3Tech, Ubuntu server is right now in the third position and growing fast as a webserver.

In a previous article I looked at installing a basic network router using RCP100 on a Ubuntu 12.04 computer. Today, I will take a look at using Ubuntu for some more serious SNMP work.

The main SNMP software package available under Linux is net-snmp. Installation and usage is described in plenty of articles on Internet. The package is very powerful, however it operates strictly on the command line. In the day to day work, a GUI based SNMP MIB Browser would be nice.

One such MIB Browser I come to enjoy is iREASONING MIB Browser. It is a commercial product, however the company is kind enough to provide a limited personal edition free of charge. It is a Java-based browser, and it will work on any operating system where Java is available. On Ubuntu, this means you will need to install Java Runtime Environment:

$ sudo apt-get install openjdk-7-jre

Download mibbrowser.zip from iREASONING website and unzip it:

$ cd ~
$ unzip Downloads/mibbrowser.zip

This will create a ~/ireasoning/mibbrowaser directory in your home directory. To start the browser, cd into mibrowser directory and run browser.sh script:

$ cd ireasoning/mibbrowser/
$ ./browser.sh

Type in the IP address of the device you want to browse, press Advanced button and set the community string, and you are ready to grab the SNMP information.

ireasoning

RCP100 Basic Router Configuration on Ubuntu 12.04

I do like the idea of an open-source software router, and I’ve tried several of them so far. Most open-source routers would concentrate on implementing the main IP routing protocols one by one. Administration features like CLI or SNMP seem to get less attention. There is little or no support for integrated Access Control Lists, NTP, DHCP or DNS functionality. This is in sharp contrast with the commercial routers where administration and network management are first class citizens.

RCP100 seems to break the tradition. It has a Cisco-like command line interface (CLI), and all the regular administration and management protocols. Starting with version 0.99 it also features a simple and intuitive web interface, making the router accessible to less sophisticated users and beginner administrators.

In this article I will set up a basic RCP100 IP router on a Ubuntu 12.04 computer using the web interface. This means there will be lots of pictures and no CLI commands. Networking experts will definitely get bored.

I am installing the software on a regular Ubuntu 12.04 LTS computer running LXDE. This is an older 64bit machine with two Ethernet interfaces, eth0 and eth1. The computer is connected to the main network on eth0, and it is auto-configured using DHCP. Upstream, a regular small router handles the DSL Internet connection and provides DHCP services.

The steps are as follows:

Disable existing network services

I start by disabling DHCP on the Ubuntu computer. For this, I go into Preferences/Network Connections, press Wired connection 1 and in IP v4 Settings tab I switch the connection type from Automatic (DHCP) to Manual. I set the interface IP address and DNS servers field and save them. The values I chose are actually the same values pushed previously by DHCP. For DNS servers I use the public 8.8.8.8 and 8.8.4.4 provided by Google. I also disable Automatic (DHCP) on the other interface.

network configuration

Starting with Ubuntu 12.04 version, a DNS server – dnsmasq – is installed and started by default on the computer. I disable it since it will collude with RCP100 DNS functionality. For this I edit /etc/NetworkManager/NetworkManager.conf and comment out the dns=dnsmasq line.

#dns=dnsmasq

When all is set, I restart Network Manager

$ sudo restart network-manager

Installing RCP100

RCP100 provides .deb packages for Ubuntu. The latest software version is 0.99.2 and it is available here. The package was build for Ubuntu 12.04 LTS and it will also work on Ubuntu 12.10. I use dpkg to install it:

$ sudo dpkg -i rcp100_0.99.2_1.deb

Reseting the computer in this moment will automatically start the router. You can also start the router manually with start rcp100 command, and stop it with stop rcp100 from a terminal.

Login

The next step is to login into the router using the web interface. I start a web browser and point it to http://0/index.html. I type in username rcp, password rcp and I am immediately asked to change the default passwords. I am then directed to the main router page.

main page

From here I go to the configuration page, where I configure all router features I am interested in.

config page

DNS configuration

In DNS configuration page I just enter the same DNS server addresses – 8.8.8.8 and 8.8.4.4 – as before, and I enable DNS proxy server services. Then, I type in the password and press Save Configuration button. The local DNS proxy server is started immediately. Anybody on the network can use this server to speed up name resolution.

DNS config

Interface configuration

Interface configuration page allows you to set the IP address for all interfaces. I enter 192.168.1.19/24 for eth0 and 192.168.22.1/24 for eth1.

br0 and br1 are two bridge interfaces created by RCP100. The interfaces are mainly used for connecting virtual machines to the real network. If you don’t need them, just mark them as shutdown.

interface config

NTP configuration

The last configuration item on the menu is Network Time Protocol. I specify two external servers for synchronization and I enable the local NTP server. I intend to use this server to synchronize the time on all the other machines on the network.

NTP config

Conclusion

RCP100 is easy to install and run on a regular Ubuntu computer. The web interface is easy to use, you can basically set the router without any CLI knowledge. If you are a CLI fan, you can always telnet into the box and set it using the regular CLI commands. Most of the commands are exactly as Cisco’s, the occasional differences are minor and can be resolved easily by typing “?” on the prompt line.

How to send emails from command line

SendEmail is a lightweight command line SMTP agent. It was designed to be easily integrated in bash scripts, Perl programs etc. The program is in fact a Perl script, and it is distributed under GPL.

I’ll start by installing SendEmail, and I will then show how to send the email using a regular gmail.com account or a yahoo.com account. You can send the email to this account, or you can use the account as a relay. The same procedure can be used with most of the online accounts.

Installing SendEmail is easy:

$ sudo apt-get install libio-socket-ssl-perl libnet-ssleay-perl sendemail

Sending an email using gmail.com is as follows:

$ sendemail -f username@gmail.com -t destination@domain.com \
-u “this is the subject of the message” \
-m “and this is the message” \
-s smtp.gmail.com -o tls=yes -xu username -xp password

username and password above are your gmail.com username and password. The message is encrypted using TLS. destination@domain.com is where you want the message to be sent.

Similarly for yahoo.com:

$ sendemail -f username@yahoo.com -t destination@domain.com \
-u “this is the subject of the message” \
-m “and this is the message” \
-s smtp.mail.yahoo.com -xu username -xp password

SendEmail comes with a regular man page and very extensive documentation accessible using –help option. For example:

$ sendemail –help networking

NETWORKING DOCUMENTATION

Networking Options
Options related to networking:
-s SERVER[:PORT]
-b BINDADDR[:PORT]
-o tls=
-o timeout=SECONDS

-s SERVER[:PORT]
This option allows you to specify the SMTP server sendEmail should
connect to to deliver your email message to. If this option is not
specified sendEmail will try to connect to localhost:25 to deliver
the message. THIS IS MOST LIKELY NOT WHAT YOU WANT, AND WILL LIKELY
FAIL unless you have a email server (commonly known as an MTA) running
on your computer!
Typically you will need to specify your company or ISP’s email server.
For example, if you use CableOne you will need to specify:
-s mail.cableone.net
If you have your own email server running on port 300 you would
probably use an option like this:
-s myserver.mydomain.com:300
If you’re a GMail user try:
-s smtp.gmail.com:587 -xu me@gmail.com -xp PASSWD

-b BINDADDR[:PORT]
This option allows you to specify the local IP address (and optional
tcp port number) for sendEmail to bind to when connecting to the remote
SMTP server. This useful for people who need to send an email from a
specific network interface or source address and are running sendEmail on
a firewall or other host with several network interfaces.

-o tls=
This option allows you to specify if TLS (SSL for SMTP) should be enabled
or disabled. The default, auto, will use TLS automatically if your perl
installation has the IO::Socket::SSL and Net::SSLeay modules available,
and if the remote SMTP server supports TLS. To require TLS for message
delivery set this to yes. To disable TLS support set this to no. A debug
level of one or higher will reveal details about the status of TLS.

-o timeout=SECONDS
This option sets the timeout value in seconds used for all network reads,
writes, and a few other things.

$

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

Ubuntu Desktop Memory Comparison

ezchroot

ezchroot is a small script to chroot into OpenVZ containers. Once inside, you can update or modify the container software. The operation is similar to ezlxc.

#!/bin/bash

if [ $# -gt 0 ]; then
	echo
else
	echo "Usage: ezchroot directory"
	exit 1
fi

cp -L /etc/resolv.conf $1/etc/.
mount -t proc none $1/proc
mount --rbind /dev $1/dev
mount --rbind /sys $1/sys

echo "entering chroot directory"
env NAME=chroot chroot $1 /bin/bash
umount $1/proc
umount $1/dev
umount $1/sys
echo "chroot exited"