• Home
  • Docs
  • About
  • Resume
  • Services
    • Testimonials
  • Contact
Humbug
Bah! Humbug!
Home 2010 Fast Parallel Downloading/Upgrading for Ubuntu using aptitude/apt-get/aria2c

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...

Profile cancel

Sign in with Twitter Sign in with Facebook
or

Not published

 

  • 2 Replies
  • 1 Comment
  • 0 Tweets
  • 0 Facebook
  • 1 Pingback
Last reply was 544 days ago
  1. Parallel package downloads for Debian-based distros « Divagations of a developer
    View 772 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 544 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 »

Search

Recommend on Google
  • RSS
Follow @free_thinker

Get the latest posts delivered straight to your inbox.

Categories

  • Bookmarks
  • Code-Snippets
  • Guides
  • Info
  • Software
  • Testimonials
  • Tips-N-Tricks
  • Updates

Recently Popular

  • Make English the Default Language for Google Chrome Search
  • Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes
  • Kill/Quit and Restart Plasma on KDE
  • Bash Tricks: Split / Cut a String with Multi Character Delimiters
  • Enable SPDY in Firefox 11 on Ubuntu 12.04 beta
  • Utility to Send Commands or Data to Other Terminals (tty/pts)
  • A Sample Loop in XSL, Alternative for While, For Loops
  • Bash Tricks: Create variables dynamically using some eval magic
  • Kickstrap – CSS Framework: Enhancements for Bootstrap
  • WordPress Plugin: Cleaner WordPress Editor – Trying To Make WordPress Editing a Pleasure

Latest Tweets

  • 2 unexploded bombs found under Ho Chi Minh City house - Approximately 800,000 tons of bombs and mines still present humbug.in/z/9i #fb 4 weeks ago
  • 3 Vietnamese bloggers charged over their writing | Fox News humbug.in/z/9g #fb 1 month ago
  • Implement strong WiFi encryption the easy way with hostapd - Using WPA2-Personal with individual keys for each user humbug.in/z/9e 1 month ago
  • Soon, wonder vaccine that will kill 90% of cancers - Health - DNA humbug.in/z/9d 1 month ago
  • PHP like str_replace function in C: This post is part of a series of posts where I want to document a bunch of C f... humbug.in/z/9c 1 month 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


Mobile and Web Analytics

Recent Comments

  • Haakon Dahl commented on Make English the Default Language for Google Chrome Search
    (1 weeks ago)
  • pawan commented on Wordpress Error: The plugin generated 1 characters of unexpected output during activation
    (1 weeks ago)
  • simon commented on Detect Mobile Browser using Server Side Includes (SSI)
    (2 weeks ago)
  • hakatagroup commented on Twitter Weekly Updates between 2012-04-19 and 2012-04-25
    (3 weeks ago)

Tags

Address bar android awk bash C css custom post type debug Default Browser DNS dreamhost English Facebook firefox Google iphone JavaScript jquery KDE keyboard shortcuts Kubuntu Launchpad Linux Mozilla Firefox p2 page template pdf php plugin PPA python ruby ruby-on-rails Ruby1.9.2 Search Results SNMP theme tweets Twitter Ubuntu United States update-alternatives Vietnam wordpress xsl

Copyright © 2012 Humbug.

Powered by WordPress and Hybrid.