<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Ubuntu apt update VERY slow and how to fix your download speed - Linux Forum				            </title>
            <link>https://www.virtualizationhowto.com/community/linux-forum/ubuntu-apt-update-very-slow-and-how-to-fix-your-download-speed/</link>
            <description>Virtualization Howto Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Mon, 14 Sep 2026 03:24:55 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Ubuntu apt update VERY slow and how to fix your download speed</title>
                        <link>https://www.virtualizationhowto.com/community/linux-forum/ubuntu-apt-update-very-slow-and-how-to-fix-your-download-speed/#post-1598</link>
                        <pubDate>Tue, 04 Aug 2026 18:06:43 +0000</pubDate>
                        <description><![CDATA[I recently ran into an issue with a cloned Ubuntu 24.04 template that was using as a Bitbucket runner, so it didn&#039;t need anything too special. However, after spinning it up, I noticed trying...]]></description>
                        <content:encoded><![CDATA[<p>I recently ran into an issue with a cloned Ubuntu 24.04 template that was using as a Bitbucket runner, so it didn't need anything too special. However, after spinning it up, I noticed trying to install packages was brutally slow. Was getting like 20-35 kb/sec downloads. Here are ultimately the tweaks and steps I took to get the apt update working fast once again:</p>
<h2 class="PDq2pG_selectionAnchorContainer" data-section-id="s0r99j" data-start="79" data-end="111">Step 1: Force APT to use IPv4<span class="PDq2pG_selectionAnchor" aria-hidden="true"></span></h2>
<p data-start="113" data-end="182">If you are not using IPv6 in your environment, this keeps APT from wasting time trying broken or unreachable IPv6 paths.</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="relative h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="">
<div class="relative">
<div class="">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span class="ͼ10">echo</span><span> </span><span class="ͼz">'Acquire::ForceIPv4 "true";'</span><span> | </span><span class="ͼ10">sudo</span><span> </span><span class="ͼ10">tee</span><span> /etc/apt/apt.conf.d/99force-ipv4</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p data-start="302" data-end="309">You can make sure it "sticks" with the following:</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="relative h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="">
<div class="relative">
<div class="">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span class="ͼ10">cat</span><span> /etc/apt/apt.conf.d/99force-ipv4</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p data-start="361" data-end="377">You should see something like this:</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="pe-11 pt-3">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span>Acquire::ForceIPv4 "true";</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
<h2 data-section-id="199nj3i" data-start="419" data-end="475">Step 2: Change Ubuntu repositories from HTTP to HTTPS</h2>
<p data-start="477" data-end="527">This is the one that I found made the biggest difference, since it looks like it is hitting cloudflare IPs. On Ubuntu 24.04 (Noble), edit the <code data-start="511" data-end="521">.sources</code> file with this:</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="relative h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="">
<div class="relative">
<div class="">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span class="ͼ10">sudo</span><span> </span><span class="ͼ10">sed</span><span> </span><span class="ͼ12">-i</span><span> \
</span><span class="ͼz">'s|http://archive.ubuntu.com/ubuntu|https://archive.ubuntu.com/ubuntu|g;</span><span>
</span><span class="ͼz"> s|http://security.ubuntu.com/ubuntu|https://security.ubuntu.com/ubuntu|g'</span><span> \
/etc/apt/sources.list.d/ubuntu.sources</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p data-start="745" data-end="764">Make sure of your changes.</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="relative h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="">
<div class="relative">
<div class="">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span class="ͼ10">cat</span><span> /etc/apt/sources.list.d/ubuntu.sources</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p data-start="822" data-end="841">You should now see:</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="pe-11 pt-3">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span>URIs: https://archive.ubuntu.com/ubuntu</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
<p data-start="896" data-end="899">and this also:</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="pe-11 pt-3">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span>URIs: https://security.ubuntu.com/ubuntu</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
<h2 data-section-id="1ywmkbq" data-start="955" data-end="977">Step 3: Refresh APT</h2>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="relative h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="pointer-events-none absolute inset-x-4 top-12 bottom-4">
<div class="pointer-events-none sticky z-40 shrink-0 z-1!">
<div class="sticky bg-token-border-light">Now refresh APT:</div>
</div>
</div>
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="">
<div class="relative">
<div class="">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span class="ͼ10">sudo</span><span> apt clean
</span><span class="ͼ10">sudo</span><span> apt update</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class=""> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<h2 data-section-id="kec8s" data-start="1023" data-end="1053">Step 4: Test download speed</h2>
<p data-start="1055" data-end="1116">To make sure of your speed improvement, below is just an example that I used since I was trying to install JAVA:</p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="relative h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="">
<div class="relative">
<div class="">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span class="ͼ10">wget</span><span> </span><span class="ͼ12">-4</span><span> </span><span class="ͼ12">-O</span><span> /dev/null \
https://archive.ubuntu.com/ubuntu/pool/main/o/openjdk-17/openjdk-17-jre-headless_17.0.19</span><span class="ͼv">+</span><span class="ͼy">10</span><span class="ͼ12">-1</span><span>~24.04.2_amd64.deb</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div> </div>
<div class="">After this, I was getting this:</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p data-start="1266" data-end="1314"> </p>
<div class="relative w-full mt-4 mb-1">
<div class="">
<div class="contents">
<div class="relative">
<div class="h-full min-h-0 min-w-0">
<div class="h-full min-h-0 min-w-0">
<div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl">
<div class="h-full w-full border-radius-3xl bg-(--code-block-surface) corner-superellipse/1.1 overflow-clip rounded-3xl  dark: lxnfua_clipPathFallback">
<div class="relative">
<div class="pe-11 pt-3">
<div class="relative z-0 flex max-w-full">
<div id="code-block-viewer" class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr">
<div class="cm-scroller">
<pre class="cm-content q9tKkq_readonly m-0" contenteditable="false"><code><span>45.86 MB in 3.2 seconds
≈14.5 MB/sec</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>]]></content:encoded>
						                            <category domain="https://www.virtualizationhowto.com/community/linux-forum/">Linux Forum</category>                        <dc:creator>Brandon Lee</dc:creator>
                        <guid isPermaLink="true">https://www.virtualizationhowto.com/community/linux-forum/ubuntu-apt-update-very-slow-and-how-to-fix-your-download-speed/#post-1598</guid>
                    </item>
							        </channel>
        </rss>
		