Friday, July 17, 2009

Problem with Debian "apt-get upgrade"


Recently when attempting to upgrade a server that was being neglected we ran across an issue with Debian stating.

trying to overwrite `/usr/sbin/add-shell’, which is also in package passwd

The solution was simple and was required on a few similar errors where the overwrite and package names changed. Again we had really neglected this server and had not run the apt-get upgrade in a long time.

The fix?
dpkg -r --force all passwd
apt-get -f install

To explain briefly the "dpkg -r --force" forces the removal of the package "passwd". The "all" switch turns on(or off) all force options. An important note taken directly from the dpkg man page.
Warning: These options are mostly intended to be used by experts only. Using them without fully understanding their effects may break your whole system.

If you are worried and do not understand the possible risks DO NOT run the above dpkg command. The "apt-get -f install" is less risky but again, research before you apply.

No comments: