[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: corrupt/lost dpkg files, dpkg broken, aptitude broken, help :(



On 6/9/2013 10:57 AM, Brian wrote:
> On Sat 08 Jun 2013 at 18:39:45 -0500, Stan Hoeppner wrote:
> 
>> On 6/8/2013 4:43 AM, Brian wrote:
>>>
>>> apt/aptitude have their own idea of what packages are available and do
>>> not use what is in /var/lib/dpkg/available. So you should not have any
>>> problem with installing.
>>
>> Others mentioned this.  If this is the case, why does "aptitude remove
>> --purge" throw an error trying to read /var/lib/dpkg/available.  This
>> would suggest aptitude calls dpkg during package removal.  Is this the case?
> 
> When apt and aptitude install they use
> 
>    dpkg -i package.deb

Right.

> and dpkg wants to open /var/lib/dpkg/available as it may need to write
> to it to update the list of packages it knows about. The file can be
> empty (making it useless to dselect and 'dpkg --print-avail') but is has
> to exist for a package to install.
> 
> Removing a package involves
> 
>    dpkg -r package_name
> 
> My understanding is that dpkg does not need to open the available file
> in this case, so I cannot understand why your aptitude command does not
> complete successfully.

Apparently it does need to open it.  Or, at least, it 'wants' to.

>>> You could forget about /var/lib/dpkg/available and carry on as you
>>> usually do. Alternatively, if it bothers you, either install dselect
>>> and do
>>>
>>>    dselect update
>>>
>>> or download a Packages.gz file and execute
>>>
>>>    dpkg --update-avail Packages
>>
>> I strictly use "aptitude" for package management.  But it appears
>> aptitude is not entirely standalone.  Or, is aptitude simply attempting
>> to keep all of the package lists up to date across the other package
>> management tools?
> 
> /var/lib/dpkg/available is mainly of use to dselect. apt and aptitude
> maintain  their own separate, independent package lists in /var/lib. It
> was incorrect of me to say 'apt-get update' or 'aptitude update' would
> rebuild /var/lib/dpkg/available.

Confirmed, they don't rebuild it.  However, I installed a single package
with aptitude, and the package info was written into
/var/lib/dpkg/available

Aptitude doesn't appear to need this file, but it calls dpkg for actual
installation and removal of packages.  And dpkg apparently does need to
access this file.

Thankfully I got it working, and can add/remove packages.  That's the
important part.  I couldn't upgrade this box to Wheezy with this being
broken.  Just need to get some other things straightened out before the
upgrade.

-- 
Stan



Reply to: