“apt install”不起作用,但“dpkg -i”起作用了

“apt install”不起作用,但“dpkg -i”起作用了

我尝试将与 qemu 相关的软件包(“qemu-system-data”……等等)从 Ubuntu disco 移植到 xenial。

我下载了qemu-system-data 包,提取它,修改控制文件,然后通过重新构建它dpkg-deb --build

当我测试它时,奇怪的是“apt install”总是成功并告诉我新安装了 0 个。以下是部分日志:

~$ sudo apt autoremove --purge qemu-*
...

~$ sudo apt install 'qemu-system-data_1:3.0+dfsg-2ubuntu201911182001.deb' 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
~$

/var/log/apt/term.log和中都没有什么新东西/var/log/apt/history.log。但我可以使用 安装包sudo dpkg -i并使用 删除它apt autoremove

~$ sudo dpkg -i qemu-system-data_1:3.0+dfsg-2ubuntu201911182001.deb
Selecting previously unselected package qemu-system-data.
(Reading database ... 259053 files and directories currently installed.)
Preparing to unpack qemu-system-data_1:3.0+dfsg-2ubuntu201911182001.deb ...
Unpacking qemu-system-data (1:3.0+dfsg-2ubuntu201911182001) ...
Setting up qemu-system-data (1:3.0+dfsg-2ubuntu201911182001) ...

~$ sudo apt autoremove --purge qemu-system-data
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
   qemu-system-data*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After...

以下是DEBIAN/controlqemu-system-data_1:3.0+dfsg-2ubuntu201911182001.deb

Package: qemu-system-data
 Source: qemu
 Version: 1:3.0+dfsg-2ubuntu201911182001
 Architecture: all
 Maintainer: Ubuntu Developers <[email protected]>
 Installed-Size: 996
 Breaks: qemu-system-s390x (<< 1:3.1+dfsg-2ubuntu1~)
 Replaces: qemu-system-common (<< 1:2.12+dfsg-2~), qemu-system-s390x (<< 1:3.1+dfsg-2ubuntu1~)
 Provides: qemu-keymaps
 Section: otherosfs
 Priority: optional
 Multi-Arch: foreign
 Homepage: http://www.qemu.org/
 Description: QEMU full system emulation (data files)
  This package provides architecture-neutral data files
  (such as keyboard definitions, icons) for system-mode
  QEMU emulation (qemu-system-*) packages.
 Original-Maintainer: Debian QEMU Team <[email protected]>

我该如何修复此问题?

谢谢。

答案1

如果您想使用 apt-get,则需要将此文件放入存储库(远程或本地)(更多信息请见此处 -https://wiki.debian.org/DebianRepository/Setup)。你也可以使用 apt 安装它:

sudo apt install /path/to/file.deb

相关内容