Skip to content

Instantly share code, notes, and snippets.

@CzBiX
Last active June 6, 2021 07:25
Show Gist options
  • Save CzBiX/e64256b23687bb13da02 to your computer and use it in GitHub Desktop.
Save CzBiX/e64256b23687bb13da02 to your computer and use it in GitHub Desktop.
#!/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
Copy link

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
Copy link
Author

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
Copy link

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

@CzBiX
Copy link
Author

CzBiX commented May 5, 2016

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

@mohicanb
Copy link

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
Copy link

mcg commented Aug 24, 2016

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

@CzBiX
Copy link
Author

CzBiX commented Aug 29, 2016

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

@mcg
Copy link

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
Copy link

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
Copy link

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

@CzBiX
Copy link
Author

CzBiX commented Nov 11, 2016

@Sadi58 Sorry, but the steps are hard to teach 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