<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/ubuntu/</link><description>Recent content in Ubuntu on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Sat, 16 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/ubuntu/index.xml" rel="self" type="application/rss+xml"/><item><title>Ubuntu Ansible 'waiting for privilege escalation prompt'</title><link>https://blog.iankulin.com/ubuntu26-bump/</link><pubDate>Sat, 16 May 2026 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/ubuntu26-bump/</guid><description>&lt;p&gt;I ran into a hiccup today - provisioning a new Ubuntu VPS, the ansible playbook to apply our security hardening failed.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ~/Developer/ansible_hl % ansible-playbook ssh-harden.yml --ask-vault-pass -e @vault.yml 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Vault password: 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PLAY &lt;span style="color:#81a1c1"&gt;[&lt;/span&gt;Copy the hardened SSHD_CONFIG file to the remote server&lt;span style="color:#81a1c1"&gt;]&lt;/span&gt; ****************************************************
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TASK &lt;span style="color:#81a1c1"&gt;[&lt;/span&gt;Gathering Facts&lt;span style="color:#81a1c1"&gt;]&lt;/span&gt; ********************************************************************************************
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#81a1c1"&gt;[&lt;/span&gt;ERROR&lt;span style="color:#81a1c1"&gt;]&lt;/span&gt;: Task failed: Timeout &lt;span style="color:#81a1c1"&gt;(&lt;/span&gt;12s&lt;span style="color:#81a1c1"&gt;)&lt;/span&gt; waiting &lt;span style="color:#81a1c1;font-weight:bold"&gt;for&lt;/span&gt; privilege escalation prompt:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fatal: &lt;span style="color:#81a1c1"&gt;[&lt;/span&gt;&amp;lt;redacted IP&amp;gt;&lt;span style="color:#81a1c1"&gt;]&lt;/span&gt;: UNREACHABLE! &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&amp;gt; &lt;span style="color:#81a1c1"&gt;{&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#34;changed&amp;#34;&lt;/span&gt;: false, &lt;span style="color:#a3be8c"&gt;&amp;#34;msg&amp;#34;&lt;/span&gt;: &lt;span style="color:#a3be8c"&gt;&amp;#34;Task failed: Timeout (12s) waiting for privilege escalation prompt:&amp;#34;&lt;/span&gt;, &lt;span style="color:#a3be8c"&gt;&amp;#34;unreachable&amp;#34;&lt;/span&gt;: true&lt;span style="color:#81a1c1"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;My routine is to run Ubuntu LTS, and when I was provisioning the server, I selected Ubuntu 26.04 LTS x64 without thinking. This LTS dropped in April, and excitingly the new versions of Ubuntu have Rust coreutils including &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The cause of the issue above (where anisible waits for the sudo password request but never sees it) is that the password prompt in &lt;code&gt;sudo-rs&lt;/code&gt; is different from real sudo. Here&amp;rsquo;s the old one:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ian@iris-orca:~$ sudo lsb_release -d
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#81a1c1"&gt;[&lt;/span&gt;sudo&lt;span style="color:#81a1c1"&gt;]&lt;/span&gt; password &lt;span style="color:#81a1c1;font-weight:bold"&gt;for&lt;/span&gt; ian: 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;No LSB modules are available.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Description:	Ubuntu 24.04.4 LTS
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ian@iris-orca:~$ sudo --version
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Sudo version 1.9.15p5
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Sudoers policy plugin version 1.9.15p5
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Sudoers file grammar version &lt;span style="color:#b48ead"&gt;50&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Sudoers I/O plugin version 1.9.15p5
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Sudoers audit plugin version 1.9.15p5
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ian@iris-orca:~$ 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And the new one:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ian@ksd-on-syd-001:~$ sudo lsb_release -d
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#81a1c1"&gt;[&lt;/span&gt;sudo: authenticate&lt;span style="color:#81a1c1"&gt;]&lt;/span&gt; Password: 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Description:	Ubuntu 26.04 LTS
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ian@ksd-on-syd-001:~$ sudo --version
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo-rs 0.2.13-0ubuntu1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ian@ksd-on-syd-001:~$ 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, &lt;code&gt;[sudo] password for ian: &lt;/code&gt; vs &lt;code&gt;[sudo: authenticate] Password: &lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not a big deal, and ansible has &lt;a href="https://github.com/ansible/ansible/pull/86175"&gt;already made&lt;/a&gt; a fix for the incompatibility, it just hasn&amp;rsquo;t flowed down to me yet. Ubuntu 24 is still LTS so I&amp;rsquo;ll drop back to that.&lt;/p&gt;
&lt;p&gt;For the adventurous, another possible approach would be to create an ansible user with passwordless ssh - I&amp;rsquo;d rather wait for the ansible update before I move to a Linux version using sudo_rs.&lt;/p&gt;</description></item><item><title>apt update - BADSIG 871920D1991BC93C</title><link>https://blog.iankulin.com/apt-update-badsig-871920d1991bc93c/</link><pubDate>Mon, 30 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/apt-update-badsig-871920d1991bc93c/</guid><description>&lt;p&gt;I have an ansible script that runs each weekend which basically does an &lt;code&gt;apt update &amp;amp;&amp;amp; apt upgrade -Y&lt;/code&gt; on every Debian based instance. This weekend it failed on one Ubuntu host. When I went it to try it manually, this was the output:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Hit&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Hit&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2&lt;/span&gt; https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;download&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;docker&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;linux&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy InRelease 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Hit&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;3&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;backports InRelease 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Hit&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;4&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;security InRelease 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Get&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;5&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates InRelease &lt;span style="color:#eceff4"&gt;[&lt;/span&gt;&lt;span style="color:#b48ead"&gt;119&lt;/span&gt; kB&lt;span style="color:#eceff4"&gt;]&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;5&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates InRelease 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; The following signatures were invalid&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; BADSIG &lt;span style="color:#b48ead"&gt;871920&lt;/span&gt;D1991BC93C Ubuntu Archive Automatic Signing Key &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2018&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;&amp;lt;&lt;/span&gt;ftpmaster&lt;span style="color:#bf616a"&gt;@&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Get&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;6&lt;/span&gt; https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;pkgs&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tailscale&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;stable&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Fetched &lt;span style="color:#b48ead"&gt;125&lt;/span&gt; kB &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; &lt;span style="color:#b48ead"&gt;1&lt;/span&gt;s &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#b48ead"&gt;125&lt;/span&gt; kB&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;s&lt;span style="color:#eceff4"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Reading package lists&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Building dependency tree&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Reading state information&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b48ead"&gt;11&lt;/span&gt; packages can be upgraded&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt; Run &lt;span style="color:#a3be8c"&gt;&amp;#39;apt list --upgradable&amp;#39;&lt;/span&gt; to see them&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; An error occurred during the signature verification&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt; The repository is &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; updated &lt;span style="color:#81a1c1;font-weight:bold"&gt;and&lt;/span&gt; the previous index files will be used&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt; GPG error&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu jammy&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates InRelease&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; The following signatures were invalid&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; BADSIG &lt;span style="color:#b48ead"&gt;871920&lt;/span&gt;D1991BC93C Ubuntu Archive Automatic Signing Key &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2018&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;&amp;lt;&lt;/span&gt;ftpmaster&lt;span style="color:#bf616a"&gt;@&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;archive&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dists&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;jammy&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;InRelease The following signatures were invalid&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; BADSIG &lt;span style="color:#b48ead"&gt;871920&lt;/span&gt;D1991BC93C Ubuntu Archive Automatic Signing Key &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2018&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;&amp;lt;&lt;/span&gt;ftpmaster&lt;span style="color:#bf616a"&gt;@&lt;/span&gt;ubuntu&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Some index files failed to download&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt; They have been ignored&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;or&lt;/span&gt; old ones used instead&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="solved"&gt;Solved&lt;/h3&gt;
&lt;p&gt;The first &lt;a href="https://ubuntuforums.org/showthread.php?t=2484710"&gt;google result&lt;/a&gt; mentions apt-cache - which &lt;a href="https://blog.iankulin.com/caching-apt-updates/"&gt;I also run&lt;/a&gt;, so a first level debug step is to delete the &lt;code&gt;/etc/apt/apt.conf.d/00aptproxy&lt;/code&gt; file that redirects apt requests to the cache I run in an LXC container. After that, if I re-run the &lt;code&gt;apt update&lt;/code&gt; it works perfectly. Seems like a problem with the cache then. I&amp;rsquo;m not sure why it would only affect this host though - I have other Ubuntu VM&amp;rsquo;s in the fleet that are not getting the original error.&lt;/p&gt;
&lt;p&gt;In any case, adding the conf back to force the server to use the cache made the error reappear - so it&amp;rsquo;s definitely related to the cache. With any type of cache, when there&amp;rsquo;s a problem related to it, deleting the contents is usually a &amp;ldquo;plan A&amp;rdquo; response. Assuming there&amp;rsquo;s some mechanism in &lt;a href="https://wiki.debian.org/AptCacherNg"&gt;Apt Cacher NG&lt;/a&gt; to do this, I went to the little stats/config webpage it serves up.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-08-at-8.41.44-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Well &amp;ldquo;Force the download of index files&amp;rdquo; sounds promising, let&amp;rsquo;s try that.&lt;/p&gt;
&lt;p&gt;I ticked the box for Force the download of index files (even having fresh ones), but it wasn&amp;rsquo;t clear to me how to make that change stick. The first button I could click further down the page was &amp;ldquo;Start Scan&amp;rdquo; which was related to some different checkboxes. I tried it anyway, but it didn&amp;rsquo;t force the downloading of index files. Time for some command line comandoing.&lt;/p&gt;
&lt;p&gt;The cache files for &lt;code&gt;aptcacher-ng&lt;/code&gt; are in &lt;code&gt;/var/cache/apt-cacher-ng/&lt;/code&gt; each distro has a directory in there.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-08-at-9.08.48-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Guessing the Ubuntu repository cache is probably stored in &lt;code&gt;uburep&lt;/code&gt;, I deleted that with &lt;code&gt;rm -R /var/cache/apt-cacher-ng/uburep&lt;/code&gt;. When I retried the &lt;code&gt;apt update&lt;/code&gt;, it worked perfectly, and I could see that the &lt;code&gt;/var/cache/apt-cacher-ng/uburep&lt;/code&gt; directory had re-appeared.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s the immediate problem fixed. The cause of this problem is unclear. Presumably it related to a package running on this Ubuntu machine (runs docker with a couple of small services) that is not running on my other Ubuntu hosts. It probably falls into the category of &amp;ldquo;don&amp;rsquo;t worry about unless it crops up again&amp;rdquo;.&lt;/p&gt;</description></item><item><title>How to deploy a Node.js app</title><link>https://blog.iankulin.com/how-to-deploy-a-node-js-app/</link><pubDate>Wed, 05 Jul 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/how-to-deploy-a-node-js-app/</guid><description>&lt;p&gt;This is one of those things that is simple once you know it. I had my &lt;a href="https://blog.iankulin.com/using-node-js-to-return-a-static-file/"&gt;tiny Node service working&lt;/a&gt; on my MacBook, but how do I run it on the server?&lt;/p&gt;
&lt;h3 id="native-or-container"&gt;Native or Container&lt;/h3&gt;
&lt;p&gt;Obviously I need Node.js installed on the server, should I have it in a Docker container, or native on the machine. There&amp;rsquo;s no clear answer here - in a container set up with Docker Compose might be more in line with my ideology of treating machines as disposable, but a native install is simpler, and I probably want to make life simpler at this stage when I&amp;rsquo;m learning everything.&lt;/p&gt;
&lt;h3 id="installing-node"&gt;Installing Node&lt;/h3&gt;
&lt;p&gt;This took me down a bigger rabbit hole than I was expecting. My VPS is Unbuntu LTS 22.04.2, so I spun one of those up in a VM on the homelab to try things out.&lt;/p&gt;
&lt;p&gt;A quick google search suggested the &lt;a href="https://github.com/nodesource/distributions"&gt;NodeSource binary distributions&lt;/a&gt;. That involves curling a big script (when I pasted the script into ChatGPT it said it wasn&amp;rsquo;t malicious). I could chose the Node version, so I grabbed 20.x That was as painless as you&amp;rsquo;d expect.&lt;/p&gt;
&lt;p&gt;Then I started wondering why I couldn&amp;rsquo;t just &lt;code&gt;apt install&lt;/code&gt; it. If I could do that, it would reduce the chance of a supply chain attack since I&amp;rsquo;d have the power of Canonical on my side. So I rolled the previous install back (thank you Proxmox backups of VMs), and tried:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;apt install nodejs&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That worked fine - Node is in the Ubuntu packages, but the version is &lt;a href="https://nodejs.dev/en/about/releases/"&gt;quite old&lt;/a&gt; - v12.22.9. This is on the current Ubuntu LTS 22.04.2. I don&amp;rsquo;t think it will matter for my purposes, but it explains why you&amp;rsquo;d do something other than just this.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also going to need &lt;a href="https://www.npmjs.com/"&gt;npm&lt;/a&gt;, so lets get that with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;apt install npm&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That seemed to download a heap more stuff that the node install.&lt;/p&gt;
&lt;h3 id="deploying-your-project"&gt;Deploying your project&lt;/h3&gt;
&lt;p&gt;Again, the first search result was more complicated than I needed. The advice was to clone my repository onto the server where I wanted to deploy. This is such a minor project, I hadn&amp;rsquo;t pushed it up to GitHub. So that seemed excessive. You know, not everything has to be DevOps CI/CD! I mean, we ain&amp;rsquo;t talking about a very complicated project here:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-06-26-at-8.34.20-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve got this tiny source file, and the text file I want to serve. All the dependencies (just Express) are in the &lt;code&gt;package.json&lt;/code&gt;, so presumably that&amp;rsquo;s all I need on the server to get going.&lt;/p&gt;
&lt;p&gt;I &lt;code&gt;scp&lt;/code&gt;&amp;rsquo;d those from my laptop to a directory on the folder:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-06-26-at-8.41.19-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once they are there, I need to install the packages from the package.json, so we do that with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That installed 59 packages (presumably Express plus 58 of it&amp;rsquo;s dependencies). Then I started the app with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;node .&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;and it worked!&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-06-26-at-8.55.34-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;h3 id="insomnia"&gt;Insomnia&lt;/h3&gt;
&lt;p&gt;I should probably explain what you&amp;rsquo;re looking at above. I could have tested this little node server by going to the api address in a browser and checked that I got back the text file I was expecting. And in Chrome (and I assume Firefox) there are developer tools that would show the return code etc. However, most of the REST API videos I&amp;rsquo;ve watched use a better tool - mostly &lt;a href="https://www.postman.com/"&gt;Postman&lt;/a&gt;. These sort of tools give you a heap of other capabilities, none of which I really need for this simple project, but will be very handy for more complex APIs where there is a body to the request.&lt;/p&gt;
&lt;p&gt;The only reason I&amp;rsquo;m using &lt;a href="https://insomnia.rest/"&gt;Insomnia&lt;/a&gt; instead of Postman is that when I tried Postman, it straightaway wanted some of my data to make it work. Insomnia hasn&amp;rsquo;t forced me to do that yet.&lt;/p&gt;</description></item><item><title>Proxmox - Installing a Virtual Machine</title><link>https://blog.iankulin.com/proxmox-installing-a-virtual-machine/</link><pubDate>Tue, 07 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-installing-a-virtual-machine/</guid><description>&lt;p&gt;Installing your first virtual machine (VM) in the Proxmox hypervisor is pretty straightforward. This post runs through those steps using Proxmox 7.3.&lt;/p&gt;
&lt;p&gt;You need an operating system for your virtual machine, I&amp;rsquo;m going to use &lt;a href="https://ubuntu.com/download/server"&gt;Ubuntu server&lt;/a&gt; in this example, but it could just as easily be &lt;a href="https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016-essentials"&gt;Windows server&lt;/a&gt;, or regular windows, or one of the desktop Linux distributions. Whichever you decide, you&amp;rsquo;ll need to find and download the ISO for it. The ISO is a (usually quite large) file needed to install the operating system.&lt;/p&gt;
&lt;p&gt;Once, you&amp;rsquo;ve got the ISO for the operating system, you need to upload it into Proxmox via the web interface. The ISO will be stored in the &lt;code&gt;local&lt;/code&gt; directory style storage. If you click on it in Proxmox, you&amp;rsquo;ll see there&amp;rsquo;s actually a section for ISOs, as well as buttons there to upload an ISO from your machine, or to directly download it into ProxMox from a link.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-27-at-5.45.54-pm-copy.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Above you can seen I&amp;rsquo;ve now got two ISO images stored in my local storage. Once an image is there, you are ready to install it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.03.45-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;In the top right of the Proxmox screen there are two blue buttons. One of them says &amp;ldquo;Create VM&amp;rdquo;, and that&amp;rsquo;s what we want to do. Now there will be a series of dialogs to click through and fill out. Most things we can just leave as defaults, but a few need some decisions.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.06.56-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The node (your server) is already filled out. Mine is &lt;code&gt;pve&lt;/code&gt; since I just used the default name when I first installed Proxmox. The VM (virtual machine) ID is used by Proxmox to identify the server. You can change this to any three digit number you haven&amp;rsquo;t used. I&amp;rsquo;m keeping 100. Some people use this to separate their server types, for example all their production servers might be in the three hundreds.&lt;/p&gt;
&lt;p&gt;You need to come up with a name for this VM. These can only use letters and numbers - no punctuation. I like to keep them short, and describe the purpose of this VM, but perhaps you want to name yours after the OS you are using. I&amp;rsquo;m calling this one dockerhost because it&amp;rsquo;s going to host my Docker containers. Once you&amp;rsquo;ve decided, hit &lt;code&gt;next&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.15.02-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s where we choose the image, I&amp;rsquo;m going with the Unbuntu I downloaded earlier.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.16.46-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The System page - I&amp;rsquo;m just leaving all the defaults and hitting &lt;code&gt;next&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.18.24-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;On the Disks page, we go have a decision to make: how much drive space does this VM get. You&amp;rsquo;ll remember from our discussion about thin provisioning that we can allocate more disk than we have, but it&amp;rsquo;s not a good idea. The final decision about this is something you need to make considering the purpose of this VM and the space you&amp;rsquo;ve got available to you. You might need to google around for recommendations. It&amp;rsquo;s pretty easy to increase the disk size after your VM is created, but more difficult to reduce it.&lt;/p&gt;
&lt;p&gt;The Wizard has suggested 32GB for me, but the &lt;a href="https://linuxconfig.org/ubuntu-22-04-minimum-requirements"&gt;minimum spec is for 2.5GB&lt;/a&gt;. I am going to be downloading a few large containers, so 10GB seems like a good starting point for me.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.29.27-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Next is the CPU&amp;rsquo;s. Leave the defaults for everything, except you need to make a decision about the number of cores. My baby server only has two cores, but yours may have a eight or more. Proxmox will ration things out to some extent by time slicing - so you can easily run eight VM&amp;rsquo;s all allocated one core on a four core processor. And in fact, since a lot of them will probably just be sitting there waiting for something to happen, none of them will need to wait.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s probably a bad idea to allocate all of your cores to one VM, so I&amp;rsquo;m going to say &amp;lsquo;one&amp;rsquo; for mine, but you should also consider the processing needs of your VMs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.44.45-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Another important consideration is the amount of memory. Again, the needs will be determined by your use case. In my case, the minimum spec is for 1GB, but I&amp;rsquo;m planning on loading up some large containers and I have 8GB in hardware. So I&amp;rsquo;ll go with 4GB. The story with the minimum memory field is a &lt;a href="https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory"&gt;little bit complicated&lt;/a&gt;, but basically, setting this lower than the max memory gives Proxmox a little bit of flexibility to share it around if you&amp;rsquo;re not using it all - which sounds like a good idea, so I&amp;rsquo;ll say my minimum is 2GB.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.47.21-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Networking in a visualized environment is a whole thing. But I have simple needs and only one hardware port, so all these defaults are fine for us.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.48.50-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The Confirm page is just a last chance to look over what we&amp;rsquo;ve chosen, then we can press &lt;code&gt;Finish&lt;/code&gt; to create our VM! A few seconds later it should be showing up in the server view. If we click on the VM in the server view, we can see the summary. It&amp;rsquo;s not very exciting yet because our machine is not running.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.57.42-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve highlighted the buttons we are going to use next in the image above. &lt;code&gt;Start&lt;/code&gt; is going to start the VM, and we&amp;rsquo;ll need to open the &lt;code&gt;Console&lt;/code&gt; to see what&amp;rsquo;s going on. Go ahead and click both of these now, and sit back in amazement.&lt;/p&gt;
&lt;p&gt;What happens next depends on what OS you are installing into this VM. You&amp;rsquo;ll just need to work your way through the questions accordingly. One point worth noticing though is that if is asks you questions like &amp;ldquo;Use the entire disk&amp;rdquo;, it&amp;rsquo;s talking about the virtual disk you allocated - not the physical disk.&lt;/p&gt;
&lt;p&gt;This operating system you&amp;rsquo;re installing now &lt;em&gt;doesn&amp;rsquo;t know&lt;/em&gt; it&amp;rsquo;s inside a virtual machine. Everything it sees - the machine bios, the screen, the memory - it&amp;rsquo;s all faked - and managed by Proxmox. You and Proxmox are playing god here. From the VM point of view, it could be installed directly on hardware. It doesn&amp;rsquo;t know the true nature of it&amp;rsquo;s world.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/pappademas_matrixkeanureeves.webp" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-4.15.24-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;While you are killing time waiting for your new OS to install, if you haven&amp;rsquo;t used noVNC before, it&amp;rsquo;s worth noticing the little slide in options on the left edge there.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-6.45.34-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-6.45.34-pm.png" width="974" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I most commonly use it to force this window fullscreen, but in the &amp;ldquo;Extra Keys&amp;rdquo; button might be handy if you&amp;rsquo;re running a Windows OS and want the Windows key. I don&amp;rsquo;t love this console window - I&amp;rsquo;d rather SSH in and use my terminal, but it&amp;rsquo;s a handy tool that&amp;rsquo;s always going to work if the VM is running.&lt;/p&gt;</description></item></channel></rss>