<?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 JiangYM&#39;s Blog</title>
    <link>https://jiangym.top/blog/tags/ubuntu/</link>
    <description>Recent content from JiangYM&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    
    <managingEditor>xxx@example.com (JiangYM)</managingEditor>
    <webMaster>xxx@example.com (JiangYM)</webMaster>
    
    <copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright>
    
    <lastBuildDate>Fri, 18 Sep 2026 16:30:00 +0800</lastBuildDate>
    
    
    <atom:link href="https://jiangym.top/blog/tags/ubuntu/index.xml" rel="self" type="application/rss&#43;xml" />
    

    
    

    <item>
      <title>APT 包管理踩坑记：从 snap 到 deb 到 PyPI 的混乱人生</title>
      <link>https://jiangym.top/blog/post/apt-package-management-pitfalls/</link>
      <pubDate>Fri, 18 Sep 2026 16:30:00 &#43;0800</pubDate>
      <author>xxx@example.com (JiangYM)</author>
      <guid>https://jiangym.top/blog/post/apt-package-management-pitfalls/</guid>
      <description>
        <![CDATA[<h1>APT 包管理踩坑记：从 snap 到 deb 到 PyPI 的混乱人生</h1><p>作者：JiangYM（xxx@example.com）</p>
        
          <p>先说个背景：我博客的 VPS 跑的是 Ubuntu 24.04。用了一年多，踩了不少跟包管理有关的坑，今天一次性吐出来。</p>
<h2 id="snap-真的是我见过最傲慢的东西">
<a class="header-anchor" href="#snap-%e7%9c%9f%e7%9a%84%e6%98%af%e6%88%91%e8%a7%81%e8%bf%87%e6%9c%80%e5%82%b2%e6%85%a2%e7%9a%84%e4%b8%9c%e8%a5%bf"></a>
Snap 真的是我见过最傲慢的东西
</h2><p>Ubuntu 24.04 默认把好多包都改成 snap 格式了。Firefox 是 snap，Software Store 是 snap，甚至 <code>apt install</code> 某些包的时候它会在背后给你装个 snap 版本。</p>
<p>最离谱的是什么？你 <code>apt install firefox</code>，装完发现是个 snap 包，启动慢三秒，/snap 目录下多好几个 loop 设备。我查了查 df -h，发现 snap 的 squashfs 文件系统占了我好几个 inode。</p>
<p>而且 snap 的更新机制真的很恶心——后台自动更新，更新失败了就挂着，下次启动发现&quot;哦豁，打不开了&quot;。我那个 1 核 1.9G 的小鸡本来资源就紧，snap 的自动更新还经常在半夜把 CPU 拉满。</p>
<p>解决方法？我的 VPS 上直接 <code>apt purge snapd</code> 了。反正服务器不需要 Firefox，也不走 Ubuntu Desktop 那套生态，snap 对我就是负资产。</p>
<h2 id="apt-源那些事">
<a class="header-anchor" href="#apt-%e6%ba%90%e9%82%a3%e4%ba%9b%e4%ba%8b"></a>
APT 源那些事
</h2><p>Ubuntu 的 apt 源设计其实挺不错的，但刚上手的时候有几个事让我很迷惑。</p>
<p><strong>源文件在 /etc/apt/sources.list 和 /etc/apt/sources.list.d/ 下</strong>。Ubuntu 24.04 开始默认用 .sources 格式（debian822 格式），不是以前那个一行一个源的 old style 了。区别不大，就是结构化了，但如果你手动写习惯了旧格式，一眼看过去会懵：这什么玩意儿？</p>
        
        <hr><p>本文2026-09-18首发于<a href='https://jiangym.top/blog/'>JiangYM's Blog</a>，最后修改于2026-09-18</p>]]>
      </description>
      
        <category>技术</category>
      
    </item>
    
  </channel>
</rss>
