<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Apt on inetshell</title><link>https://inet.sh/en/tags/apt/</link><description>Recent content in Apt on inetshell</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 25 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://inet.sh/en/tags/apt/index.xml" rel="self" type="application/rss+xml"/><item><title>Proxmox VE without a subscription: no-subscription repositories on PVE 9 (deb822) and PVE 8</title><link>https://inet.sh/en/posts/proxmox/no-subscription-repos/</link><pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate><guid>https://inet.sh/en/posts/proxmox/no-subscription-repos/</guid><description>How to keep a Proxmox VE without a subscription updating with no 401 errors: disable pve-enterprise and enable pve-no-subscription (plus Ceph) on PVE 9 with deb822 .sources files and on PVE 8 with .list files. Includes apt modernize-sources and the Proxmox Backup Server equivalent.</description><content:encoded><![CDATA[<h2 id="tldr">TL;DR</h2>
<p><strong>PVE 9</strong> (Debian 13 <em>trixie</em>, deb822 format):</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">cat &gt; /etc/apt/sources.list.d/proxmox.sources <span class="s">&lt;&lt;&#39;EOF&#39;
</span></span></span><span class="line"><span class="cl"><span class="s">Types: deb
</span></span></span><span class="line"><span class="cl"><span class="s">URIs: http://download.proxmox.com/debian/pve
</span></span></span><span class="line"><span class="cl"><span class="s">Suites: trixie
</span></span></span><span class="line"><span class="cl"><span class="s">Components: pve-no-subscription
</span></span></span><span class="line"><span class="cl"><span class="s">Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
</span></span></span><span class="line"><span class="cl"><span class="s">EOF</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Disable enterprise (without a subscription it returns 401 on every apt update)</span>
</span></span><span class="line"><span class="cl">grep -q <span class="s1">&#39;^Enabled:&#39;</span> /etc/apt/sources.list.d/pve-enterprise.sources <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  <span class="o">||</span> <span class="nb">echo</span> <span class="s1">&#39;Enabled: false&#39;</span> &gt;&gt; /etc/apt/sources.list.d/pve-enterprise.sources
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">apt update <span class="o">&amp;&amp;</span> apt full-upgrade
</span></span></code></pre></td></tr></table>
</div>
</div><p><strong>PVE 8</strong> (Debian 12 <em>bookworm</em>, one-line format):</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s1">&#39;deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription&#39;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  &gt; /etc/apt/sources.list.d/pve-no-subscription.list
</span></span><span class="line"><span class="cl">sed -i <span class="s1">&#39;s/^deb /# deb /&#39;</span> /etc/apt/sources.list.d/pve-enterprise.list
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">apt update <span class="o">&amp;&amp;</span> apt full-upgrade
</span></span></code></pre></td></tr></table>
</div>
</div><p>If the host runs Ceph, the Ceph enterprise repo has to be disabled too and swapped for its <code>no-subscription</code> (<a href="/en/posts/proxmox/no-subscription-repos/#ceph">below</a>).</p>
<h2 id="what-each-repository-does">What each repository does</h2>
<table>
  <thead>
      <tr>
          <th>Repo</th>
          <th>Purpose</th>
          <th>Without a subscription</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>pve-enterprise</code></td>
          <td>Stable packages, the most tested. Needs a subscription key</td>
          <td><code>apt update</code> returns <strong>401 Unauthorized</strong></td>
      </tr>
      <tr>
          <td><code>pve-no-subscription</code></td>
          <td>Public. Same packages, a bit earlier and with less testing</td>
          <td>Works</td>
      </tr>
      <tr>
          <td><code>pve-test</code></td>
          <td>Bleeding edge, for testing</td>
          <td>Works</td>
      </tr>
  </tbody>
