無法執行新的預安裝腳本 (/var/lib/dpkg/tmp.ci/preinst)

無法執行新的預安裝腳本 (/var/lib/dpkg/tmp.ci/preinst)

我嘗試在我的流浪盒中安裝一個 .deb 文件,該文件使用通用/ubuntu1604圖像,但我收到以下錯誤:

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

錯誤

這種情況只發生在該影像上。如果我嘗試在我的 Linux 機器( xenial )或具有不同 Linux 映像的另一個 vagrant box 中安裝相同的 .deb 文件,則 .deb 檔案會正確安裝。

答案1

您缺少出現在 preinst 腳本的 shebang 行中的可執行檔。

  1. 將包元資料提取到暫存目錄:dpkg -e wtbuild.deb tmp
  2. tmp/preinst在文字編輯器中開啟。
  3. 第一行應以字元 開頭#!。之後出現的文字是將用於運行該文件的程式。你錯過了那個程式。
  4. 確定提供缺失程序的包。例如,如果程式是/usr/bin/python,您應該安裝該python軟體包:sudo apt-get install python

如果您維護 wtbuild.deb,則應該花時間將缺少的依賴項新增至套件的control檔案。如果其他人維護 wtbuild.deb,您應該提交錯誤報告並包含缺少的依賴套件的名稱。

相關內容