Skip to content

Instantly share code, notes, and snippets.

@ThinGuy
Last active June 3, 2020 09:42
Show Gist options
  • Save ThinGuy/3ffd460b8e785f69e4ca59dc96acc390 to your computer and use it in GitHub Desktop.
Save ThinGuy/3ffd460b8e785f69e4ca59dc96acc390 to your computer and use it in GitHub Desktop.
Fix “Hash sum mismatch” error in maas that can occur when a local mirror and maas' apt-proxy cache get out of sync
#To fix bad hashInsert the following as after "late_commands:" in /etc/maas/preseeds/curtin_userdata
prxyfix_01_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'Acquire::http::Pipeline-Depth 0;' > /etc/apt/apt.conf.d/99FixBadProxy"]
prxyfix_02_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'Acquire::http::No-Cache true;' >> /etc/apt/apt.conf.d/99FixBadProxy"]
prxyfix_03_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo 'Acquire::BrokenProxy true;' >> /etc/apt/apt.conf.d/99FixBadProxy"]
#Automatically insert above into /etc/maas/preseeds/curtin_userdata using sed
sudo sed -e '/late_commands:/a \ \ prxyfix_01_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo '"'"'Acquire::http::Pipeline-Depth 0;'"'"' > /etc/apt/apt.conf.d/99FixBadProxy"]\n\ \ prxyfix_02_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo '"'"'Acquire::http::No-Cache true;'"'"' >> /etc/apt/apt.conf.d/99FixBadProxy"]\n\ \ prxyfix_03_cmd: ["curtin", "in-target", "--", "sh", "-c", "/bin/echo '"'"'Acquire::BrokenProxy true;'"'"' >> /etc/apt/apt.conf.d/99FixBadProxy"]' -i /etc/maas/preseeds/curtin_userdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment