Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I go to install a software, I encounter this error..Therefore I cannot get update..

Preconfiguring packages ...
dpkg: error: parsing file '/var/lib/dpkg/status' near line 51245 package 'oracle-xe':
 mixed non-coinstallable and coinstallable package instances present
N: Ignoring file 'gcl' in directory '/etc/apt/sources.list.d/' as it has no filename extension
N: Ignoring file 'gcl' in directory '/etc/apt/sources.list.d/' as it has no filename extension
E: Sub-process /usr/bin/dpkg returned an error code (2)
share|improve this question

1 Answer 1

Lucky you! You have backups! And even more, they are made daily without you knowing! So, to restore the files just run:

sudo rm /var/lib/dpkg/status
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
sudo apt-get update

Done!

If you need even older files there are more from where to pick:

ls /var/backups/dpkg.status*
/var/backups/dpkg.status.0     /var/backups/dpkg.status.4.gz
/var/backups/dpkg.status.1.gz  /var/backups/dpkg.status.5.gz
/var/backups/dpkg.status.2.gz  /var/backups/dpkg.status.6.gz
/var/backups/dpkg.status.3.gz

Just uncompress them using gunzip:

gunzip -c /var/backups/dpkg.status.6.gz > /var/lib/dpkg/status

If the backups are no good, another way is doing a list of the doc directory contents:

sudo -i
ls /usr/share/doc | \
      grep -v [A-Z] | \
      grep -v '^texmf$' | \
      grep -v '^debian$' | \
      awk '{print $1 " install"}' | \
      dpkg --set-selections

http://www.debianhelp.co.uk/debianproblem.htm

share|improve this answer
    
thank god I have another status-old to do the recovery. After cp it to the right, enter sudo dpkg --configure -a fix all problem! Thanks! –  Robert Jan 10 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.