0

How can I trick apt-get to believe that a dependency of an about to be installed package is already installed, so that the referencing package can be installed without installing the dependency ?
Do I have to edit /var/lib/dpkg/status ?

In my real-world case I want to install nagios without having to install mailx and postfix.
I made a shell script /usr/local/bin/mailx that uses msmtp to send mail remotely and linked that to /usr/bin/mailx using update-alternatives. So I don't need and don't want a local mail infrastructure installed, but nagios3-common depends on bsd-mailx | mailx.

apt-get --force-yes install nagios3-common does not help, neither does defining a negative priority for *mail* packages in /etc/apt/preferences.

Juergen
  • 502
  • 1
    Easiest is to unpack the .deb, modify the control file, i.e. remove the dependency in question. Then repack & install the redone .deb. I've a script that makes the task quite simple if you'd like. – doug Mar 02 '17 at 01:58

1 Answers1

0

Solution for my real-world case:

apt-get install --no-install-recommends equivs
echo -e 'Package: mailx-dummy\nProvides: mail, mailx\nDescription: fake mail/mailx' > mailx-dummy.ctl
equivs-build mailx-dummy.ctl && dpkg -i mailx-dummy*.deb
apt-get install --no-install-recommends nagios3

Yes, this is a duplicate of How to fake a package version installed.
Did not mark this question as a duplicate because this is a specific four-line-solution for installing nagios without mailx and postfix and might be helpful besides the original question.

Juergen
  • 502