Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

COMPUTER TESTS PC COMPONENTS PC ACCESSORIES GADGETS SOFTWARE & APPS GAMING

Software & Apps Operating System Linux

Fixing Slow apt-get Update: Waiting


for Headers Issue Jacob Hicks
AUTHOR

BY JACOB HICKS — JULY 20, 2023 Jacob has been writing for DeviceTests
since 2021. He enjoys testing new
hardware and software, and sharing his
findings with the world.

Related Posts
Why Can't I
Uncompress a .bz2
File Using Tar?
JULY 20, 2023

Fixing Amazon
Workspaces Client
Crashes on Ubuntu
22.04 Due to
OpenSSL Error
JULY 23, 2023

How To Install and


Run Anbox on
Ubuntu 18.04?
JULY 20, 2023

In this article, we will delve into the issue of slow updates when using the
apt-get update command on Ubuntu systems. This problem can be quite
frustrating, especially when you are trying to keep your system up-to-date
with the latest software packages. We will explore various solutions to this
problem, from regenerating the list cache to checking DNS settings. Let’s
dive in.

Quick Answer

To fix the slow apt-get update issue on Ubuntu systems, you can try
regenerating the list cache, checking third-party repositories, adjusting
MTU size, verifying proxy settings, adjusting APT settings, checking DNS
settings, disabling problematic repositories, using netselect, switching to
the main server, trying a different internet source, or checking for VPN
interference.

Table of Contents
�� Understanding the Issue
�� Potential Solutions
Regenerate Lists Cache
Check Third-Party Repositories
Check MTU Size
Check Proxy Settings
Adjust APT Settings
Check DNS Settings
Disable Problematic Repositories
Use netselect
Switch to the Main Server
Try a Different Internet Source
Check for VPN Interference
�� Conclusion

Understanding the Issue


When you run the command sudo apt-get update on your Ubuntu system,
you might experience slow update speeds. This can occur due to various
reasons such as incorrect mirror selection, faulty network configurations, or
problematic repositories. The issue can persist even after changing mirrors
or reducing the sources list.

Potential Solutions
Now, let’s look at some potential solutions to this problem.

Regenerate Lists Cache

The first solution involves regenerating the list cache. This can be done by
running the following commands in the terminal:

sudo apt-get clean


cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get clean
sudo apt-get update

Here, sudo apt-get clean clears out the local repository of retrieved package
files. The mv command renames the ‘lists’ directory to ‘lists.old’, and mkdir

-p lists/partial creates a new ‘lists’ directory with a ‘partial’ subdirectory.


Running sudo apt-get update again will regenerate the list cache.
Check Third-Party Repositories

Another potential issue could be third-party repositories. To check this, open


Update Manager, go to Settings, and click on the “Other Software” tab.
Uncheck all checkboxes and try running sudo apt-get update again. If it
works, enable each repository one by one to identify the problematic one.

Check MTU Size

Incorrect Maximum Transmission Unit �MTU� size can cause slow updates.
You can check your MTU size by running ifconfig and look for the MTU
value. If it’s not set correctly, you can adjust it using the ifconfig command
followed by the network interface name, mtu , and the correct value.

Check Proxy Settings

Incorrect proxy settings can also cause slow updates. Inspect the
/etc/environment file for any proxy settings. You can do this by running cat

/etc/environment . Remove any incorrect or unnecessary proxy configurations.

Adjust APT Settings

You can also try adjusting APT settings. Create a new file in /etc/apt

/apt.conf.d/ (e.g., 99self ) and add the line Acquire::http::Pipeline-Depth

"0"; . This disables pipelining, which can improve performance on high-


latency connections.

Check DNS Settings

Incorrect DNS settings can cause slow updates. Verify that the DNS servers
are configured correctly in /etc/resolv.conf . You can do this by running cat

/etc/resolv.conf . Update the network interface’s DNS configuration if


necessary.
Disable Problematic Repositories

If you’re using Synaptic, try triggering apt-get update within Synaptic by


clicking on “Reload”. If it hangs, abort it, and it will display the name of the
repository causing the issue. Temporarily disable that repository in Synaptic
under “Settings � Other Software”.

Use netselect

You can install and run netselect to generate a new sources.list file. Replace
the existing /etc/apt/sources.list with the generated one. This can help if
the issue is caused by a slow or unresponsive mirror.

Switch to the Main Server

Open Software and Updates, go to the “Download From” option, and select
“Main Server”. This can help if the relay servers are not responding quickly.

Try a Di�erent Internet Source

If possible, switch to a different internet source or ISP. Some ISPs may block
certain network ranges, causing slow updates.

Check for VPN Interference

If you’re using a VPN, disable it temporarily to see if it improves the update


speed. Adjust firewall rules if necessary.

Conclusion
Slow apt-get update speeds can be a nuisance, but with the right
troubleshooting steps, you can identify and fix the issue. Remember to try
these solutions one at a time and test the update speed after each step to
identify the specific cause of the issue. With a little patience and
perseverance, you can get your updates running smoothly again.

How can I regenerate the list cache?

How can I check for third-party repositories?

How can I check the Maximum Transmission Unit �MTU� size?

How can I check and adjust proxy settings?

Related Posts

How To Identify the How To Uninstall IntelliJ How To Fix Ubuntu Not
Ubuntu Partition for Ultimate Edition on Starting After Updating
Uninstallation Ubuntu Nvidia Drivers from
JULY 22, 2023 JULY 19, 2023 X-Swat PPA
JULY 19, 2023

How To Completely How To Install Scala Share Files over Wi-Fi on


Remove MySQL 5.7 on 2.11.4 on Ubuntu: Step- Ubuntu: Find the Best
Ubuntu 18.04 by-Step Guide Alternative to Shareit
JULY 24, 2023 JULY 25, 2023 JULY 26, 2023

About The Author


Jacob Hicks
Jacob has been writing for DeviceTests since 2021. He enjoys testing new hardware
and software, and sharing his findings with the world. In his spare time, Jacob likes
to play guitar, watch movies, and spend time with family and friends. He’s also a big
fan of video gaming.

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

You might also like