Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jun 2006 00:39:18 +1000
From:      Mikhail Goriachev <mikhailg@webanoide.org>
To:        Lewis McLouth <lmclouth@mn.rr.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: pkgdb.db locked
Message-ID:  <4496B716.7080505@webanoide.org>
In-Reply-To: <44960EDC.2020906@mn.rr.com>
References:  <44960EDC.2020906@mn.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Lewis McLouth wrote:
> Hello.
> 
> When I run the command pkgdb -Fu, I get the response
> 
> [Rebuilding the pkgdb <format:dbm_hash> in /var/db/pkg ... can't convert
> String into Integer: Cannot update the pkgdb!]
> 
> I think I know where I goofed, so here's the story on my suspected mistake.
> 
> I just upgraded from RELENG_5_4 to RELENG_6, which went fairly smooth. 
> I'm now upgrading my ports but I was foolish today and ran portupgrade
> without first reading /usr/ports/UPDATING.  I think this is the source
> of my problem (as in, running the command.  Of course not reading
> UPDATING is another problem! but I don't need help with that).
> So, I first ran
> 
> portupgrade -arR
> 
> portupgrade did not upgrade linux_base-8 and instead reported that it
> was marked as IGNORE and to use linux_base-fc-4.  So, I ran the commands
> 
> cd /usr/ports/emulators/linux_base-8
> make deinstall
> cd ../linux_base-fc-4
> make install clean
> 
> This it did fine, but when I now try to run pkgdb -Fu, I get the
> following output:
> 
> [Rebuilding the pkgdb <format:dbm_hash> in /var/db/pkg ... can't convert
> String into Integer: Cannot update the pkgdb!]
> 
> I then read /usr/ports/UPDATING, saw that linux_base-8 was dropped and
> replaced by linux_base-fc-4.
> 
> So, I then did the suggested command.
> 
> portupgrade -f -o emulators/linux_base-fc4 linux_base\*
> 
> This produced
> 
> [Rebuilding the pkgdb <format:dbm_hash> in /var/db/pkg ... [Rebuilding
> the pkgdb <format:dbm_hash> in /var/db/pkg ... ** Database file locked.
> Waiting.
> ** Timeout. Lock looks dead. Remove it.
> /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:261:in `origin': can't
> convert String into Integer: Cannot update the pkgdb!] (PkgDB::DBError)
>        from /usr/local/lib/ruby/site_ruby/1.8/pkginfo.rb:178:in `origin'
>        from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:977:in `tsort_build'
>        from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:971:in `tsort_build'
>        from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:993:in `sort_build'
>        from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:997:in `sort_build!'
>        from /usr/local/sbin/portupgrade:705:in `main'
>        from /usr/local/lib/ruby/1.8/optparse.rb:815:in `initialize'
>        from /usr/local/sbin/portupgrade:216:in `main'
>        from /usr/local/sbin/portupgrade:2048
> 
> I've googled for the phrase 'pkgdb "Lock looks dead"' and various
> combinations of the output hoping to learn how to unlock pkgdb.db but
> with no luck.  Plus, I cannot locate pkgdb.dg with
> 
> ls -a /var/db/pkg
> 
> My questions are:  How do I remove the lock on pkgdb?  Where does
> pkgdb.db go when its locked? find does not locate it.  I ran
> 
> find / pkgdb.db | grep pkgdb.db
> find: pkgdb.db: No such file or directory
> 
> Also, if pkgdb.db was deleted, how do I rebuild the pkgdb.db? (pkgdb -f
> does not rebuild pkgdb.db, I just checked)
> 
> The output of uname -a and ls /var/db/pkg are attached.
> 
> Any help would be appreciated.
> 


Hi,

I'm not an expert, but I'll chuck my 2c in this. I once had a
disagreement with pkgdb myself. The conflict ended up by removing the
contents of:

/var/db/ports
/var/db/pkg

Before that, I deinstalled all packages though.

After the cleansing session, I reinstalled all ports from scratch. pkgdb
is happy now. The thing is, I only had around 10 packages installed, so
rebuilding them wasn't an issue for me. For sure that was dirty but quick.

Cheers,
Mikhail.


-- 
Mikhail Goriachev
Webanoide

Telephone: +61 (0)3 62252501
Mobile Phone: +61 (0)4 38255158
E-Mail: mikhailg@webanoide.org
Web: http://www.webanoide.org

PGP Key ID: 0x4E148A3B
PGP Key Fingerprint: D96B 7C14 79A5 8824 B99D 9562 F50E 2F5D 4E14 8A3B



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4496B716.7080505>