Has anyone else seen this: dpkg slows to a crawl or freezes

Asked by David A. Cobb

For starters, I am really tight on RAM: 256KiB was a big machine when I bought it -- now, it's simply too danged small.

This is intermittent: and I can't figure what is different between failures and successes.
I do most install/remove cycles at a console with Gnome shut down. I run APTITUDE, which in turn calls DPKG. Dpkg goes through reading the package files, changelogs, etc., then prints "Reading database . . . 85%. The percentage clicks right along until 85%. It then might take an hour to get to 90%, another hour or more for 95%. By then, I'm pulling out my hair. If it's bed-time and I can leave the beast to its own misery, I will usually find in the morning [ 6-8 hours later ] that progress has been made, although very possibly it still hasn't finished.

I'm thinking there may be some pathological dependencies, cycles that need to be broken, or the like. That would account for why one package takes forever to install/remove, while another takes a few minutes.

Other than someone else saying they've seen this, and it isn't just my karma. my first question would be: How can I force dpkg to rebuild its database from zero. AVAILABLE seems to be open when things go South.

Question information

English Edit question
Ubuntu dpkg Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :

Please try this:

open a Terminal from the menu Applications->Accessories->Terminal

Tip: right click with mouse on the terminal title caption and select the item "Always on Top" doing this you will force the terminal window to stay on top of the other windows and you will find very easy to copy single row from this web page into the terminal...
Something more about using the terminal https://help.ubuntu.com/community/UsingTheTerminal

Then type or better copy and paste a row a time then press enter:
(Tip: select the single row to copy then right click into the terminal and to quick paste click with middle button of mouse )

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo aptitude clean
sudo aptitude autoclean
sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo aptitude install -f
sudo aptitude update
sudo aptitude dist-upgrade

give your user password when requested, you don't see nothing when you type it, then press enter.

Hope this helps

Can you help with this problem?

Provide an answer of your own, or ask David A. Cobb for more information if necessary.

To post a message you must log in.