So I’ve got Debian packages made from lots of large proprietary software titles, but one of them (Hyperworks) had been throwing errors on several of the systems I tried to install it on, normally something like:
Setting up hyperworks8 (8.1+0.2) ...
update-alternatives: slave link name /usr/bin/amfbuilder duplicated
dpkg: error processing hyperworks8 (--configure): subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
hyperworks8
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried lots of quick fixes:
- purge, clean, and reinstall — no good.
- purge, clean, clear out /etc/alternatives and /usr/bin of any detritus from earlier package versions — no luck there, either
- edit /var/lib/dpkg/info/hyperworks8.postinst to remove the amfbuilder line — that just moved the error onto another program included in the package
Finally, I found a /var/lib/dpkg/alternatives/hw file and removed it. It contained nothing but my Hyperworks-related settings, so that was safe. Afterwards, no more errors.