</table>
<p>Proxmox is clear about it: <code>pve-no-subscription</code> is for <strong>testing and non-production use</strong>; in production they want you to pay for a subscription and use enterprise. For a lab or a homelab it is the normal repo.</p>
<p>The enterprise 401 does not break anything by itself, but every <code>apt update</code> ends in an error and the other repos are left half refreshed. Disabling it is the fix; there is no need to delete it.</p>
<h2 id="pve-9-sources-files-deb822">PVE 9: .sources files (deb822)</h2>
<p>Since PVE 9 the installer already writes <code>/etc/apt/sources.list.d/pve-enterprise.sources</code> in deb822 format. A <code>.sources</code> file is a block of keys:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># /etc/apt/sources.list.d/pve-enterprise.sources
</span></span><span class="line"><span class="cl">Types: deb
</span></span><span class="line"><span class="cl">URIs: https://enterprise.proxmox.com/debian/pve
</span></span><span class="line"><span class="cl">Suites: trixie
</span></span><span class="line"><span class="cl">Components: pve-enterprise
</span></span><span class="line"><span class="cl">Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
</span></span><span class="line"><span class="cl">Enabled: false
</span></span></code></pre></td></tr></table>
</div>
</div><p><code>Enabled: false</code> keeps it written but inactive. The no-subscription block is the one in the <a href="/en/posts/proxmox/no-subscription-repos/#tldr">TL;DR</a>; the test one is the same with <code>Components: pve-test</code>.</p>
<p>If you carry <code>.list</code> files from an upgrade off PVE 8, apt 3 converts them for you:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">apt modernize-sources
</span></span></code></pre></td></tr></table>
</div>
</div><p>It rewrites each <code>.list</code> as <code>.sources</code> and leaves the original as <code>.list.bak</code>.</p>
<h2 id="pve-8-list-files">PVE 8: .list files</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># /etc/apt/sources.list.d/pve-enterprise.list
</span></span><span class="line"><span class="cl"># deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"># /etc/apt/sources.list.d/pve-no-subscription.list
</span></span><span class="line"><span class="cl">deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
</span></span></code></pre></td></tr></table>
</div>
</div><p>Commenting the enterprise line with <code>#</code> is the deb822 <code>Enabled: false</code> equivalent.</p>
<h2 id="ceph">Ceph</h2>
<p>The installer also leaves the Ceph <strong>enterprise</strong> repo. Same treatment; the repo name carries the Ceph release the cluster runs (<code>ceph -v</code>):</p>
<p>PVE 9:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># /etc/apt/sources.list.d/ceph.sources
</span></span><span class="line"><span class="cl">Types: deb
</span></span><span class="line"><span class="cl">URIs: http://download.proxmox.com/debian/ceph-tentacle
</span></span><span class="line"><span class="cl">Suites: trixie
</span></span><span class="line"><span class="cl">Components: no-subscription
</span></span><span class="line"><span class="cl">Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
</span></span></code></pre></td></tr></table>
</div>
</div><p>Swap <code>ceph-tentacle</code> for <code>ceph-squid</code> if you are still on Squid. If the original file had <code>Components: enterprise</code>, replace the whole file with this one.</p>
<p>PVE 8:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># /etc/apt/sources.list.d/ceph.list
</span></span><span class="line"><span class="cl"># deb https://enterprise.proxmox.com/debian/ceph-squid bookworm enterprise
</span></span><span class="line"><span class="cl">deb http://download.proxmox.com/debian/ceph-squid bookworm no-subscription
</span></span></code></pre></td></tr></table>
</div>
</div><p>On bookworm there are <code>ceph-quincy</code>, <code>ceph-reef</code>, and <code>ceph-squid</code>; use the one matching your cluster, not the newest.</p>
<h2 id="proxmox-backup-server">Proxmox Backup Server</h2>
<p>Identical pattern with <code>pbs</code> in the URI and <code>pbs-no-subscription</code> as the component:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># /etc/apt/sources.list.d/proxmox.sources (PBS 4, trixie)
</span></span><span class="line"><span class="cl">Types: deb
</span></span><span class="line"><span class="cl">URIs: http://download.proxmox.com/debian/pbs
</span></span><span class="line"><span class="cl">Suites: trixie
</span></span><span class="line"><span class="cl">Components: pbs-no-subscription
</span></span><span class="line"><span class="cl">Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
</span></span></code></pre></td></tr></table>
</div>
</div><p>And <code>Enabled: false</code> in <code>pbs-enterprise.sources</code>.</p>
<h2 id="traps">Traps</h2>
<ul>
<li><strong>Do not mix suites.</strong> <code>bookworm</code> on PVE 8, <code>trixie</code> on PVE 9. One line with the wrong suite breaks the next <code>full-upgrade</code>.</li>
<li><strong>The keyring is already there.</strong> <code>/usr/share/keyrings/proxmox-archive-keyring.gpg</code> ships with any ISO install. You only need to download it when installing Proxmox on top of a clean Debian (the official guide for that path covers it).</li>
<li><strong><code>Signed-By</code> is mandatory in deb822</strong>; without that line apt ignores the repo with a warning.</li>
<li><strong>If apt fails with <code>pve-apt-hook: not found</code></strong>, that is not a repo problem: <a href="/en/posts/proxmox/pve-apt-hook-not-found/">separate post</a>.</li>
<li><strong>The GUI&rsquo;s &ldquo;no valid subscription&rdquo; notice</strong> is independent of the repos and is not fixed here; a Community subscription removes it and gives you the enterprise repo as a bonus.</li>
</ul>
<p>Reference: <a href="https://pve.proxmox.com/wiki/Package_Repositories">Package Repositories</a> on the Proxmox wiki.</p>
]]></content:encoded></item><item><title>Proxmox: /usr/share/proxmox-ve/pve-apt-hook: not found when updating</title><link>https://inet.sh/en/posts/proxmox/pve-apt-hook-not-found/</link><pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate><guid>https://inet.sh/en/posts/proxmox/pve-apt-hook-not-found/</guid><description>apt fails on Proxmox VE with &amp;#39;/bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found&amp;#39; because the proxmox-ve package is gone but its apt snippet is still there. How to unblock apt with an empty hook and reinstall proxmox-ve, or drop the snippet if you really removed Proxmox.</description><content:encoded><![CDATA[<h2 id="tldr">TL;DR</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">mkdir -p /usr/share/proxmox-ve
</span></span><span class="line"><span class="cl">touch /usr/share/proxmox-ve/pve-apt-hook
</span></span><span class="line"><span class="cl">chmod +x /usr/share/proxmox-ve/pve-apt-hook
</span></span><span class="line"><span class="cl">apt install -f
</span></span><span class="line"><span class="cl">apt install proxmox-ve
</span></span></code></pre></td></tr></table>
</div>
</div><p>Once <code>proxmox-ve</code> is reinstalled, the real hook replaces the empty one and <code>apt</code> is back to normal.</p>
<h2 id="the-error">The error</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">/bin/sh: 1: /usr/share/proxmox-ve/pve-apt-hook: not found
</span></span><span class="line"><span class="cl">E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
</span></span></code></pre></td></tr></table>
</div>
</div><p>It shows up on any <code>apt install</code>, <code>apt upgrade</code>, or <code>apt full-upgrade</code>, and blocks everything, including whatever you try in order to fix it.</p>
<h2 id="why-it-happens">Why it happens</h2>
<p>The <code>proxmox-ve</code> package installs two things that belong together:</p>
<table>
  <thead>
      <tr>
          <th>File</th>
          <th>What it is</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>/etc/apt/apt.conf.d/10pveapthook</code></td>
          <td>Tells apt to run the hook before every dpkg operation</td>
      </tr>
      <tr>
          <td><code>/usr/share/proxmox-ve/pve-apt-hook</code></td>
          <td>The hook: protects <code>proxmox-ve</code> and the Proxmox kernel from being removed by mistake</td>
      </tr>
  </tbody>
