如何在 postinst 中运行 dpkg -i

如何在 postinst 中运行 dpkg -i

我正在制作一个包含多个软件包的 Debian 软件包。因此,在 Debian 软件包中,我将 ./drivers/*.deb 移至 $DEBIAN/data/itms/drivers。

sudo mkdir -p $DEBIAN/mnt
sudo mkdir -p $DEBIAN/mnt/data
sudo mkdir -p $DEBIAN/mnt/data/itms
sudo mkdir -p $DEBIAN/mnt/data/itms/drivers
sudo cp -vr ./drivers/* $DEBIAN/mnt/data/itms/drivers # moving the *deb from driver folders into $DEBIAN

然后在 postint 脚本中,我将运行sudo dpkg -i -R /mnt/data/itms/drivers。但是,我得到了这个

E:could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: unable to aquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
dpkg: error processing package xx-drivers (--install):
   installed xx-drivers package post-installation script subprocess returned error exit status 100

我认为这是因为我正在运行 dpkg 来提取我的 xx-drivers.deb,但我的帖子也试图访问 dpkg。我有没有办法让我的 dpkg 把我的 debian 软件包放在 xx-drivers.deb 里面?

感谢您!

相关内容