Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

get_manually_installed_packages() requires a /var/log/installer/initial-status.gz

未关闭
#76 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
backend, desktop

调研方向

从 usr/lib/python3/dist-packages/mintcommon/installer/cache.py 中的 PkgCache.get_manually_installed_packages() 和 _get_manually_installed_debs() 开始,然后在缺少 /var/log/installer/initial-status.gz 的情况下复现。检查 mintinstall 中的已安装软件包视图以及文档所述的公开行为;完成的标准是,缺少安装程序文件不再导致软件包列表为空,并且该方法的契约准确无误。

由索引模型根据 Issue 内容生成。

描述

On systems not having the file "/var/log/installer/initial-status.gz", mintcommon.installer.cache.PkgCache.get_manually_installed_packages() will just return None, not even trying to return a flatpak list and not trying alternative direct apt or dpkg queries for listing installed packages.

Based on an Askbuntu answer and reading the code, the purpose of the file initial-status.gz seems to have been to record which packages came from the system installer, as opposed to those added later by the user. But some installers have apparently stopped providing initial-status.gz. I used mintupgrade 2025.11.21 and noticed that I don't have this file now. (As I previously used synaptic rather than mintinstall, I didn't notice any problem until now and I don't know whether I had the file before the upgrade either.) If the distinction between package installaction cause can not be made, it would seem better to list all installed packages (regardless of cause) than to list none as installed. Mintinstall and Mintbackup seem to fail to list installed packages due to this behaviour.

To confirm that the missing file was the only problem, I created a plain text file /tmp/initial-status with a single line saying

Package: mintinstall

(It doesn't seem to matter which package name is used, just a space might work too.)
I then ran gzip /tmp/initial-status and sudo mv -n /tmp/initial-status.gz /var/log/installer/initial-status.gz to put this gzipped file where mintcommon expects to find a file with at least one line starting with "Package: ".

Now, running mintinstall and going to the "Show installed applications" gives me a long list, including both system packages and flatpak packages. (Before this list was empty, except the specific installed packages whose details I had open in mintinstall.). Actually, I can then remove the .gz-file, and mintinstall keeps showing a list of installed packages (probably cached somewhere, but clicking to reload the list of packages didn't clear it.)

  • Is it a formal requirement that all Linux Mint (Debian Edition) installers create /var/log/installer/initial-status.gz? So the bug would be in whichever didn't?
  • Should mintcommon's get_manually_installed_packages() work even when the file is missing? I would prefer the latter, just listing all packages if there's no other method to exclude some that came from a system-installer.

The docstring of the problematic private method _get_manually_installed_debs() does document that it "Requires a package list provided by the installer. Currently knows only Ubiquity's /var/log/installer/initial-status.gz". However, this caveat is not mentioned on the public method get_manually_installed_packages(), which just says "Get list of all manually installed packages (apt and flatpak)". And I guess the mintinstall and mintbackup packages were not realizing this limitation and did not happen to test on a system without this file.

主要语言
Python
星标
25
派生
32
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

linuxmint/mintcommon 的其他 Issue

查看 linuxmint/mintcommon 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。