How to fake a package version installed?
Solution 1:
Despite an answer being already accepted, inlining the accepted better conveys the process:
There is a Debian package called
equivs
that is able to create dummy packages. Install it by runningsudo apt-get install -y equivs
Once installed, you generate a template "control" file using the following command:
equivs-control postfix
(replacepostfix
with your package name). In my case, I might use an alternate package name, e.g.postfix-custom
or whatever but have my custom package fulfill orProvides
the installation dependency ofpostfix
(again replacingpostfix
for whatever package you want.Once the template control file is generated, I will typically remove a lot of the commented out statements (statements that begin with
#
). One that I like to keep specifically is theProvides:
statement where I can say that my package provides the capability offered by the other package that I'm trying to fake, e.g.Provides: postfix
tells the Debian/Ubuntu dependency resolution mechanism that my package—of whatever name—provides the same capabilities of the target package, againpostfix
or whatever. This allows me to name my package independently of the target package to avoid confusion. Erlang Factory does this with their stuff, e.g.esl-erlang
provideserlang
.Finally, once the template control file is created, you use
equivs-build
to generate the fake package, e.g.equivs-build /path/to/generated/control/file
.It takes a few seconds to build the package and then you can run
sudo dpkg -i my_package_name*.deb
For advanced users, if your template control file has a Requires:
dependency line, you may want to use a tool like gdebi
to install your package as well as the various the packages it declares as dependencies.
Solution 2:
You can use the equivs
package to create a dummy package to fake a given package being installed. Some instructions here.