jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.14k stars 1.07k forks source link

After install script not working #1945

Open uday1kiran opened 1 year ago

uday1kiran commented 1 year ago

For testing, I created a basic command.

fpm -s empty -t deb -n test --after-install ./tmp/post-install.sh

post-install.sh content is very basic used for testing.

#!/bin/bash
echo "testing install"
mkdir -p /tmp/testing
pip install torc
```h

once the deb file is created, tested that on an ubuntu 20 and 22 machine and got below error as post install script not found.
vagrant@vagrant:~$ sudo apt install -y /vagrant/test_1.0_all.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'test' instead of '/vagrant/test_1.0_all.deb'
The following NEW packages will be installed:
  test
0 upgraded, 1 newly installed, 0 to remove and 107 not upgraded.
Need to get 0 B/1,118 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /vagrant/test_1.0_all.deb test all 1.0 [1,118 B]
Selecting previously unselected package test.
(Reading database ... 41035 files and directories currently installed.)
Preparing to unpack /vagrant/test_1.0_all.deb ...
Unpacking test (1.0) ...
Setting up test (1.0) ...
dpkg (subprocess): unable to execute installed test package post-installation script (/var/lib/dpkg/info/test.postinst): No such file or directory

dpkg: error processing package test (--configure): installed test package post-installation script subprocess returned error exit status 2 Errors were encountered while processing: test E: Sub-process /usr/bin/dpkg returned an error code (1)

Apteryks commented 1 year ago

I got the same error when combining --after-remove and --after-upgrade. If I use just --after-remove, it works, but when apt install new-package (upgrade), it seems my postrm (after-remove) script runs, which messes the installation. Hm.

Apteryks commented 1 year ago

That's on Debian Bookworm with dpkg 1.21.22 and apt 2.6.1.