Table of Contents [hide]
Overview
Meld is a program that can show the differences in files and directories. For example, if you are copying files between directories and an error occurs, you can compare the two directories to see what files are missing in your copy. You can then copy the missing files.
It is available on Windows, Mac OSX, and Linux.
Unfortunately, when installing Meld from the Ubuntu 20.04 repository, there is a bug that prevents you from copying the missing files. The repository version is 3.20.2 and the fix was in 3.20.3. The latest version as of the time of this writing is 3.21.1
I rarely build and install from source as it’s very rarely smooth sailing. So the following is just notes on what I did to install the latest version of Meld that you may find useful.
Installation
First we install Meld through the respository by doing the following commands:
sudo apt-get update
sudo apt-get install meld
On Ubuntu 20.04, this will install version 3.20.2
Upgrading
In order to have the latest version, we will need to build it from the source files.
The following upgrading steps was mainly taken from UnixMen. But when I was following the instructions, I got compilation errors and run time errors. The fixes will follow after this section.
Install Dependencies
Install the python dependencies so we can build Meld from the source
sudo apt-get install intltool itstool gir1.2-gtksource-3.0 libxml2-utils
Get the Source Files
Using git, you can clone the repository.
git clone https://git.gnome.org/browse/meld
If you don’t have git, you can install git
sudo apt-get install git
Compile and Install
After you clone the directory, you will have a directory called meld
Go into the directory
cd meld
Run the setup.py file using Python3
sudo python3 setup.py install
Compiling Errors
ModuleNotFoundError: No module named ‘distutils.core’
After running setup.py, Meld would not compile.
There was no package named ‘disutils.core’.
From this StackOverflow Article we need to do the following:
-
Check what version of python3 we have
python3 --version
Mine was Python 3.8
-
Install Python3 Distutils
You need to install Python3 Distutils according to your python version
Since I’m using Python 3.8, mine would be like belowsudo apt-get install python3.8-distuils
Replace 3.8 with your version of Python
Unable to execute ‘glib-compile-resources’: no such file or directory
After doing the previous step, it started to compile, but ran into another error.
The compiler could not find glib-compile-resources
After doing some internet searching, I found this article on GitHub.
Apparently, glib-compile-resources comes from libglib2.0-dev-bin
So we just need to install that
sudo apt-get install libglib2.0-dev-bin
After this, Meld compiled without any problems.
Run Time Errors
We can start Meld by typing meld in the command line
The program started and it looked good to go.
Couldn’t find colour scheme details for meld:overscroll-background; this is a bad install
However, when I tried to compare directories, the window just disappeared and an error appeared in the terminal. It couldn’t find the color meld:overscroll-background.
There was a GitHub Issue with a fix. I simple had to change an xml file and add in the color located at /usr/share/meld/styles/meld-dark.xml
Open up the file using sudo like with an editor like vim using sudo like so
sudo vim /usr/share/meld/styles/meld-dark.xml
Add the following as the second last line above the tag
<style name="meld:overscroll" background="#AAAAAA" />
For the background, you can use any color of your choice. I just chose a gray.
Conclusion
After the above fixes, everything I wanted to do in Meld was working.
I hope you found my notes useful in building and install Meld from source.