Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Author: CzBiX
# URL: https://gist.github.com/CzBiX/e64256b23687bb13da02
# Support only Ubuntu 16.04
DEST_PACKAGE="libglib2.0-0"
DEST_VERSION="2.48.1-1~ubuntu16.04.1"
DEST_FILE="/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.1"
PATCH_DATA="f626c: eb"
SUCCESS_MSG="Please quit nautilus with 'nautilus -q' to make sure patch worked."
function failed {
echo >&2 $1;
exit 1;
}
[ $(arch) == 'x86_64' ] || failed "only support x86_64."
type xxd >/dev/null 2>&1 || failed "xxd not found, please install vim."
[ $(apt-cache policy $DEST_PACKAGE | grep Installed | cut -d ' ' -f 4) == $DEST_VERSION ] || failed "$DEST_PACKAGE version not match with '$DEST_VERSION'."
echo $PATCH_DATA | sudo xxd -r - $DEST_FILE || failed "patch failed."
echo $SUCCESS_MSG
@Sadi58

This comment has been minimized.

Sadi58 commented Mar 13, 2016

Thank you so much for this fix, but now that libglib2.0-0 version changed recently to '2.46.1-1' I wonder if it's OK to simply change the corresponding number in the variables DEST_VERSION and DEST_FILE or it also requires different PATCH_DATA.

@CzBiX

This comment has been minimized.

Owner

CzBiX commented Mar 23, 2016

@Sadi58 No, do NOT do it.
It's binary patch, and should be update in every time that package upgraded, even that's build from the same source code.
I will update it later.

@petersaints

This comment has been minimized.

petersaints commented Apr 18, 2016

Thanks for the patch. But could I please update to Xenial (at least once it's released)?

@CzBiX

This comment has been minimized.

Owner

CzBiX commented May 5, 2016

@Sadi58 @petersaints Just updated for Ubuntu 16.04. Please try it.

@mohicanb

This comment has been minimized.

mohicanb commented Aug 23, 2016

Hello, with Ubuntu 16.04.1 the package was updated to version 2.48.1-1-ubuntu16.04.1
So I guess I can't use your patch.
Any news from the devs ?

@mcg

This comment has been minimized.

mcg commented Aug 24, 2016

@CzBiX Can you update to 16.04.1? Nuts that this is still broken.

@CzBiX

This comment has been minimized.

Owner

CzBiX commented Aug 29, 2016

@mohicanb @mcg Just updated for Ubuntu 16.04.1. Please try it.

@mcg

This comment has been minimized.

mcg commented Oct 11, 2016

@CzBiX Never saw that you had updated to 16.04.1, but I updated to 16.10 hoping it was fixed and it's still broken. AARGH...

@Sadi58

This comment has been minimized.

Sadi58 commented Oct 24, 2016

Unfortunately the problem has got worse in Ubuntu 16.10 with Nautilus 3.20.3: nothing can be moved to the "Rubbish Bin" anywhere (accessed directly or via symlink) in an NTFS partition on an internal hard disk now (the reason given for this is "Unable to find or create wastebasket directory" and manually creating such a directory leads to nothing) although no such problem exists for removable media such as USB hard disks.

I wish I knew how to compile libglib from source (https://launchpad.net/ubuntu/+source/glib2.0/2.50.0-1) excluding that patch apparently causing this annoying side effect: https://sources.debian.net/patches/glib2.0/2.50.1-1/0001-Fix-trashing-on-overlayfs.patch/

Maybe you can also include step-by-step instructions for this???

@AntoniosHadji

This comment has been minimized.

AntoniosHadji commented Oct 26, 2016

This worked on my install of 16.04.01. How can I make this change in code instead of using the binary patch?

@CzBiX

This comment has been minimized.

Owner

CzBiX commented Nov 11, 2016

@Sadi58 Sorry, but the steps is hard to say if you are not developer.
@AntoniosHadji compile source without debian/patches/0001-Fix-trashing-on-overlayfs.patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment