1

I try to install a .deb file in my vagrant box that use generic/ubuntu1604 image but i got the following error:

Reading package lists... Done
Building dependency tree

Reading state information... Done
Reading state information... Done

A queue based service for watching directories for files to process as per its configuration.
Do you want to install the software package? [y/N]:y
(Reading database ... 108439 files and directories currently installed.)
Preparing to unpack wtbuild.deb ...
dpkg (subprocess): unable to execute new pre-installation script (/var/lib/dpkg/tmp.ci/preinst): No such file or directory
dpkg: error processing archive wtbuild.deb (--install):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 wtbuild.deb

error

That only happens with that image. If i try to install the same .deb file in my linux machine ( xenial ) or in another vagrant box with a different linux image the .deb file is installed correctly.

1

You're missing the executable that appears in the preinst script's shebang line.

  1. Extract the package metadata to a temporary directory: dpkg -e wtbuild.deb tmp
  2. Open tmp/preinst in a text editor.
  3. The first line should begin with the characters #!. The text that appears after that is the program that will be used to run the file. You're missing that program.
  4. Determine the package that provides the missing program. For example, if the program is /usr/bin/python, you should install the python package: sudo apt-get install python

If you maintain wtbuild.deb, you should take the time to add the missing dependency to the package's control file. If someone else maintains wtbuild.deb, you should file a bug report and include the name of the missing dependency package.

  • 1
    Thanks @Zenexer. This pointed me in the right direction. My shebang was off but not because the file didn't exist but because I had CrLf line endings instead of Lf. – N Jones Mar 2 '18 at 22:16
  • @NJones That's effectively the same thing. Linux treats the CR as part of the executable name, so it's searching for a binary that (probably) doesn't exist. – Zenexer Mar 3 '18 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.