Reputation: 3086
I have created a directory structure with an executable file. Following is the output of tree:
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)*
This however, is not working with "file.txt". I want this file to go into /usr/local/include/myprog/ but that is not happening. it's giving me the error:
(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
Can anyone offer any advice?
Upvotes: 1
Views: 765
Reputation: 37487
From the error message:
trying to overwrite '/usr/local/include/myprog/file.txt', which is also in package program2
It looks like you have a package program2
already installed on your system that have already installed this file usr/local/include/myprog/file.txt
.
You should first uninstall this package dpkg -r program2
Upvotes: 2
Reputation: 368629
The error is pretty clear: You try to install program-v5
and it attempts to overwrite a file already present and owned by package program2
.
So you need to either
manually uninstall program2
before installing program-v5
, or
add the required Conflicts:
, Provides:
, Replaces:
flags in debian/control
-- see the docs.
Lastly, for packages, /usr
is a more natural choice then /usr/local
.
Upvotes: 4