简体   繁体   中英

deb package creation using fpm with build dependencies

I'm trying to create a deb package using fpm, which contains some shell script files.But the deb package should create with a dependency called vim(vim editor in Linux). Means when installing deb package it should install vim first and then script files.

Requirement is when installing deb package the vim should install first and then script files.

The fpm command I have tried is :

  fpm -s dir -t deb -n 'test' --deb-pre-depends vim --after-install /home/test/testfile.sh -C /home test

And after deb package created. when installing it, I'm getting following errors:

dpkg: regarding test_1.0_amd64.deb containing test, pre-dependency problem:
 test pre-depends on vim
  vim is not installed.

dpkg: error processing archive test_1.0_amd64.deb (--install):
 pre-dependency problem - not installing test
Errors were encountered while processing:
 test_1.0_amd64.deb 

Thanks in Advance...

try --depends instead of --deb-pre-depends

"Depend" and "Pre Depend" are subtly different see here https://www.debian.org/doc/debian-policy/ch-relationships.html

Sounds like what you want to do is probably "Depend" so keep it simple

As @Vorsprung as alredy mentioned you need to use --depends :

fpm -s dir \
    -t deb \
    -n 'test' \
    --depends vim \
    --after-install /home/test/testfile.sh \
    -C /home test

You need to be aware that dpkg won't install the dependencies for you, but you can run apt-get afterwards to install all the missing dependencies:

dpkg -i test.deb
apt-get install -f

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM