已安装的 Debian 软件包列表 - 但有一些变化
我有一个旧的 Debian 盒子,我在很长一段时间内大量使用它,它无法再干净地启动,所以我拿出一张新的 Ubuntu Live CD 给它第二次生命的机会。我备份了所有文件,但现在我想查看我安装了哪些软件包。问题: dpkg 维护者似乎只希望有人从有问题的操作系统中执行此操作,而不是寄生 Live CD。最终结果是谷歌完全没有关于如何做到这一点的结果。
我将尝试找出 dpkg 在给定 --list 选项的情况下读取哪些文件,然后移植正确的文件,但我希望有一个比我计划做的更好的选择。
有什么想法吗?
I have an old Debian box that I used heavily over a long period of time that will no longer boot cleanly, so I pulled out a new Ubuntu Live CD to give it a second chance at life. I backed up all my files, but now I want to review what packages I had installed. Problem: It appears that the dpkg maintainers only expect a person to do this from the operating system in question, rather than a parasitic Live CD. The end result is a complete lack of Google results of how to do this.
I'm going to try figuring out which files dpkg reads given the --list option, and then transplanting the proper files, but I'd prefer there to be a better option than what I plan on doing.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所需要做的就是 chroot 到您备份的文件系统,然后从那里运行 dpkg -la 。您还可以执行
dpkg -la --root=/your/backup/dir
而无需 chroot。如果以允许 chroot 的方式提取文件系统不方便,那么您要查找的文件是
/var/lib/dpkg/status
。该格式相当不言自明;已安装的软件包将列为状态:安装成功
。All you need to do is chroot into the filesystem you backed up, and run
dpkg -la
from there. You can also dodpkg -la --root=/your/backup/dir
without chrooting.If it's inconvenient to extract the filesystem in a way that lets you chroot into it, then the file you're looking for is
/var/lib/dpkg/status
. The format is fairly self-explanatory; packages that are installed will be listed asStatus: install ok installed
.