How do I completely remove Evolution?

Removing is too messy (because a lot of other packages depend on it even if they don't use its functionality), but disabling is relatively straightforward.

Ideally this should be done using dpkg-divert (but that has a problem with diverting to the same file), to not confuse apt/dpkg when you upgrade your system.

cd /usr/share/dbus-1/services
# This part create a copy of your original files
sudo cp org.gnome.evolution.dataserver.AddressBook.service org.gnome.evolution.dataserver.AddressBook.service.backup
sudo cp org.gnome.evolution.dataserver.Calendar.service org.gnome.evolution.dataserver.Calendar.service.backup
sudo cp org.gnome.evolution.dataserver.Sources.service org.gnome.evolution.dataserver.Sources.service.backup
sudo cp org.gnome.evolution.dataserver.UserPrompter.service org.gnome.evolution.dataserver.UserPrompter.service.backup

# This part does the trick
sudo ln -snf /dev/null org.gnome.evolution.dataserver.AddressBook.service
sudo ln -snf /dev/null org.gnome.evolution.dataserver.Calendar.service
sudo ln -snf /dev/null org.gnome.evolution.dataserver.Sources.service
sudo ln -snf /dev/null org.gnome.evolution.dataserver.UserPrompter.service

If we just delete the file or use any empty file the next update/upgrade will put them back. So we're using a symlink to an empty file (/dev/null is a special empty file, it stays empty even if you write something into it).

Here you find an article about what /dev/null is.


To remove Evolution, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get --purge remove evolution evolution-exchange evolution-plugins evolution-common evolution-webcal

The above command will not remove evolution-data-server, evolution-data-server-common

I would recommend that you use Synaptic Package Manager to completely remove Evolution. Just search for it, and mark it for complete removal.

Also just to be sure, after removing do:

sudo rm /usr/share/indicators/messages/applications/evolution

Now keep in mind that removing evolution, will also remove gnome panel. to install just do:

sudo apt-get install gnome-panel

With Ubuntu 18.04 (and probably 16.04) you can't get rid of Evolution without getting rid of GNOME, so your best bet is to disable it.

Building on PAStheLoD's answer and its comments, I wrote a script to disable the evolution services and to inform dpkg/apt of the changes so they aren't wiped out on upgrades. Hopefully, this will help those of you who, like me, script your system setup just in case you need to reinstall.

I tested this on Ubuntu 18.04.1 LTS.

#!/bin/bash

##
## Disables the Evolution mail program's services by moving the services files
## to another directory.
##
## This must be run as root.
##

SERVICES_HOME="/usr/share/dbus-1/services"
DISABLED_DIR="$SERVICES_HOME/disabled"


exitOnError()
{
    local errorCode=$1
    local errorMessage="$2"

    echo "$errorMessage"
    exit $errorCode
}


main()
{
    # Make sure that we are running as root and that the services directory didn't change!
    if ! [ $(id -u) = 0 ]; then
        exitOnError -1 "Script must be run as root or sudo.  Exiting..."
    fi

    if [ ! -d "$SERVICES_HOME" ]; then
        exitOnError -2 "Services directory $SERVICES_HOME does not exist.  Exiting..."
    fi

    mkdir -p "$DISABLED_DIR"

    find "$SERVICES_HOME" -maxdepth 1 -type f -name "org.gnome.evolution.dataserver.*" ! -name "*.bak" -printf "%f\0" | while IFS= read -r -d $'\0' servicename; do
        # Tell dpkg/apt to update the file in DISABLED_DIR instead of the one in SERVICES_HOME
        dpkg-divert --quiet --divert "$DISABLED_DIR/$servicename" --rename --add "$SERVICES_HOME/$servicename" || exitOnError -3 "Unable to divert service $servicename."

        ln -snf /dev/null  "$SERVICES_HOME/$servicename"
        echo "Disabled service $servicename"
    done

    echo "All evolution services have been disabled.  Please restart for changes to take effect."
}

main

To undo this, run the following:

sudo rm /usr/share/dbus-1/services/org.gnome.evolution.dataserver.*
sudo dpkg-divert --rename --remove /usr/share/dbus-1/services/org.gnome.evolution.dataserver.AddressBook.service
sudo dpkg-divert --rename --remove /usr/share/dbus-1/services/org.gnome.evolution.dataserver.Calendar.service
sudo dpkg-divert --rename --remove /usr/share/dbus-1/services/org.gnome.evolution.dataserver.Sources.service
sudo dpkg-divert --rename --remove /usr/share/dbus-1/services/org.gnome.evolution.dataserver.UserPrompter.service
sudo rmdir /usr/share/dbus-1/services/disabled

Tags:

Evolution