LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-07-2008, 07:58 AM   #1
San-Raal
LQ Newbie
 
Registered: Apr 2008
Distribution: debian, redhat el4
Posts: 18

Rep: Reputation: 0
apt cannot be upgraded, and problem with /var/lib/dpkg/status


Hi there, my first post here, so please don't be hard on me :-P

I am having a problem with a new installation of Debian 2.6

I installed it without problems, tryied to update, but then i got into a problem with the "apt" package. It probably started to update the package, but the packages on which "apt" depends aren't upgraded...

If i try to "apt-get update"
Code:
mpisrv2:~# apt-get update
.
.
Hit http://security.debian.org stable/updates/non-free Packages
Hit http://security.debian.org stable/updates/non-free Release
Reading Package Lists... Error!
E: Unable to parse package file /var/lib/dpkg/status (1)
E: The package lists or status file could not be parsed or opened.
I tried to check wether the status file is ok, but everything seems OK... just the status of one package is "weird" :-)
/var/lib/dpkg/status file, part with apt
Code:
Package: apt
Status: install ok unpacked
Priority: important
Section: base
Installed-Size: 4216
Maintainer: APT Development Team <deity@lists.debian.org>
Architecture: i386
Version: 0.6.45
Config-Version: 0.5.28.6
Replaces: libapt-pkg-doc (<< 0.3.7), libapt-pkg-dev (<< 0.3.7)
Provides: libapt-pkg-libc6.3-6-3.11
Depends: libc6 (>= 2.3.6-6), libgcc1 (>= 1:4.1.0), libstdc++6 (>= 4.1.0)
Recommends: debian-archive-keyring
Suggests: aptitude | synaptic | gnome-apt | wajig, dpkg-dev, apt-doc, bzip2, gnupg
Conffiles:
 /etc/cron.daily/apt newconffile
Description: Advanced front-end for dpkg
 This is Debian's next generation front-end for the dpkg package manager.
 It provides the apt-get utility and APT dselect method that provides a
 simpler, safer way to install and upgrade packages.
 .
 APT features complete installation ordering, multiple source capability
 and several other unique features, see the Users Guide in apt-doc.
If i try to finish the installation of apt, it tells me to:
Code:
mpisrv2:~# dpkg --configure apt
dpkg: dependency problems prevent configuration of apt:
 apt depends on libc6 (>= 2.3.6-6); however:
  Version of libc6 on system is 2.3.2.ds1-22sarge5.
 apt depends on libgcc1 (>= 1:4.1.0); however:
  Version of libgcc1 on system is 1:3.4.3-13sarge1.
 apt depends on libstdc++6 (>= 4.1.0); however:
  Package libstdc++6 is not installed.
