Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#535138: dpkg: upgrading dpkg to 1.15.3 fails

1 view
Skip to first unread message

Craig Sanders

unread,
Jun 29, 2009, 10:50:09 PM6/29/09
to

Package: dpkg
Version: 1.15.3
Severity: normal

upgrading dpkg fails with "/var/lib/dpkg/tmp.ci/preinst: line 38: read: read error: 0: Is a directory"


# apt-get install dpkg
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
[...deleted...]
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
dpkg
1 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Need to get 0B/2211kB of archives.
After this operation, 16.4kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
dpkg
Authentication warning overridden.
(Reading database ... 449943 files and directories currently installed.)
Preparing to replace dpkg 1.15.2 (using .../archives/dpkg_1.15.3_amd64.deb) ...
/var/lib/dpkg/tmp.ci/preinst: line 38: read: read error: 0: Is a directory
dpkg: error processing /var/cache/apt/archives/dpkg_1.15.3_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/dpkg_1.15.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg depends on:
ii coreutils 7.4-2 The GNU core utilities
ii libc6 2.9-18 GNU C Library: Shared libraries
ii lzma 4.43-14 Compression method of 7z format in

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii apt 0.7.21 Advanced front-end for dpkg

-- no debconf information

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Raphael Hertzog

unread,
Jun 30, 2009, 3:10:13 AM6/30/09
to
On Tue, 30 Jun 2009, Craig Sanders wrote:
> upgrading dpkg fails with "/var/lib/dpkg/tmp.ci/preinst: line 38: read:
> read error: 0: Is a directory"

What do you have in /var/lib/dpkg/alternatives/ ?

Please give the output of "ls -alR /var/lib/dpkg/alternatives/".

I suspect that you have an (unexpected) directory and that we should
modify kill_bad_alternatives() to skip non-files.

--- a/debian/dpkg.preinst
+++ b/debian/dpkg.preinst
@@ -30,8 +30,9 @@ kill_bad_alternatives () {
local IFS=""
ALTDIR="/var/lib/dpkg/alternatives"
for alt in $ALTDIR/*; do
- if [ ! -e $alt ]; then
- # In case it's been removed by the code below
+ if [ ! -f $alt ]; then
+ # In case it's been removed by the code below, or in case
+ # it's not a real file
continue
fi
{

Cheers,
--
Raphaël Hertzog

Contribuez à Debian et gagnez un cahier de l'admin Debian Lenny :
http://www.ouaza.com/wp/2009/03/02/contribuer-a-debian-gagner-un-livre/

Craig Sanders

unread,
Jul 1, 2009, 10:10:07 PM7/1/09
to
Raphael Hertzog wrote:
> On Tue, 30 Jun 2009, Craig Sanders wrote:
>> upgrading dpkg fails with "/var/lib/dpkg/tmp.ci/preinst: line 38: read:
>> read error: 0: Is a directory"
>
> What do you have in /var/lib/dpkg/alternatives/ ?
>
> Please give the output of "ls -alR /var/lib/dpkg/alternatives/".
>
> I suspect that you have an (unexpected) directory and that we should
> modify kill_bad_alternatives() to skip non-files.

yep, that's correct.

i had a directory in there called "junk" containing corrupted files
that i moved in there (from a crash during a previous apt-get upgrade -
problems with the intel graphics driver a few months ago, the machine
would lock up whenever X was restarted). i had meant to delete that dir
after repairing the system but forgot to.

i deleted the directory and was able to upgrade dpkg with no problem.

your patch looks like a good thing to do anyway.

craig

--
Craig Sanders <csan...@unimelb.edu.au>
Systems Administrator
School of Chemistry
University of Melbourne
Ph: +61 3 9035-8072

0 new messages