{"id":47268,"date":"2026-06-27T22:42:37","date_gmt":"2026-06-27T13:42:37","guid":{"rendered":"https:\/\/raybeam.jp\/docs\/troubleshotting\/troubleshooting-apt-dist-upgrade-failure-from-the-elasticsearch-repository\/"},"modified":"2026-06-27T22:43:06","modified_gmt":"2026-06-27T13:43:06","slug":"khac-phuc-su-co-khi-nang-cap-goi-apt-tu-kho-luu-tru-elasticsearch-khong-thanh-cong","status":"publish","type":"docs","link":"https:\/\/raybeam.jp\/vi\/docs\/troubleshotting\/troubleshooting-apt-dist-upgrade-failure-from-the-elasticsearch-repository\/","title":{"rendered":"Kh\u1eafc ph\u1ee5c s\u1ef1 c\u1ed1 khi th\u1ef1c hi\u1ec7n l\u1ec7nh `apt dist-upgrade` t\u1eeb kho l\u01b0u tr\u1eef Elasticsearch kh\u00f4ng th\u00e0nh c\u00f4ng"},"content":{"rendered":"<h2 id=\"problem\" class=\"wp-block-heading\">Problem<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The system could run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">but failed during:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt dist-upgrade\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>403 Forbidden\nhttps:&#47;&#47;artifacts.elastic.co\/packages\/9.x\/apt\/...\/elasticsearch-9.4.2-amd64.deb\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That means package lists were updated successfully, but APT could not download a specific Elasticsearch package archive.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"why-this-happened\" class=\"wp-block-heading\">Why this happened<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This was not an Ubuntu mirror issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Key evidence:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>apt update<\/code>&nbsp;succeeded.<\/li>\n\n\n\n<li>The failure came only from&nbsp;<code>artifacts.elastic.co<\/code>.<\/li>\n\n\n\n<li>The failing request used IPv6:&nbsp;<code>2600:1901:0:1d7::<\/code>.<\/li>\n\n\n\n<li>A direct request to the same package URL succeeded over IPv4.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So the root cause was a network\/IPv6 path problem to the Elasticsearch repo, not a bad package or repository configuration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"solution-found\" class=\"wp-block-heading\">Solution found<\/h2>\n\n\n\n<h3 id=\"temporary-fix\" class=\"wp-block-heading\">Temporary fix<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Force APT to use IPv4 for the current operation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt -o Acquire::ForceIPv4=true update\nsudo apt -o Acquire::ForceIPv4=true dist-upgrade\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This bypassed the broken IPv6 route and allowed the package download to succeed.<\/p>\n\n\n\n<h3 id=\"permanent-fix\" class=\"wp-block-heading\">Permanent fix<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Persist the IPv4-only setting for APT:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo 'Acquire::ForceIPv4 \"true\";' | sudo tee \/etc\/apt\/apt.conf.d\/99force-ipv4\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then run normal updates again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt dist-upgrade\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"what-this-means\" class=\"wp-block-heading\">What this means<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The system itself is healthy enough to update package metadata.<\/li>\n\n\n\n<li>The error was isolated to Elasticsearch package retrieval over IPv6.<\/li>\n\n\n\n<li>Using IPv4 is a practical workaround when a repo is reachable over IPv4 but not over IPv6.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 id=\"optional-followup\" class=\"wp-block-heading\">Optional follow-up<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For a cleaner long-term solution, investigate IPv6 connectivity on the host or network. But for now, the immediate problem is solved by forcing APT to use IPv4.<\/p>","protected":false},"featured_media":0,"parent":47267,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","pmpro_default_level":"","nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-47268","docs","type-docs","status-publish","hentry","pmpro-has-access"],"_links":{"self":[{"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/docs\/47268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/comments?post=47268"}],"version-history":[{"count":1,"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/docs\/47268\/revisions"}],"predecessor-version":[{"id":47269,"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/docs\/47268\/revisions\/47269"}],"up":[{"embeddable":true,"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/docs\/47267"}],"wp:attachment":[{"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/media?parent=47268"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/raybeam.jp\/vi\/wp-json\/wp\/v2\/docs_category?post=47268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}