dpkg: error processing apt (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 apt
The problem is i cannot update the libraries, because of the first problem with the /var/lib/dpkg/status file. I already tried the status-old file, but with no effect.

Any suggestions how to get a correct /var/lib/dpkg/status file or update the apt package, or the libraries?
 
Old 04-07-2008, 08:07 AM   #2
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Rep: Reputation: 33
When you installed Debian, did you install Sarge or Etch?
 
Old 04-07-2008, 08:13 AM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Looking at the posted output of dpkg --configure apt, San-Raal is running Sarge.

@San-Raal:
Please switch to Etch - strictly for the fact that Sarge is in the "obsolete" section of the Debian repositories. If you're worried about the size of the download, under the "Small CDs" heading, go to the second row where the processor architectures are listed. Those installers are only 40MB in size, but they require you have an internet hookup as they are netinstall CDs.
 
Old 04-07-2008, 08:14 AM   #4
San-Raal
LQ Newbie
 
Registered: Apr 2008
Distribution: debian, redhat el4
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mikieboy View Post
When you installed Debian, did you install Sarge or Etch?
I've installed Sarge.
 
Old 04-07-2008, 08:16 AM   #5
San-Raal
LQ Newbie
 
Registered: Apr 2008
Distribution: debian, redhat el4
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by indienick View Post
Looking at the posted output of dpkg --configure apt, San-Raal is running Sarge.

@San-Raal:
Please switch to Etch - strictly for the fact that Sarge is in the "obsolete" section of the Debian repositories. If you're worried about the size of the download, under the "Small CDs" heading, go to the second row where the processor architectures are listed. Those installers are only 40MB in size, but they require you have an internet hookup as they are netinstall CDs.
Thanks for the advice, but the problem is, this server is in production about a half-year, and I cannot simply reinstall it now... Just need to update it at least, and that's what I am trying to do.
 
Old 04-07-2008, 10:13 AM   #6
redgoblin
Member
 
Registered: Jun 2005
Location: UK
Distribution: Debian
Posts: 189

Rep: Reputation: 41
You have a couple of problems here; you seem to be mixing versions in your repositories and you're using an older version of Debian.

Debian GNU/Linux 3.1 (aka Sarge) was replaced by Debian GNU/Linux 4.0 (aka Etch) on the 8th of April 2007. From that point onward Sarge stopped being the stable version of Debian and became what is known as 'old stable'. Debian supports 'old stable' for about a year, giving users a large enough window to upgrade. But unfortunately they can't support it forever. Support for Sarge ended last Monday;

http://www.debian.org/News/2008/20080229

You really ought to consider making the jump upto Etch. I appreciate that if this is a production server then that's a serious step. However, you will be receiving no further security update for the packages you have installed.

This change in version is related to your second problem. If you look at the output of apt-get update, you have the line;

Code:
Hit http://security.debian.org stable/updates/non-free Packages
You seem to be updating against the security updates for stable and as I stated earlier stable is now Etch and not Sarge. The reason you get problems is because the security update expects a later version of libc6 than you have (i.e. the one that's in Etch rather than the one that's in Sarge). Do you know how long this has been going on?

The first thing you should do is stabilise your system. This is what I would try to do, but considering this is your production server proceed with caution as I may well be wrong.

1) Edit the file /etc/apt/sources.list and change ALL occurrences of stable with sarge. This will make sure you are updating against the correct repositories.

2) You need to clean out your packages. This is just stuff in the cache, not the actual programmes themselves. To do this use;

Code:
apt-get clean
3) Now you want to try updating with the usual apt-get update

If that all resolves well then you are now up to date with all your patches for the old stable version of Debain.

At this point you need to decide what policy you want to follow. If you're server is not exposed to any hostile environment (like the rest of the world) and your project doesn't have long to run, then leave it as it is. It's possibly the least hassle. If however this isn't the case then you really need to plan for an upgrade. An upgrade can be done without having to reinstall the OS. However, this may have an effect on whatever non Debian software you have installed on the system.

If you decide to go for an upgrade read as much as you can first;

http://wiki.debian.org/Sarge2EtchUpgrade

Then build a duplicate Sarge server with your extra settings and software installed. Bring it up to date with the patches for old stable and then try an upgrade on it. It's always better to break something that isn't in use.

Good luck and let us know if that helps at all.

Last edited by redgoblin; 04-07-2008 at 10:15 AM. Reason: Spelling
 
Old 04-07-2008, 10:17 AM   #7
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Rep: Reputation: 33
Sarge is oldstable. To use the stable repositories will involve you carrying out apt-get dist-upgrade. But first you're going to have to sort out your existing dpkg library.
I suggest you edit your /etc/apt/sources.lst to point to oldstable instead of stable. You should then be able to run apt-get update, apt-get upgrade to bring your Sarge install up to date. From there read the Debian release notes for the upgrade to Etch.

http://www.debian.org/releases/stabl...rading.en.html

Redgoblin types faster than me :-)

Last edited by mikieboy; 04-07-2008 at 10:19 AM.
 
Old 04-07-2008, 11:25 AM   #8
San-Raal
LQ Newbie
 
Registered: Apr 2008
Distribution: debian, redhat el4
Posts: 18

Original Poster
Rep: Reputation: 0
Many thanks for the quick replies, never tought that it would be that fast :-)

