• Home
  • Docs
  • About
  • Resume
  • Services
    • Testimonials
    • Leave A Testimonial
  • Stack Exchange
    • Android
      • Spanish
      • French
      • German
    • Apple
      • Spanish
      • French
      • German
    • Ask Ubuntu
      • Spanish
      • French
      • German
    • Bicycles
      • Spanish
      • French
      • German
    • Cooking
      • Spanish
      • French
      • German
    • CrossValidated
      • Spanish
      • French
      • German
    • Database Administrator
      • Spanish
      • French
      • German
    • Drupal
      • Spanish
      • French
      • German
    • Electronics
      • Spanish
      • French
      • German
    • Game Development
      • Spanish
      • French
      • German
    • Gaming
      • Spanish
      • French
      • German
    • GIS
      • Spanish
      • French
      • German
    • Home Improvement
      • Spanish
      • French
      • German
    • Mathematics
      • Spanish
      • French
      • German
    • Photography
      • Spanish
      • French
      • German
    • Physics
      • Spanish
      • French
      • German
    • Programmers
      • Spanish
      • French
      • German
    • Stack Overflow
      • Spanish
      • French
      • German
Humbug
Bah! Humbug!
Home 2010 Fast Parallel Downloading/Upgrading for Ubuntu using aptitude/apt-get/aria2c
  • Email
  • Share

Fast Parallel Downloading/Upgrading for Ubuntu using aptitude/apt-get/aria2c

  • 2 Comments
  • Tweet
Pratik Sinha | February 13, 2010

I recently moved to Ho Chi Minh City (HCMC), Vietnam from the US of A. There’s a lot different between the two countries – the people, the culture. I am throughly enjoying my stay in this city, the social life is rocking, the food is amazing and the people are very nice. However, there are a few things I do miss about the US of A and one of those things being the blazing fast Internet speeds.

A couple days back, I decided to give KDE 4.4 a go. I knew it won’t be available in the standard Ubuntu repositories anytime soon, and hence googled for a PPA which I could download it from. I came across this tutorial which had step-by-step instructions for upgrading to KDE 4.4 on Ubuntu Karmic. I followed the tutorial and added the Kubuntu Backports PPA and issued the standard ‘apt-get update; apt-get dist-upgrade’ command to start the upgrade. The apt-get command let me know that there are 170 packages to be upgraded. I gave it the go-ahead and I could see the packages being downloaded one by one; I couldn’t wait to try out the new version of KDE, I read so many rave reviews about. To my dismay, even after half an hour only 30 odd packages were done and it was already 1 a.m.. Finally at about 1:30 a.m., I gave up and went off to sleep, letting the download take place through the night and made a mental note that I needed to find a more efficient way of upgrading.

Today, I was googling around to see if I could find a solution to my internet/upgrade woes and came across this blog post. The solution is to dump the URIs of all the packages that need to be upgraded ( apt-get -y –print-uris install $x | egrep -o -e “http://[^\']+”) and then download them 3 at a time using wget (xargs -l3 -P5 wget -nv) and finally issue the upgrade command. That definitely did speed up the upgrade process. However I remembered that Archlinux has a tool called PowerPill which uses aria2c to speed up downloads by fragmenting them. I wondered if I could use aria2c instead of wget to speed up my downloads even more.

I downloaded aria2 and fired the aria2 man page to figure out what the wget equivalent command would be.

sudo aptitude install aria2

Its usage turned out to be very simple and I used the follow command to download my updates:

sudo apt-get -y --print-uris upgrade | egrep -o -e "http://[^\']+" | sudo aria2c -c -d /var/cache/apt/archives -i -; sudo aptitude safe-upgrade

aria2c downloads concurrently from 5 URLs and uses 5 fragments per file at a time by default. The settings can be tweaked using -j for the no of concurrent files to be downloaded and -s for the no of fragments.

I noticed a significant increase in my download speeds by using aria2c instead of wget.

Please leave your comments to let me know if you know of better ways to boost upgrade speeds.

Posted in Tips-N-Tricks | Tagged apt-get, aptitude, aria, aria2c, Internet speeds, parallel, Ubuntu | 2 Responses

  • Tweet

Logging In...

Reply Click here to cancel reply.

Sign in with Twitter Sign in with Facebook
or

  • 2 Replies
  • 1 Comment
  • 0 Tweets
  • 0 Facebook
  • 1 Pingback
Last reply was 441 days ago
  1. Parallel package downloads for Debian-based distros « Divagations of a developer
    View 670 days ago

    [...] download method used by apt-get is far from optimal. A quick search resulted in these very useful blog posts – it seems that I wasn’t the only one with that question in my mind. So, [...]

    Reply
  2. Ben
    View 441 days ago

    I have aria2c (alias ‘get’) and also axel (alias dl)

    I was playing today also with wxcfast with the http://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-i686-1.0.15-dev-en-US.tar.gz

    I found axel had the fastest download at 1 min 50 – with the others coming in at over 2mins 15. Impressive.

    Axel!

    Reply
« Previous Next »

Recommend on Google
  • RSS
  • Facebook
  • Twitter

Subscribe

Get the latest posts delivered straight to your inbox.

Chatter Away

Recently Popular

  • Make English the Default Language for Google Chrome Search
  • Kill/Quit and Restart Plasma on KDE
  • Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes
  • Bash Tricks: Split / Cut a String with Multi Character Delimiters
  • Utility to Send Commands or Data to Other Terminals (tty/pts)
  • Make English the Default Language for Mozilla Firefox Search
  • A Sample Loop in XSL, Alternative for While, For Loops
  • Bash Tricks: Split / Cut a String with Multi Character Delimiters Using AWK
  • Bash Tricks: Create variables dynamically using some eval magic
  • Makefile Tricks: Arithmetic – Addition, Subtraction, Multiplication, Division, Modulo, Comparison

Latest Tweets

  • Ruby on Rails Debugging Techniques: Nice succinct blog on ROR debugging techniques, saving it for future reference... http://t.co/36mceCNP 2 hours ago
  • Get Android Remote Notifier to work with Unity on Ubuntu Natty (11.04) and Oneiric (11.10): Ubuntu Natty onwards, ... http://t.co/c3rLfD27 3 days ago
  • Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic: Jotting down an easy recipe to get a 802.11 ... http://t.co/rZqwjVE5 1 week ago
  • RT @MaheshNBhatt: Mukul Sinha from Jansangharsh Manch called to say that the police are denying the riot victims the permission to hold ... 4 months ago
  • RT @MaheshNBhatt: They have just informed me that they will court arrest and begin to fast if the Gujarat govt denies them their constit ... 4 months ago

Services Offered

  • Embedded Linux Systems and Services
  • Gateway Routers (Frontend and Backend)
  • Free and Open Source Software Solutions
  • Network Monitoring Solutions
  • Device Driver Development

Recent Comments

  • buckley commented on Utility to Send Commands or Data to Other Terminals (tty/pts)
    (1 weeks ago)
  • Arup Kumar Kabi commented on Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic
    (1 weeks ago)
  • Varun V Nair commented on Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic
    (1 weeks ago)
  • Ajit Bhat commented on Wireless Sniffer on Ubuntu Linux - Capture / Analyze Network Traffic
    (1 weeks ago)

Categories

  • As An Aside
  • Code-Snippets
  • Software
  • Testimonials
  • Tips-N-Tricks

Copyright © 2012 Humbug.

Powered by WordPress and Hybrid.