<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>GitHub | no dogma blog</title><link>https://nodogmablog.bryanhogan.net/tag/github/</link><atom:link href="https://nodogmablog.bryanhogan.net/tag/github/index.xml" rel="self" type="application/rss+xml"/><description>GitHub</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Thu, 17 Sep 2026 00:00:00 +0000</lastBuildDate><image><url>https://nodogmablog.bryanhogan.net/media/icon_hu9c23d68d4e9f1f9acfa8237e5c2ea674_3344_512x512_fill_lanczos_center_3.png</url><title>GitHub</title><link>https://nodogmablog.bryanhogan.net/tag/github/</link></image><item><title>GitHub CLI Installation on Ubuntu</title><link>https://nodogmablog.bryanhogan.net/2026/09/github-cli-installation-on-ubuntu/</link><pubDate>Thu, 17 Sep 2026 00:00:00 +0000</pubDate><guid>https://nodogmablog.bryanhogan.net/2026/09/github-cli-installation-on-ubuntu/</guid><description>&lt;p>I recently installed Ubuntu 26.04.1 on one of my laptops and wanted to add the GitHub CLI. I followed the &lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian" target="_blank" rel="noopener">official installation instructions&lt;/a> and ran &lt;code>sudo apt install gh&lt;/code> in the terminal.&lt;/p>
&lt;p>&lt;strong>But&lt;/strong>, of course there is a but; otherwise I wouldn&amp;rsquo;t be writing this post. The version installed was nowhere near the latest version from GitHub. I ran &lt;code>gh --version&lt;/code> and got this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cfg" data-lang="cfg">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">gh version 2.46.0 (2026-06-18 Ubuntu 2.46.0-4ubuntu0.26.04.1~esm1)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">https://github.com/cli/cli/releases/tag/v2.46.0&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>I went through the instructions again, purged the package, and reinstalled it. The same result.&lt;/p>
&lt;p>Note how the output refers to 2.46.0-4ubuntu0.26.04.1~esm1. &lt;code>gh&lt;/code> is not being installed from the GitHub repository, but from the Ubuntu repository.&lt;/p>
&lt;p>To confirm this, run &lt;code>apt-cache policy gh&lt;/code> and you will see something like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cfg" data-lang="cfg">&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1&lt;/span>&lt;span>&lt;span style="color:#000">gh:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2&lt;/span>&lt;span> &lt;span style="color:#000">Installed: (none)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3&lt;/span>&lt;span> &lt;span style="color:#000">Candidate: 2.46.0-4ubuntu0.26.04.1~esm1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4&lt;/span>&lt;span> &lt;span style="color:#000">Version table:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5&lt;/span>&lt;span> &lt;span style="color:#000">2.101.0 500&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6&lt;/span>&lt;span> &lt;span style="color:#000">500 https://cli.github.com/packages stable/main amd64 Packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7&lt;/span>&lt;span> &lt;span style="color:#000">2.46.0-4ubuntu0.26.04.1~esm1 510&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8&lt;/span>&lt;span> &lt;span style="color:#000">510 https://esm.ubuntu.com/apps/ubuntu resolute-apps-security/main amd64 Packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9&lt;/span>&lt;span> &lt;span style="color:#000">2.46.0-4 500&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10&lt;/span>&lt;span> &lt;span style="color:#000">500 http://us.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>Lines 5 and 6: Even though I have added the GitHub repository, it is at a lower priority (500) than the Ubuntu repository (510).
Lines 7 and 8: The Ubuntu repository is the one that is being used to install &lt;code>gh&lt;/code>.&lt;/p>
&lt;p>I need to make the GitHub repository a higher priority. To do this, add a file called &lt;code>/etc/apt/preferences.d/github-cli&lt;/code> with the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cfg" data-lang="cfg">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">Package: gh&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">Pin: origin cli.github.com&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">Pin-Priority: 700&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>Now run &lt;code>apt-cache policy gh&lt;/code> again, and you should see -&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cfg" data-lang="cfg">&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1&lt;/span>&lt;span>&lt;span style="color:#000">gh:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2&lt;/span>&lt;span> &lt;span style="color:#000">Installed: (none)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3&lt;/span>&lt;span> &lt;span style="color:#000">Candidate: 2.101.0&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4&lt;/span>&lt;span> &lt;span style="color:#000">Version table:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5&lt;/span>&lt;span> &lt;span style="color:#000">2.101.0 700&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6&lt;/span>&lt;span> &lt;span style="color:#000">500 https://cli.github.com/packages stable/main amd64 Packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7&lt;/span>&lt;span> &lt;span style="color:#000">2.46.0-4ubuntu0.26.04.1~esm1 510&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8&lt;/span>&lt;span> &lt;span style="color:#000">510 https://esm.ubuntu.com/apps/ubuntu resolute-apps-security/main amd64 Packages&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9&lt;/span>&lt;span> &lt;span style="color:#000">2.46.0-4 500&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10&lt;/span>&lt;span> &lt;span style="color:#000">500 http://us.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>Now, the GitHub repository has a higher priority, and when you try to install &lt;code>gh&lt;/code>, it will be installed from the GitHub repository.&lt;/p>
&lt;p>Run &lt;code>sudo apt install gh&lt;/code>.&lt;/p></description></item></channel></rss>