</table>
<p>If <code>proxmox-ve</code> went away (a miscalculated <code>apt remove</code> or <code>autoremove</code>, an interrupted <code>dist-upgrade</code>, a half-installed package), the script disappears but the file under <code>/etc/apt/apt.conf.d/</code> is a <em>conffile</em> and stays. apt keeps trying to run a script that no longer exists and fails before touching anything.</p>
<h2 id="fix-if-you-want-to-keep-proxmox">Fix if you want to keep Proxmox</h2>
<p>The empty hook only gets apt running; the point is to reinstall <code>proxmox-ve</code>:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">mkdir -p /usr/share/proxmox-ve
</span></span><span class="line"><span class="cl">touch /usr/share/proxmox-ve/pve-apt-hook
</span></span><span class="line"><span class="cl">chmod +x /usr/share/proxmox-ve/pve-apt-hook
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">apt install -f            <span class="c1"># close broken dependencies first (Proxmox staff recommendation)</span>
</span></span><span class="line"><span class="cl">apt install proxmox-ve    <span class="c1"># brings back the real hook and whatever else is missing</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>Check that the hook is now the real one and not your empty file:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">dpkg -S /usr/share/proxmox-ve/pve-apt-hook   <span class="c1"># proxmox-ve: /usr/share/proxmox-ve/pve-apt-hook</span>
</span></span><span class="line"><span class="cl">head -1 /usr/share/proxmox-ve/pve-apt-hook   <span class="c1"># #!/usr/bin/perl</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>After that, <code>apt full-upgrade</code> and a reboot to confirm the Proxmox kernel comes up.</p>
<h2 id="fix-if-you-removed-proxmox-on-purpose">Fix if you removed Proxmox on purpose</h2>
<p>If the box is going back to plain Debian, the snippet is leftover:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">rm /etc/apt/apt.conf.d/10pveapthook
</span></span><span class="line"><span class="cl"><span class="c1"># or, cleaner, purge what is left of the package:</span>
</span></span><span class="line"><span class="cl">dpkg --purge proxmox-ve
</span></span></code></pre></td></tr></table>
</div>
</div><p><code>apt remove</code> leaves conffiles behind; <code>purge</code> takes them with it.</p>
<h2 id="traps">Traps</h2>
<ul>
<li><strong>Do not leave the empty hook in place.</strong> It exists so apt cannot remove <code>proxmox-ve</code> or the <code>proxmox-kernel-*</code> package by accident. With the empty file that protection is gone.</li>
<li><strong>Check what left together with <code>proxmox-ve</code>.</strong> If apt removed it, it probably took dependencies along; <code>apt install proxmox-ve</code> brings them back, but read the list before accepting.</li>
<li><strong>If <code>apt install proxmox-ve</code> cannot find the package</strong>, the problem is in the repos: <a href="/en/posts/proxmox/no-subscription-repos/">no-subscription repositories</a>.</li>
<li>Reference: <a href="https://forum.proxmox.com/threads/error-with-update-bin-sh-1-usr-share-proxmox-ve-pve-apt-hook-not-found.45436/">Proxmox forum thread</a>.</li>
</ul>
]]></content:encoded></item></channel></rss>