覆盖依赖deb包中的文件

时间:2015-11-18 11:09:57

标签: ubuntu dependencies deb

我尝试构建一个deb包,为SSH提供特定的配置文件(即/etc/ssh/ssh_config)。我还希望将我的软件包依赖于上游openssh-client软件包,以实现 openssh-client 和" on-top"的安装。如果在调用apt-get install my-ssh-package时我的特定配置文件安装。

我使用 fpm / fpm-cookery 来构建我的 deb 包。这有效但是当我使用 dpkg 进行本地测试时,我收到了错误:

$ dpkg -i pkg/my-ssh-package_0.1.0-1_all.deb 
Selecting previously unselected package my-ssh-package.
(Reading database ... 18814 files and directories currently installed.)
Preparing to unpack .../my-ssh-package_0.1.0-1_all.deb ...
Unpacking my-ssh-package (0.1.0-1) ...
dpkg: error processing archive pkg/my-ssh-package_0.1.0-1_all.deb (--install):
 trying to overwrite '/etc/ssh/ssh_config', which is also in package openssh-client 1:6.6p1-2ubuntu2.3
Errors were encountered while processing:
 pkg/my-ssh-package_0.1.0-1_all.deb

如何强制我的包覆盖来自上游 openssh-client 包的/etc/ssh/ssh_config

1 个答案:

答案 0 :(得分:0)

  1. 让你的包在/ tmp
  2. 中安装新的/ etc / ssh / ssh_config
  3. 在包中添加 postinst 文件,将文件从/ tmp复制到/ etc / ssh