For various reasons, I have a package on my Debian system which cannot configure itself properly. I know why and I don't want to correct the problem right now.

However, I want to avoid apt trying to configure it each time I install an unrelated package (for at least 20 seconds). To do so, I would like to flag this package as being configured, even if it is not. That is, make apt believe that it is configured. How can I do that?

Some context: if you must know, my mysql database is corrupted. I will fix that later, but I did upgrade my mysql-server package in the meanwhile, and since that time, as the configuring script cannot succeed to launch the db-server, it fails, making apt painful to use.


The easiest thing to do is let it configure it, but alter the configuration script to do nothing. When dpkg "configures" a package, what is really doing is executing the post installation script for the package. To force the configuration to succeed, you can alter the post installation script to make it a no-op script.

The maintainer scripts are stored in /var/lib/dpkg/info. For your example, you can replace /var/lib/dpkg/info/mysql-server-5.5.postinst with the following:

exit 0

Or you can simply add an exit 0 to the existing script.

  • Thanks, that's something I already thought of. However, I think one can directly edit the apt "database" to change that status, don't you? – Totor Feb 2 '14 at 4:35
  • 1
    @Totor This is a dpkg issue, not apt. You could hand edit /var/lib/dpkg/status, but I wouldn't recommend going that route. – jordanm Feb 2 '14 at 7:15
  • 1
    @Totor Seconded. I recommend you follow jordan's suggestion. – Faheem Mitha Feb 2 '14 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.