Geoffrey Garbers Thoughts on everything from PHP to photography

Limiting download speeds with Ubuntu’s apt-get

Posted 3 months ago.

So, you’re on Ubuntu, and you’re needing to download and apply updates. The problem is; you’re on a shared connection, or you’re still wanting to continue browsing at a decent speed. Nobody likes a bandwidth hog, right?

Well, thankfully, there is a way to limit bandwidth usage, even though there isn’t an easy-to-use option. The example below shows how to do this:

sudo apt-get -o  Acquire::http::Dl-Limit=50 -y dist-upgrade

Basically, the magic happens here: Acquire::http::Dl-Limit=50. That number represents the number of Kilobytes to limit the bandwidth to. Change it to suit your needs.

Just to note, it doesn’t limit your bandwidth to exactly that speed. It seems to limit it to around that speed. I found that my updates ran at 54.5KB a second, when I set the download limit to 50. FYI. 

Comments

Clifford W. Hansen 3 months ago
If you add that line to "/etc/apt/apt.conf" the you don't need to specify it every time ;)

Also adding it to a file "/etc/apt/apt.conf.d/90_limit_bandwidth" wil ensure it doesn't get overwritten after an upgrade ;)

Leave a reply

Your email address will not be published. Required fields are marked *

*