How to speed up package updates using apt-fast (Debian & Ubuntu)

apt-fast downloads repositories (package sources) and packages in parallel, which can greatly shorten the time it takes to update a system.  In contrast, the default package manager (apt-get or aptitude) downloads repositories and packages sequentially.

 

Step 1 – Install apt-fast

Add the apt-fast repository to your package sources.

 

If you don’t have the add-apt-repository tool, install it by running  sudo apt-get install software-properties-common

If the package configuration asks which package manager to use, choose apt-get if you are running Ubuntu, or aptitude if you are running Debian.

When asked for how many connections to use, enter a reasonable number based on your connection.  If you have a fast connection, the default of 15 will most likely suit you.  If you’re on a slower connection, consider entering 5 or 10.  Try different values to find what works best.

You can reconfigure at any time by running  sudo dpkg-reconfigure apt-fast

 

Step 2 – Create an alias

Add the following to the end of your  ~/.bashrc file to perform a normal upgrade by typing uu

 

Note the  -y argument.  This causes any prompts (such as the download confirmation) to be answered yes automatically.

If you want a more thorough upgrade (which installs new kernels) use  dist-upgrade rather than  upgrade

 

lonniebiz on reddit writes:

If you’d like to see this in the main repositories and Ubuntu Software Center, add some heat to this bug by indicating that it affects you:

https://bugs.launchpad.net/ubuntu/+bug/1173661

10 thoughts on “How to speed up package updates using apt-fast (Debian & Ubuntu)

  1. Apt could use some speed improvements, that’s for sure. I always hoped and wished that apt-torrent would take off and fix it, but apt-fast looks like a good option too.

    Another option is to have apt regularly download updates via a cron job, then they’ll be there for you when you’re ready to run the upgrade. I have this in root’s crontab:
    apt-get -d upgrade -y –force-yes

    -d means download only.

  2. For a bash script, the script code looks really horrible I almost want to poke my eyes reading through it. It needs a serious rewrite before anyone can think of submitting it into ubuntu repo

Leave a Reply