Just a small update on the situation:
To be honest, I was kinda "forced" into this situation half year ago, when I had 3 hours to get a system online(4:00 in the morning, till 7:00), and no other CDs than the old sarge ones, and no time to download. Then I found out that the application was designed for RedHat, so had to install it from RPM packages the hard way. After this procedure I was happy it was online, and labeled the server "don't touch, we are happy it's running"... Now I will try to get the updates working(so I can install some packages I need), but in a few months the application will be definitely moved to a new server.

The sources.list file was just copied today from another, newer server with etch, because I was really desperate about this problem, and previously had issues with a local Debian mirror not being set-up correctly. So I just gave it a try, but with no effect.

Anyways, I corrected the sources.list config file as you recommended but I am still on the same status.
Code:
mpisrv2:~# apt-get clean
mpisrv2:~# apt-get update
.
.
Hit http://security.debian.org oldstable/updates/non-free Packages
Hit http://security.debian.org oldstable/updates/non-free Release
Reading Package Lists... Error!
E: Unable to parse package file /var/lib/dpkg/status (1)
E: The package lists or status file could not be parsed or opened.
Any suggestions? Isn't there a way of getting rid of this problem just by removing any entries in the status file, or somehow removing the new apt that is trying to get installed?
 
Old 04-07-2008, 03:34 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I think your problem is right here:
Quote:
Version: 0.6.45
Config-Version: 0.5.28.6

dpkg: dependency problems prevent configuration of apt:
apt depends on libc6 (>= 2.3.6-6); however:
Version of libc6 on system is 2.3.2.ds1-22sarge5.

SARGE
Package: apt (0.5.28.6)
libc6 (>= 2.3.2.ds1-4)

ETCH
Package: apt (0.6.46.4-0.1)
libc6 (>= 2.3.6-6) [i386]

The last version of apt for oldstable (SARGE) was 0.5.28.6 which used libc6 2.3.2

Your system is trying to install apt 0.6.45 (ETCH) which requires libc6 2.3.6 which is only available in etch

You might want to just manually install the correct version of apt for sarge from the manually downloaded deb file..

dpkg -i apt_0.5.28.6_i386.deb


http://packages.debian.org/sarge/apt

Last edited by farslayer; 04-07-2008 at 03:37 PM.
 
Old 04-08-2008, 07:41 AM   #10
San-Raal
LQ Newbie
 
Registered: Apr 2008
Distribution: debian, redhat el4
Posts: 18

Original Poster
Rep: Reputation: 0
I got it ALL solved, thanks to LQ :-)

Code:
dpkg -i apt_0.5.28.6_i386.deb
Just re-installing the apt did the first trick, to get back the wrong package, that came from the sarge/etch problem.

But then the /var/lib/dpkg/status file was still corrupted. I tried all the backups i had (status-old, /var/backups/dpkg.status), but with no effect. The first status backup file from server installation date was also "corrupted" and didn't work.

So I tried a script for rebuilding the status file, not 100% correct, but after some tinkering(removing the "Size:" parameter from the status-new file) it did the job.
Code:
#!/bin/bash

get_control_info ()
{
for i in /var/lib/apt/lists/*_Packages
do
sed '/Package: '"$1"'$/,/^$/!d' $i
done
}

for i in /var/lib/dpkg/info/*.list
do
package_name=`basename $i | sed 's/.list$//'`
get_control_info $package_name >> status-new
done

sed -i -e '/^Filename: .*/d' -e '/^MD5sum:/d' -e '/^SHA1:/d' -e '/^SHA256:/d' status-new
sed -i '/^Package: /a\Status: install ok installed' status-new
Now the system is running and up to date, and apt is working. Many thanks to all of you :-)

EDIT: Preparing for the sarge>etch upgrade...

Last edited by San-Raal; 04-08-2008 at 07:43 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) phreakshew Linux - Newbie 24 04-12-2019 10:42 AM
Unable to lock the administration directory (/var/lib/dpkg/) cccc Debian 11 12-05-2017 08:33 PM
APT/dpkg errors! /var/lib/dpkg/status bassclarinet Debian 16 12-01-2011 09:24 AM
dpkg is dead! error in /var/lib/dpkg/available dezert_fox Debian 4 11-22-2011 10:28 AM
Files in /var/lib/dpkg directory kushalkoolwal Debian 3 05-04-2007 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration