33

Running into this issue when working with Hugo and the AWS CLI on Ubuntu 18.04.

ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored.

This is a fresh install of Ubuntu 18.04, Hugo, and AWS CLI.

CommandZ
  • 3,333
  • 1
  • 23
  • 28

3 Answers3

59

Found the answer after a bit of web searching here: https://github.com/PX4/Firmware/issues/9409

Solution

If you update your .bashrc with the below line it should fix the issue:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0

In addition, you may need to install the following package:

sudo apt install gtk3-nocsd

An Alternative

Another user reported installing the following package fixed their issue:

sudo apt-get install libgtk3-nocsd0:i386
CommandZ
  • 3,333
  • 1
  • 23
  • 28
  • I'm running on an iMAC and running Ubuntu in a virtual machine, this fix doesn't work for me, the folder x86_64-linux-gnu doesn't exist on my system. – SPlatten May 27 '19 at 18:40
  • What version of Ubuntu? I haven't tried this on a VM. This was on a Dell laptop. – CommandZ May 28 '19 at 20:12
  • The version of Ubuntu was 18.04 – SPlatten May 28 '19 at 20:20
  • 2
    In Ubuntu 20.04 LTS, there is no i386 build of libgtk3-nocsd0, so `sudo apt-get install libgtk3-nocsd0:i386` will fail with `E: Unable to locate package libgtk3-nocsd0:i386`. I have attempted to get round this by installing the 18.04 DEB on 20.04: Manually download `libgtk3-nocsd0_3-1ubuntu1_i386.deb` and install with `sudo dpkg -i libgtk3-nocsd0_3-1ubuntu1_i386.deb`. This seems to work for me. – john_e Nov 17 '20 at 00:49
  • Can't download libgtk3-nocsd0_3-1ubuntu1_i386.deb, checked almost all mirrors from https://packages.ubuntu.com/bionic/i386/libgtk3-nocsd0/download. Please share if any valid mirror available. – Prashant Adlinge Aug 25 '21 at 07:48
  • This is basically installing unneeded package just to fix warnings ;). Just remove that old stuff like I described below. – Andrei Emeltchenko Sep 08 '21 at 08:57
  • 2
    Will this brick other applications that depend on LD_PRELOAD? Is LD_PRELOAD "additive" (and any apps requested preloads will add onto this), or will they be/this replaced by the most recent LD_PRELOAD? – Katastic Voyage Sep 13 '21 at 10:45
  • I'd say, a better addition to the `.bashrc` is `[ -e /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 ] && export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0`. – kavadias Feb 11 '22 at 17:32
  • In Kubuntu 20.04 the package that needs to be installed is `libgtk3-nocsd0`. No need to install `gtk3-nocsd`. – kavadias Feb 11 '22 at 17:45
11

Running

$ sudo grep -r LD_PRELOAD /etc $HOME

I found lots of configuration files of the removed package gtk3-nocsd like

/etc/X11/Xsession.d/51gtk3-nocsd-detect: export LD_PRELOAD="libgtk3-nocsd.so.0${LD_PRELOAD:+:$LD_PRELOAD}"

Just remove those old configuration with:

$ sudo apt-get purge gtk3-nocsd
  • 1
    This is the right answer if you upgrade to Ubuntu 20.04 and start seeing this error – Yuhta Jun 12 '21 at 03:16
  • @Andrei-Emeltchenko Amazing. I just followed these exact same steps before discovering your answer. It worked like a charm. BTW : My Ubuntu 20.04 LTS comes from an Ubuntu 18.04 LTS upgrade. – SebMa Oct 26 '21 at 23:51
0

in file /etc/X11/Xsession.d/51gtk3-nocsd-detect change the line # 22 to

export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0"