08.05.09

Improving dpkg/apt performance

Thanks to Antti-Juhani Kaijanaho I could improve the performance of dpkg/apt on my old Ubuntu system (upgraded since I've started using Linux/Ubuntu in 2005):

I've written a small script, according to Antti-Juhani's post:

#!/bin/sh
# via http://antti-juhani.kaijanaho.fi/newblog/archives/521

if [ "$(id -u)" != "0" ]; then
echo "You must be root."
exit 1
fi

dpkg --clear-avail
dpkg --forget-old-unavail
sync-available

My results show that /var/lib/dpkg has gone from 195M down to 154M and calling apt-get upgrade (not a good test probably) went down from 10.024s to 5.764s (after dropping all caches, of course - "echo 3 | sudo tee /proc/sys/vm/drop_caches").

Thanks.

This should get considered to be done during Ubuntu upgrades.

By Daniel in Ubuntu, Snippets2009-05-08 English (EU) Email

2 comments

Comment from: Dot [Visitor]
DotFunny, here(system running Jaunty, upgraded since Hardy) it went from 100M to 125M (according to the output of "du")
2009-05-08 @ 22:19
Comment from: Daniel [Member] Email
Maybe because of "sync-available"? (if the file has not been there - haven't checked what it really does. it's been in some IF on the original source). prolly unnecessary - I've played safe.. ;)
2009-05-08 @ 23:51

Leave a comment


Your email address will not be revealed on this site.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
You can just use your OpenID to provide your name, e-mail and url.
Seitenleiste