Fix Thunar crash on move, rename (Xubuntu 16.04)

thunar

Thunar 1.6.10 shipped with Ubuntu 16.04 (or upgraded on 15.10) has a nasty bug leading to a crash on file rename or move between tabs. There are several bugs on launchpad.net confirming this: #1512120, #1565951, #1572400. It’s an irritating issue and I was looking for a way to fix this. Seems like there’s already a patch from Harald Judt to take care of this.

Before proceeding, you can verify if you are affected or not. Run the following commands and see if Thunar crashes:

$ mkdir thunar_test
$ cd thunar_test
$ Thunar .
$ for i in $(seq 1 10); do touch "$i.txt"; done
$ while true; do for i in $(seq 1 10); do mv "$i.txt" "$i.txt.txt"; done; sleep 1; for i in $(seq 1 10); do mv "$i.txt.txt" "$i.txt"; done; sleep 1; done

Patch Thunar and compile

Work in a temporary directory:

$ mkdir thunar_compile
$ cd thunar_compile

Download the patch:

$ wget http://bug-attachment.xfce.org/attachment.cgi?id=6613 -O Thunar.patch

Install dependencies:

$ sudo apt-get install build-essential xfce4-dev-tools automake libtool autoconf intltool libglib2.0-dev libgtk2.0-dev libexo-1-dev libxfce4ui-1-dev

Download and compile Thunar 1.6.10 source code:

$ wget http://archive.xfce.org/src/xfce/thunar/1.6/Thunar-1.6.10.tar.bz2
$ tar -xf Thunar-1.6.10.tar.bz2
$ cd Thunar-1.6.10
$ mv ../Thunar.patch .
$ patch -p1 < Thunar.patch
patching file thunar/thunar-file.c
Hunk #1 succeeded at 3918 (offset -2 lines).
$ ./configure --enable-debug=no
$ make

Configuration details:


Build Configuration:

* D-BUS support:                      yes
* GIO UNIX features:                  yes
* GUDev (required for thunar-volman): no
* Mount notification support:         no
* Debug Support:                      no

Additional Plugins:

* Advanced Properties:                yes
* Simple Builtin Renamers:            yes
* Trash Panel Applet:                 no
* User Customizable Actions:          yes
* Wallpaper support:                  yes

At this point the right action is to run:

$ sudo make install

However, just replacing the binary works. So here’s what I did:

$ strip thunar/.libs/thunar
$ sudo mv /usr/bin/thunar /usr/bin/thunar.orig
$ sudo chmod -x /usr/bin/thunar.orig
$ sudo cp thunar/.libs/thunar /usr/bin/thunar

If you are interested, I have uploaded the binary here but you shouldn’t run third-party binaries from the web. It is optimized for core i5 and i7 cpus, thanks to pentium-builder.

5 thoughts on “Fix Thunar crash on move, rename (Xubuntu 16.04)”

  1. This is really depressing. After a couple of years telling people how great Xubuntu is and getting them to use it, there is a bug for RENAMING FILES that is not addressed in any updated repositories from November of 2015 (at least April 2016) to August of 2016. I’m working on a website with lots of photos and I need to rename them often. This one issue is making me need to switch to a different distribution. I tried to get another file manager going, but doesn’t make sense without redoing much of the desktop files/libraries/etc. (And no, I won’t be compiling fixes after loading developer tools on my computer). It feels like this is a distribution that is being maintained in just-a-little-too-casual way to use it to get serious work done. Repeat: renaming a file!

    1. BTW, on a quick note, if you are using synaptic and maintain package (un)installation history, you can easily install and uninstall newer packages.

Leave a Reply

Your email address will not be published. Required fields are marked *