9

I made the mistake of installing Jenkins from the ubuntu package, which causes endless stress around here in update management. I have no quarrel with how Ubuntu arranged the files on disk.

For the curious, jenkins has an internal package manager that downloads plugin updates, and careful coordination of main jenkins installs and plugin upgrades is required to avoid chaotic conditions. So we haver to carefully block jenkins upgrades via, oh, apt-get upgrade when we don't know exactly what's going on with the plugins.

So, what I'd like to do is persuade dpkg / apt-get to forget that there is a jenkins package, without letting it delete any existing files.

By the way, the 'install' consists of one '.war' file plus the /etc/init.d links.

Obviously, I can backup up what I care about, remove the package, and restore, but I was hoping to learn that there was an obscure dpkg option that forgot to delete files.

Is there a way?

3
  • You would have to install it outside of apt-get, from source (make install) or by backing up all the files, removing the package, and restoring the files from back up. I think this is a lousy solution to your problem, perhaps if you described the problem better we can give you a better solution.
    – Panther
    Dec 6, 2011 at 23:09
  • he described the problem fine. pseudo-packages can solve almost anything. you could solve this with an empty pseudopackage. Dec 7, 2011 at 0:07
  • How would an empty pseudopackage fix anything? He wants apt-get to forget that package is installed so it won't upgrade.
    – tgm4883
    Dec 7, 2011 at 0:20

2 Answers 2

10

The 'best' way to do this, is by manipulating /var/lib/dpkg/status.

HOWEVER!

That file has a sensitive syntax; Doing it the wrong way may break your package management.

Here is what you have to do:

Find a block that looks a little like this (The actual look may depend on the package you're trying to make 'invisible'):

Package: xserver-xorg-input-vmmouse
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 136
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Version: 1:12.7.0-2
Provides: xorg-driver-input
Depends: libc6 (>= 2.7), xorg-input-abi-12, xserver-xorg-core (>= 2:1.10.0-0ubuntu1~), xserver-xorg-input-mouse, udev
Description: X.Org X server -- VMMouse input driver to use with VMWare
 This package provides the driver for the X11 vmmouse input device.
 .
 The VMMouse driver enables support for the special VMMouse protocol
 that is provided by VMware virtual machines to give absolute pointer
 positioning.
 .
 The vmmouse driver is capable of falling back to the standard "mouse"
 driver if a VMware virtual machine is not detected. This allows for
 dual-booting of an operating system from a virtual machine to real hardware
 without having to edit xorg.conf every time.
 .
 More information about X.Org can be found at:
 <URL:http://www.X.org>
 .
 This package is built from the X.org xf86-input-vmmouse driver module.
Original-Maintainer: Debian X Strike Force <[email protected]>

The first statement Package: <name> is where you have to look for, where <name> is the name of the package you want to remove.

Each block begins with a Package: <name> line, and ends with the next Package: line, BUT do not remove the next Package: statement!

If you keep that in mind, the package will no longer appear to be installed to dpkg; despite all the files still being available.

This is a terrible hack at best, but works just fine, I've done it a few times in the past myself, in a time when Ubuntu was still struggling with broken packages sometimes. I do not recommend it, it's a last resort option.

1
  • VERY nice (hack) to have in the toolbox!... Saved me hours of battling with a vendor package (zoom + libxcb-xtest0 deps) <sigh>
    – Tweeks
    May 7, 2020 at 4:25
3

Still very helpful even if a hack. An added suggestion is to similarly remove the unwanted package from /var/lib/dpkg/available and to remove all of the {package}.* files from /var/lib/dpkg/info/

I used this when I decided to install a newer version of a piece of software from source, that had previously been installed as the Ubuntu-released version. First I downloaded and built / installed the new version that I wanted, then used this hack to make dpkg forget about the older Ubuntu-released version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .