创建具有依赖项的.deb文件时出现问题

时间:2012-03-29 14:12:30

标签: linux ubuntu installation deb

我创建了一个带有可执行文件的目录结构。以下是树的输出:

program-5
├── debian
│   ├── DEBIAN
│   │   ├── changelog
│   │   ├── compat
│   │   ├── control
│   │   ├── copyright
│   │   ├── docs
│   │   ├── emacsen-install.ex
│   │   ├── emacsen-remove.ex
│   │   ├── emacsen-startup.ex
│   │   ├── init.d.ex
│   │   ├── manpage.1.ex
│   │   ├── manpage.sgml.ex
│   │   ├── manpage.xml.ex
│   │   ├── menu.ex
│   │   ├── postinst.ex
│   │   ├── postrm.ex
│   │   ├── preinst.ex
│   │   ├── prerm.ex
│   │   ├── program.cron.d.ex
│   │   ├── program.debhelper.log
│   │   ├── program.default.ex
│   │   ├── program.doc-base.EX
│   │   ├── README.Debian
│   │   ├── README.source
│   │   ├── rules
│   │   └── watch.ex
│   └── usr
│       └── local
│           └── include
│               └── myprog
│                   ├── file.txt
└── program *(executable)*

然而,这不适用于“file.txt”。我希望这个文件进入/ usr / local / include / myprog /但是没有发生。它给了我错误:

(Reading database ... 
(Reading database ... 5%
...
(Reading database ... 100%
(Reading database ... 204105 files and directories currently installed.)
Unpacking program-v5 (from .../program-5_1.4.2_i386.deb) ...
dpkg: error processing /tmp/program-5/debian/program-5_1.4.2_i386.deb (--install):
 trying to overwrite '/usr/local/include/myprog/file.txt', which is also in package program2 20120329-1
dpkg-deb (subprocess): data: internal gzip write error: Broken pipe
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg-deb (subprocess): failed in write on buffer copy for failed to write to pipe in copy: Broken pipe
Errors were encountered while processing:
 /tmp/program-5/debian/program-5_1.4.2_i386.deb

有人可以提供任何建议吗?

2 个答案:

答案 0 :(得分:4)

错误非常明确:您尝试安装program-v5并尝试覆盖已存在并由包program2拥有的文件。

所以你需要

  • 在安装program2

  • 之前手动卸载program-v5
  • Conflicts:中添加所需的Provides:Replaces:debian/control标记 - 请参阅文档。

最后,对于软件包,/usr/usr/local更自然的选择。

答案 1 :(得分:2)

从错误消息:

  

尝试覆盖'/usr/local/include/myprog/file.txt',这是   也在程序包2中

您的系统上已经安装了已安装此文件program2的软件包usr/local/include/myprog/file.txt

您应首先卸载此程序包dpkg -r program2