Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2005-11-29 19:14:29
Size: 2982
Editor: PeMac
Comment:
Revision 8 as of 2009-03-16 03:32:23
Size: 3221
Editor: anonymous
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
This is an example of an apt-get error caused by a file conflict, and
how to resolve it:
#language en
Line 4: Line 3:
   Unpacking replacement kdebase-libs ...
   dpkg: error processing
  
/var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb (--unpack):
    trying to overwrite `/usr/share/applnk/Settings/Sound/arts.desktop',
  
which is also in package kdebase
   dpkg-deb: subprocess paste killed by signal (Broken pipe)
   Errors were encountered while processing:
    /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb
   E: Sub-process /usr/bin/dpkg returned an error code (1)
== Error: trying to overwrite foo, which is also in package bar ==
This is an example of an [[apt-get]] error caused by a file conflict, and how to resolve it:{{{
Unpacking replacement kdebase-libs ...
dpkg: error processing /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb (--unpack):
trying to overwrite /usr/share/applnk/Settings/Sound/arts.desktop', which is also in package kdebase
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
}}}
Line 15: Line 15:
graceless transition of including a file in one package rather than the
other. The fix is as follows:
graceless transition of including a file in one package rather than the other. The fix is as follows:
Line 18: Line 17:
(1) Note down the names of the two packages that are both trying to
claim ownership of the same file. In this case, package kdebase-libs
is trying to update a file previously installed by package kdebase.
 1. Note down the names of the two packages that are both trying to claim ownership of the same file. In this case, package kdebase-libs is trying to update a file previously installed by package kdebase.
Line 22: Line 19:
(2) Stop and think for a moment about what's probably happening:  A
reasonable guess is that "arts.desktop" has simply been moved to
kdebase-libs, and your package database is being mulish because it
doesn't know this is OK.
 1. Stop and think for a moment about what's probably happening: A reasonable guess is that "arts.desktop" has simply been moved to kdebase-libs, and your package database is being mulish because it doesn't know this is OK.
Line 27: Line 21:
(3) Do a "--force-overwrite" install of the new package, thus:  1. Do a "--force-overwrite" install of the new package, thus: {{{
 dpkg -i --force-overwrite kdebase-libs_4%3a2.2.2-14_i386.deb
}}}
Line 29: Line 25:
   # dpkg -i --force-overwrite kdebase-libs_4%3a2.2.2-14_i386.deb  1. Recall and resubmit your apt-get command that choked, now that there's no remaining conflict.
Line 31: Line 27:
(4) Recall and resubmit your apt-get command that choked, now that
there's no remaining conflict.
On very rare occasions, apt-get might refuse to do anything because some particular named package is in some broken state it can't deal with. This is the error message : {{{
dkpg error processing kdebase-libs_4%3a2.2.2-14_i386.deb (--install)
cannot access archive: No such file or directory
Errors were encountered while processing:
kdebase-libs_4%3a2.2.2-14_i386.deb
}}}
Line 34: Line 34:
In such cases, you can make good use of the fact that Debian uses a plain ASCII file (/var/lib/dpkg/status) for its package database, to excise the problem directly: Make a backup copy of /var/lib/dpkg/status, first. (I've never needed this, but it seems such an easy precaution,why not?) Now, open /var/lib/dpkg/status in your favourite text editor (i.e. {{{editor}}} !).
Line 35: Line 36:
On very rare occasions, apt-get might refuse to do anything because
some particular named package is in some broken state it can't deal with.
[Need an example error message, but don't have one yet.]

In such cases, you can make good use of the fact that Debian uses a plain
ASCII file (/var/lib/dpkg/status) for its package database, to excise
the problem directly: Make a backup copy of /var/lib/dpkg/status,
first. (I've never needed this, but it seems such an easy precaution,
why not?) Now, open /var/lib/dpkg/status in your favourite text editor.
Line 49: Line 41:
Debian package records have selective amnesia: The system believes that
package to be not installed. Therefore, apt-get will cease stumbling on
the defective package entry: You can now do other apt-get operations,
and reinstall the problem package (overwriting its installed files) at
any future occasion, at your leisure.
Debian package records have selective amnesia: The system believes that package to be not installed. Therefore, apt-get will cease stumbling on the defective package entry: You can now do other apt-get operations, and reinstall the problem package (overwriting its installed files) at  any future occasion, at your leisure.
Line 55: Line 43:

If you wish to fix errors in a package's installation scripts, they're
in /var/lib/dpkg/info as packagename.postinst, packagename.preinst,
packagename.prerm, and/or packagename.postrm. Debug the error, edit the
script, and then re-run dpkg -i packagename. (This approach is greatly
to be preferred over using --force-something options or editing the
package database directly.)
If you wish to fix errors in a package's installation scripts, they're in /var/lib/dpkg/info as packagename.postinst, packagename.preinst, packagename.prerm, and/or packagename.postrm. Debug the error, edit the script, and then re-run dpkg -i packagename. (This approach is greatly to be preferred over using --force-something options or editing the package database directly.)

Error: trying to overwrite foo, which is also in package bar

This is an example of an apt-get error caused by a file conflict, and how to resolve it:

Unpacking replacement kdebase-libs ...
dpkg: error processing /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb (--unpack):
trying to overwrite /usr/share/applnk/Settings/Sound/arts.desktop', which is also in package kdebase
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

This happens because somebody made a bonehead packaging error, or a graceless transition of including a file in one package rather than the other. The fix is as follows:

  1. Note down the names of the two packages that are both trying to claim ownership of the same file. In this case, package kdebase-libs is trying to update a file previously installed by package kdebase.
  2. Stop and think for a moment about what's probably happening: A reasonable guess is that "arts.desktop" has simply been moved to kdebase-libs, and your package database is being mulish because it doesn't know this is OK.
  3. Do a "--force-overwrite" install of the new package, thus:

     dpkg -i --force-overwrite kdebase-libs_4%3a2.2.2-14_i386.deb
  4. Recall and resubmit your apt-get command that choked, now that there's no remaining conflict.

On very rare occasions, apt-get might refuse to do anything because some particular named package is in some broken state it can't deal with. This is the error message :

dkpg error processing  kdebase-libs_4%3a2.2.2-14_i386.deb (--install)
cannot access archive: No such file or directory
Errors were encountered while processing:  
kdebase-libs_4%3a2.2.2-14_i386.deb

In such cases, you can make good use of the fact that Debian uses a plain ASCII file (/var/lib/dpkg/status) for its package database, to excise the problem directly: Make a backup copy of /var/lib/dpkg/status, first. (I've never needed this, but it seems such an easy precaution,why not?) Now, open /var/lib/dpkg/status in your favourite text editor (i.e. editor !).

Search for "Package: <packagename>", which will bring up a series of non-blank lines comprising the package's status entry. Remove everything up to the first blank line. Save.

Now, the package's files, themselves, are still installed, but the Debian package records have selective amnesia: The system believes that package to be not installed. Therefore, apt-get will cease stumbling on the defective package entry: You can now do other apt-get operations, and reinstall the problem package (overwriting its installed files) at any future occasion, at your leisure.

If you wish to fix errors in a package's installation scripts, they're in /var/lib/dpkg/info as packagename.postinst, packagename.preinst, packagename.prerm, and/or packagename.postrm. Debug the error, edit the script, and then re-run dpkg -i packagename. (This approach is greatly to be preferred over using --force-something options or editing the package database directly.)