couldn't rebuild package cache

Asked by curiogeo

Trying to run aptitude upgrade and security.ubuntu.com stopped responding for a little while.

My upgrade stalled and then after the download would not continue I stopped it (Ctrl-C).

Since then if I try to run aptitude update or upgrade I get a command to run dpkg --configure -a

When run I get a segmentation fault (core dumped) and then nothing

What can I do to address this?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Cesare Tirabassi (norsetto) said :
#1

Try first with this:

sudo apt-get -f install

and then:

sudo dpkg --configure -a

Revision history for this message
curiogeo (damani-best) said :
#2

logged in as root I did the following

# apt-get -f install
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.

dpkg --configure -a
Segmentation fault (core dumped)

During one of my attempts I received a message stating "E: Couldn't rebuild package cache"

Revision history for this message
Cesare Tirabassi (norsetto) said :
#3

Perhaps the only sensible solution is to remove the cache.

sudo rm /var/cache/apt/pkgcache.bin
sudo rm /var/cache/apt/srcpkgcache.bin

These should be regenerated with a sudo apt-get update command.
If this doesn't work you will have to reinstall the whole 7.04, but at this point in time I'm afraid you would have to do it anyhow.
If you can backup your home directory and any config file you may need (/etc/X11/xorg.conf, etc. etc.).

Revision history for this message
curiogeo (damani-best) said :
#4

Thanks Cesare,

I am using this machine as a domain controller with Samba so if there are a couple of other options I can try prior to rebuilding it would be preferred.

Is there anything at all that I can do to regenerate the cache as the above method did not solve the problem?

Since it looks as though I will be rebuilding I am willing to be pretty aggressive with the treatment.

Any logs that might help here. an application I can reinstall manually. Manual installation of a package or packages.

Based on my line of problems I am thinking that there must be a particular app to blow away and then recover.

Let me know that or if there is somewhere else I might dig something up. Maybe the core dumps might even tell me something if i knew how to find them. Any ideas there?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#5

The only think I can suggest you is to open a bug report and attach the core dump.
Don't expect a quick answer though.

What you can do in the meantime is to strace dpkg to see if you can trap which call is causing the SIGSEGV.
Otherwise you could download the dpkg source package and recompile it with debug support.

Revision history for this message
curiogeo (damani-best) said :
#6

How do I extract a core dump by the way?

Is there a particular path I am looking for?

D

Revision history for this message
curiogeo (damani-best) said :
#7

Here are the results of the strace:

# strace dpkg
execve("/usr/bin/dpkg", ["dpkg"], [/* 17 vars */]) = 0
brk(0) = 0x8129000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f2b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f2a000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f2a880, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Process 7752 detached

Revision history for this message
Cesare Tirabassi (norsetto) said :
#8

The crash report is in /var/crash
You can also strace with -f to check the child processes.

Revision history for this message
curiogeo (damani-best) said :
#9

There is no /var/crash files or directory.

I used ulimit to generate a core dump file I think.

I have been looking at different ways to generate bug traces but they all require that I install programs using apt. I am having a heck of a time finding the intructions on how/where to download and start dpkg, valgrind or backtrace without apt.

Definately lack of experience with linux.

Not sure I see the difference between the 2 strace results. Does this show you anything?

# strace -f dpkg
execve("/usr/bin/dpkg", ["dpkg"], [/* 17 vars */]) = 0
brk(0) = 0x8129000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f09000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f08000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f08880, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Process 7809 detached

Revision history for this message
Cesare Tirabassi (norsetto) said :
#10

All you ever wanted to know about crashes and never dared to ask:

https://wiki.ubuntu.com/DebuggingProgramCrash

Revision history for this message
curiogeo (damani-best) said :
#11

I am trying to unpack a file that was dowloaded with Internet Explorer. In the process of the download the tar.gz extension was changed to a tar.tar extension.

I changed the file using a move command:
mv dpkg_1.10.27ubuntu1.1.tar.tar dpkg_1.10.27ubuntu1.1.tar.gz
That was successful.

I then tried:
gunzip dpkg_1.10.27ubuntu1.1.tar.gz

and it was successful.

The last step failed:
~/dpkg# tar -xvjf dpkg_1.10.27ubuntu1.1.tar
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error exit delayed from previous errors

What have I missed?

Revision history for this message
Jayson Vaughn (thedonvaughn) said :
#12

You are using the "-j" flag. This is to un-compress using bz2. You do not need this flag, use "tar -xvf".

Hope this helps!

Can you help with this problem?

Provide an answer of your own, or ask curiogeo for more information if necessary.

To post a message you must log in.