How to Trim your New Ubuntu Installation of Extra Fat and make it Faster

The usual advice you get when seeking a more resource conserving distro is to use a lighter spin-off such as Xubuntu, Lubuntu, or a Debian with Openbox, etc. However, not many people know that even a “heavy” distro such as Ubuntu 16.04 LTS with the default Unity Desktop could be made much lighter by uninstalling some stuff and removing others from the startup. Lets see how it can be achieved:

1.Remove unwanted items from Startup Applications.

When you go to the Ubuntu Dash and start the “Startup Applications” dialog, it doesn’t show you the whole picture. There are still many “hidden apps” that silently start in the background without you knowing it. In order for all these hidden apps to be displayed in that dialog, you’ll have to run the following command in the terminal once:

sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop

Once you run this and then open the “Startup Applications” dialog, you’ll be able to see the hidden apps too:

From this dialog, you can disable an app from starting up by “unchecking” it. The most important that I typically uncheck on a new installation are Backup Monitor and Desktop Sharing. It doesn’t make sense to have such a huge backup schizophrenia on a non-production desktop computer, so I wonder why the Backup Monitor is enabled in the first place. About 99% of sysadmins either perform a manual backup periodically, or write an automation script use something like rsync which is specifically designed for the job.

Desktop Sharing is an equally unnecessary tool to have been enabled by default on a linux desktop. This ain’t the Windows world where people use Remote Desktop clients to connect to other PCs on the same network. Again, around 99% of linux folks use ssh to connect to remote machines. But that doesn’t mean that you have to keep ssh server enabled by default either. Desktop Sharing should be an opt-in feature in any case and a user who specifically needs it can enable it when needed.

2. Remove unnecessary background services such as cups and avahi-daemon.

On a fresh Ubuntu 16.04 installation, run sudo netstat -antpe and you’ll see the rarely used cupsd daemon (common unix printing service) running on a free TCP port leeching your memory and network resources. Similarly, run sudo netstat -anupe to scan for UDP ports and you’ll similarly see the cups browser daemon (cups-browsed) and the avahi daemon (avahi-daemon) services.

Again, use of printers has become less and less especially since the oncoming of digital age and Internet revolution. Hell, even companies have been encouraging email communication these days in a bid to avoid paper work and save trees, my bank sends me an email statement since last two years instead of a postal envelope to my address, and here we are – one of the top linux distributions running a printer service by default! Again, please make it an opt-in feature, those who need it will have enough sense to type sudo apt install cups. Until that happens, the rest of the folks can do the following:

sudo systemctl disable cupsd.service

sudo systemctl disable cups-browsed.service

We are not uninstalling it, just disabling the service just in case. And before you say that cups is needed for PDF exports from browsers, then no, the latest versions of firefox and chrome come with their own PDF extensions and don’t depend on this service anymore.

As for the other service (avahi-daemon), it really doesn’t make any sense as avahi is the linux implementation of Apple’s proprietary protocols for peer-to-peer communication between their iDevices. Now, who in their right mind would be using Ubuntu on their PC/Laptop and still use an Apple product like iPhone or MacBook? The two just don’t play well together as Apple products are a closed system and doesn’t allow much interaction with anything else without going through a lot of hoops. A user who can handle a linux distribution such as Ubuntu can easily handle something like Android which interacts well with a linux system (since Android itself is based on the linux kernel).

Again, for the extremely rare folks who do have such a setup, let them install it themselves. For others, to disable the avahi-daemon, just:

sudo systemctl disable avahi-daemon

3. Disable HUD (if you don’t use it).

One of the reasons why Xubuntu has such a low memory footprint (~200 MB at idle) is that it doesn’t come with memory leeching services such as the HUD. For example, on my laptop, HUD service eats a good 30MB of RAM which is too much for a service that I don’t even use. As described in this post, you can disable the HUD service from the terminal as follows:

on 32bit systems

sudo chmod -x /usr/lib/indicator-appmenu/hud-service

on 64bit systems

sudo chmod -x /usr/lib/x86_64-linux-gnu/hud/hud-service

4. Disable evolution processes (if you use Thunderbird or anything else instead).

Evolution processes(such as evolution-calendar-factory and evolution-addressbook-factory) are huge memory leechers and a big drain on your resources. If you just start the System Monitor and search for “evolution”, then you’ll find 4-5 different processes that will be totally consuming a good 120MB of your RAM! Now, for someone who doesn’t even use the evolution email client or any of these services, why should they be there in the first place? But unfortunately, you cannot just remove (uninstall) these packages using apt. Trying to remove evolution-data-server will break your system as they have made it a core part of the desktop. What you can do instead (if you really want to claim back that RAM) is a workaround suggested in this post. Simply rename the folders as follows (or use the other hack mentioned in the answer):

sudo mv /usr/lib/evolution-data-server /usr/lib/evolution-data-server-disabled
sudo mv /usr/lib/evolution /usr/lib/evolution-disabled

5. Remove GNOME software center (only if you don’t use it):

This piece of junk takes a good 70-80MB on any typical Ubuntu installation. For managing software, I personally find the good old apt install way to be much more intuitive than the GNOME software center. For those rare cases when you absolutely need a GUI, the synaptic package manager works absolutely fine and works without taking a constant toll on your resources.

As described in this answer, all it takes to safely remove GNOME software center it from your system is:

sudo apt purge gnome-software

After trimming the programs and services as mentioned above, your system should become nearly as light-weight as those other lighter distros like Xubuntu/Lubuntu/etc. and you’ll still be able to enjoy and work with a richer and better user interface.

On my own laptop, I was able to reduce the idle memory consumption from ~550MB to ~300MB which is as close as it gets to Ubuntu MATE!


Prahlad Yeri

Prahlad is a freelance software developer working on web and mobile application development. He also likes to blog about programming and contribute to opensource.
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
6 years ago

That’s all well and good but the biggest waste of space in *buntu installations are the all the unnecessary language packs, printer/video/NIC drivers and other software. Canonical has tied every piece of software to ‘ubuntu-minimal’ so that no software intalled by default can be uninstalled without compromising the system. I can can understand the reasoning behind installing all the possible language packs, and print/video/NIC drivers during the initial install. But what is the reasoning behind not allowing the unneeded ones to be uninstalled afterwards? They take up hundreds of megs of space. What about other unneeded/unwanted software? ‘Cowsay’ and ‘fortune’… Read more »

Bill Spartan
Bill Spartan
5 years ago
Reply to  dragonmouth

I wholeheartedly agree with your post I was under the impression that Linux was supposed to be configurable to the point and each individual user could install or remove whatever software or services they deem fit to remove it seems counterproductive to provide a distro that is locked down and has particular items that are not able to be removed for disabled the selection of language packs if I need say the German or the Hindi for the Chinese language packs then during installation I should be able to select those packages and installing

Back to top button