嘗試安裝不在根資料夾中的 .deb 軟體包時,“admindir 必須位於 instdir 內,dpkg 才能正常工作”

嘗試安裝不在根資料夾中的 .deb 軟體包時,“admindir 必須位於 instdir 內,dpkg 才能正常工作”

由於超出此問題範圍的原因,我必須在沒有網路連線或 GUI 的虛擬機器上安裝一些程式庫。首先,我下載了所有的.deb我的主機系統上需要的軟體包,然後使用 WinSCP 複製到虛擬機器上。最後,使用 PuTTY,我移動到包含這些包的資料夾並使用以下命令安裝它們

sudo dpkg -i *.deb

這工作得很好,因為我設法使用了該庫實現的一些函數和資料結構(為了完整性起見libglib2.0-dev)。無論如何,我需要它不是安裝在根資料夾中,而是安裝在

/opt/corbos-linux/2.4.4/sysroots/x86_64-poky-linux/

此時我嘗試執行:

sudo dpkg -i --instdir=/opt/corbos-linux/2.4.4/sysroots/x86_64-poky-linux/ *.deb

但出現這個錯誤:

dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg: trying script from the new package instead

如何實現這項目標?有關正在使用的虛擬機器的一些額外資訊:

Static hostname: 06e2e468f8c4
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 07e8a1bebd223fc12a4a73e45d72352a
           Boot ID: ae8230cd752c4e5f8a4772ebf2ae80a1
    Virtualization: oracle
  Operating System: Ubuntu 16.04.6 LTS
            Kernel: Linux 4.4.0-75-generic
      Architecture: x86-64

相關內容