How to keep APT from reinstalling custom packages (Ubuntu)
A few weeks ago, I finally got around to upgrading my Ubuntu desktop to Hardy Heron. Like many others, I found that the cursor in gnome-terminal had inexplicably started blinking again, and there was no longer a preference to disable it. Fortunately, finding a fix was easy. Applying the patch and rebuilding the
.deb package was even easier. But after installing the patched package, the update-notifier immediately informed me that there was one update available: gnome-terminal. It seems that APT prefers packages in the repository over locally installed packages.
I ignored this for a while, and just dealt with the “updates available” icon always being in the notification area. I tried searching google several times, and eventually came across this forum post, which led to this article containing the answer I was looking for.
I could probably just pin gnome-terminal, but I want to make sure I get any future updates for it. I decided the easiest way to fix this annoyance was by appending a short string (
+noblink) to the version.
First, fetch the source and update the version:
$ apt-get source gnome-terminal $ cd gnome-terminal-2.22.1 $ debchange -v 2.22.1-0ubuntu2+noblink
At this point, the default editor will open the
debian/changelog file so you can describe the change. Enter a short comment, like “disable the blinkin cursor”, save the file and exit the editor.
Next, patch the source. Jay Cornwall’s patch is not currently on-line, but it’s a simple fix: just edit
src/terminal-screen.c and change this line
terminal_widget_set_cursor_blinks (screen->priv->term, blink);
terminal_widget_set_cursor_blinks (screen->priv->term, FALSE);
Finally, build and install the package:
$ debuild -rfakeroot binary $ sudo dpkg -i ../gnome-terminal*.deb