How long does sudo apt-get upgrade take?

Hi,

One of my server taking very long time to run apt-get command. Like it takes anywhere from 5 to 10 minutes when I run:

sudo apt-get update

Then it takes somemore time to download upgrades apps and patches.

sudo apt-get upgrade

This is Debian Linux 10 server. Why does sudo apt-get upgrade take so much even if I have faster internet connection speed like 300Mbps?

How long does sudo apt-get upgrade take?

That depends upon your internet speed.

Check your DNS resolver. Try to use third party DNS server such as 8.8.8.8 or 1.1.1.1 they are usually fast. The following will show current DNS settings

cat /etc/resolv.conf

I see my Wifi routers IP address

# Generated by NetworkManager
nameserver 192.168.1.1

Can edit the file?

You can, but DHCP will overwrite it. I suggest making changes in your WiFi router to point to the correct DNS server. Here is how it looks on my home firewall/router:

Of course, Ubuntu can overwrite that too with the nmcli or GUI. Go to settings > IPv4 and IPv6 > Turn off Automatic DNS and enter the DNS address of your choice, such as 8.8.8.8, manually:

One more thing check out for the IPv6 problem. If not configured properly, it will delay the apt-get update/upgrade/install command. We can disable IPv6 for apt. See:

I changed ISP assigned DNS to Google DNS Public DNS  |  Google Developers :

  • 8.8.8.8
  • 8.8.4.4

I also disabled IPv6 on Ubuntu for apt-get and now speed is great. I can download updates quickly. But, apt-get still not using full 300Mbps. Maybe deb.debian.org overloaded. What do you say?

Good to know your problem sorted out.

Maybe deb.debian.org overloaded.

That is the CDN URL for the Debian project. You will never get full speed due to many factors such as distance between your ISP node and that CDN node. Another factor is an overload on the origin server. Either way, CDN is much faster as compared to older setups.

host deb.debian.org
ping -c 4 deb.debian.org


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki