LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   dpkg is messing up for me. Help! (https://www.linuxquestions.org/questions/linux-software-2/dpkg-is-messing-up-for-me-help-695947/)

Joke-star 01-08-2009 04:50 PM

dpkg is messing up for me. Help!
 
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
E: _cache->open() failed, please report.

Thats the error i get. I tried all that dpkg --configure -a and i put sudo in front of it but it still won't work. Help.

pljvaldez 01-08-2009 04:56 PM

What distro are you running?

And what were you doing that caused the issue?

You can try parsing the output of dpkg --get-selections and see if something is listed as "broken" or "partially installed".

Joke-star 01-08-2009 04:59 PM

I have ubuntu 8.1

I got this for dpkg selections.

izese@izese-desktop:~$ dpkg --get-selections
dpkg: parse error, in file `/var/lib/dpkg/updates/0001' near line 1:
newline in field name `padding'

pljvaldez 01-08-2009 05:05 PM

Try using "sudo dpkg --get-selections".

And what were you doing when things went bad?

Joke-star 01-08-2009 05:05 PM

I tried to update some programs.

Joke-star 01-08-2009 05:07 PM

got this.

izese@izese-desktop:~$ sudo dpkg --get-selections
dpkg: parse error, in file `/var/lib/dpkg/updates/0001' near line 1:
newline in field name `padding'
izese@izese-desktop:~$

pljvaldez 01-08-2009 05:14 PM

What is the output of df -h.

pljvaldez 01-08-2009 05:15 PM

And what is the output of ls -al /var/lib/dpkg/updates?

pljvaldez 01-08-2009 05:29 PM

I googled around and found a possible solution for you. You can try deleting the update that has been downloaded, then run dpkg. So in order you can try (at your own risk, of course)
Code:

sudo rm /var/lib/dpkg/updates/0001
sudo dpkg --reconfigure -a

Then when it was working again, I would run sudo aptitude update.

rjlee 01-08-2009 05:57 PM

I had a similar problem recently on a live CD when I tried to do an apt-get dist-upgrade, but ran out of space.

It looked like the numbered file in /var/lib/dpkg/updates/ was truncated due to a lack of disk space, and this prevented apt-get or dpkg from working.

I was able to clear the problem by removing this file, then running
Code:

apt-get clean; dpkg --reconfigure -a
I got another error when I ran out of disk space again, but was finally able to run apt-get to remove some large packages that I'd downloaded, and it seemed to work from there.

Joke-star 01-09-2009 04:05 PM

Quote:

Originally Posted by pljvaldez (Post 3401675)
I googled around and found a possible solution for you. You can try deleting the update that has been downloaded, then run dpkg. So in order you can try (at your own risk, of course)
Code:

sudo rm /var/lib/dpkg/updates/0001
sudo dpkg --reconfigure -a

Then when it was working again, I would run sudo aptitude update.

After the first part, it shows a bunch of selections. Which one should i pick?

How do i delete/var/lib/dpkg/updates/?

izese@izese-desktop:~$ ls -al /var/lib/dpkg/updates
total 76
drwxr-xr-x 2 root root 4096 2009-01-09 17:02 .
drwxr-xr-x 8 root root 4096 2008-12-17 18:57 ..
-rw-r--r-- 1 root root 1144 2008-12-17 18:57 0000
-rw-r--r-- 1 root root 1143 2008-12-17 18:57 0002
-rw-r--r-- 1 root root 1143 2008-12-17 18:57 0003
-rw-r--r-- 1 root root 1137 2008-12-17 18:57 0004
-rw-r--r-- 1 root root 1130 2008-12-17 18:57 0005
-rw-r--r-- 1 root root 1085 2008-12-17 18:57 0006
-rw-r--r-- 1 root root 1078 2008-12-17 18:57 0007
-rw-r--r-- 1 root root 1084 2008-12-17 18:57 0008
-rw-r--r-- 1 root root 1084 2008-12-17 18:57 0009
-rw-r--r-- 1 root root 1078 2008-12-17 18:57 0010
-rw-r--r-- 1 root root 1071 2008-12-17 18:57 0011
-rw-r--r-- 1 root root 1036 2008-12-17 18:57 0012
-rw-r--r-- 1 root root 1029 2008-12-17 18:57 0013
-rw-r--r-- 1 root root 1035 2008-12-17 18:57 0014
-rw-r--r-- 1 root root 1035 2008-12-17 18:57 0015
-rw-r--r-- 1 root root 1029 2008-12-17 18:57 0016
-rw-r--r-- 1 root root 1022 2008-12-17 18:57 tmp.i


izese@izese-desktop:~$ df -h.
df: invalid option -- '.'
Try `df --help' for more information.
izese@izese-desktop:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 118G 23G 90G 21% /
tmpfs 441M 0 441M 0% /lib/init/rw
varrun 441M 216K 441M 1% /var/run
varlock 441M 0 441M 0% /var/lock
udev 441M 2.7M 439M 1% /dev
tmpfs 441M 692K 441M 1% /dev/shm
lrm 441M 2.0M 439M 1% /lib/modules/2.6.27-7-generic/volatile

Joke-star 01-09-2009 04:17 PM

help

pljvaldez 01-09-2009 04:27 PM

Looks like you ran the first command and removed 0001. Did you then run dpkg --reconfigure -a?

Joke-star 01-09-2009 04:28 PM

Quote:

Originally Posted by pljvaldez (Post 3402912)
Looks like you ran the first command and removed 0001. Did you then run dpkg --reconfigure -a?

No should i?

pljvaldez 01-09-2009 04:30 PM

Yes.

Joke-star 01-09-2009 04:33 PM

Quote:

Originally Posted by pljvaldez (Post 3402917)
Yes.

izese@izese-desktop:~$ dpkg --reconfigure -a
dpkg: unknown option --reconfigure

Type dpkg --help for help about installing and deinstalling packages[*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --license for copyright license and lack of warranty (GNU GPL)[*].

Options marked[*] produce a lot of output - pipe it through `less' or `more' !

What should i do now?

pljvaldez 01-09-2009 04:36 PM

Sorry, my fault. I meant dpkg --configure -a

Joke-star 01-09-2009 04:37 PM

Quote:

Originally Posted by pljvaldez (Post 3402924)
Sorry, my fault. I meant dpkg --configure -a

i got.

izese@izese-desktop:~$ dpkg --configure -a
dpkg: requested operation requires superuser privilege
izese@izese-desktop:~$ sudo dpkg --configure -a
dpkg: parse error, in file `/var/lib/dpkg/updates/0002' near line 1:
field name `
izese@izese-desktop:~$

pljvaldez 01-09-2009 04:41 PM

Okay, so now sudo rm /var/lib/dpkg/updates/0002 and then try the dpkg command again.

Basically, what I think happened was one of the updates got borked. So just keep deleting them one by one until the dpkg command works correctly.

Joke-star 01-09-2009 05:50 PM

Quote:

Originally Posted by pljvaldez (Post 3402933)
Okay, so now sudo rm /var/lib/dpkg/updates/0002 and then try the dpkg command again.

Basically, what I think happened was one of the updates got borked. So just keep deleting them one by one until the dpkg command works correctly.


izese@izese-desktop:~$ sudo rm /var/lib/dpkg/updates/0002
rm: cannot remove `/var/lib/dpkg/updates/0002': No such file or directory
izese@izese-desktop:~$ sudo rm /var/lib/dpkg/updates/0002

It must be deleted so how can i delete the others or is there an alternative to Dpkg?

pljvaldez 01-09-2009 06:16 PM

What is the output of ls -al /var/lib/dpkg/updates?

dpkg is the guts of the package management system. You won't be able to install any software until you resolve this situation.

Did you try running sudo dpkg --configure -a again?

zypres 04-27-2009 05:13 AM

I fixed it for me
 
My fix was deleting some more:
Code:

sudo rm /var/lib/dpkg/updates/00**
Then I did reconfigure -a and it all worked...


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