Skip to content
Blog How to limit the download speed of apt-get

How to limit the download speed of apt-get

Learn how to limit the download speed of the APT package manager in Kubuntu, Ubuntu or any Debian-based Linux system.

Do you share your ADSL connection to your neighbors? Your broadband connection is shared by several computers on a small network or LAN?
If so, it is likely that everyone will complain that the internet is very slow when doing a system update in broad daylight as apt-get will occupy the entire bandwidth of your Internet connection.

To avoid this problem and have to do updates during the night, with a few lines in a text file you can limit the bandwidth consumed by apt-get and not saturate the Internet connection.

For Kubuntu, Ubuntu and company

Just as root, you must create a text file in the folder:

$ vi /etc/apt/apt.conf.d/limitlevel

The text file can have any name. This example ‘limitlevel’.
This file should contain the following lines of text:

Acquire
{
http {
Dl-Limit “100”;
}
}

The number 100 can be changed to your liking and represents the speed limit of apt-get expressed in KB / s (kilobytes per second).

For Debian Linux

For Debian you must edit the file

$ vi /etc/apt/apt.conf

and add the lines above and modify the value of discharge limits to your liking.

1 thought on “How to limit the download speed of apt-get”

  1. Thanks mate 🙂
    Worked like a charm

    BTW In a gentoo enviroment you can achieve the same result by overriding the FETCHCOMMAND directive in make.conf
    since it uses a plain wget command you just have to add “–limit-rate=100k” as an option to the original command, i.e. FETCHCOMMAND=”/usr/bin/wget –limit-rate=100k -t 5 -T 60 –passive-ftp -O \”\${DISTDIR}/\${FILE}\” \”\${URI}\””
    RESUMECOMMAND=”/usr/bin/wget –limit-rate=100k -c -t 5 -T 60 –passive-ftp -O \”\${DISTDIR}/\${FILE}\” \”\${URI}\””

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.