1

I am making a Debian package that contains multiple packages. So in the Debian package, I moved my ./drivers/*.deb to $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

Then in the postint script, I would run sudo dpkg -i -R /mnt/data/itms/drivers. However, I got this

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

I am thinking it is because I am running the dpkg to extract my xx-drivers.deb, but my post is also trying to access dpkg. Is there anyway I can have my dpkg my debian packages inside xx-drivers.deb?

Thanks you!

  • 1
    What version of Ubuntu are you using? I'm pretty sure this is the wrong way to do this. You need to create a metapackage that pulls the other packages as individual dependencies. Also, your error is because apt/dpkg is already in use so it's locked. The system prevents other processes from calling dpkg while it is in use to prevent unintended conflicts and dependency issues. – mchid Apr 27 '22 at 16:27
  • 1
    Say you have packagename.deb. You design packagename.deb to call dependecy1.deb and dependecy2.deb etc. as dependencies of packagename. Then, just put all of the packages in the same directory so you can simply run sudo apt install "./*.deb" For example, if they are all in a directory named ~/drivers you would run sudo apt install "~/drivers/*.deb" and apt will automatically install the first package and the dependencies as well. – mchid Apr 27 '22 at 16:33
  • 1
    The problem is that you're trying to make dpkg do two things at once instead of simply allowing apt to call dpkg and handle dependency issues for you like it is supposed to. This is what dependencies are for. This is why we have dependencies. If you need to install multiple packages, simply list them as dependencies, make sure they are available when you run apt, and then, allow apt to automatically install the package and the dependencies. – mchid Apr 27 '22 at 16:36
  • "Metapackage" was really the wrong word. It's simply a package, unless the package only exists to install dependencies and then it would be a metapackage. Either way, the concept is the same. One package has dependencies and each are separate packages. – mchid Apr 27 '22 at 16:41
  • @mchid that is exactly what I am trying to do. So when I'm trying to do the the packagename.deb, I have to call for "sudo apt install "~/drivers/.deb"" instead of "sudo sudo dpkg -i -D1 ~/drivers/.deb" , correct? – 0nePunchMan Apr 27 '22 at 18:51
  • You simply make them dependencies. It's not part of the postinstall script. – mchid Apr 28 '22 at 17:10
  • @mchid Ohhh......that makes perfect sense. Sorry, it took a while to sink in. Thank you very much. – 0nePunchMan Apr 29 '22 at 18:32
  • Next time when you have a question about a non-ubuntu system like debian, you can ask the question at https://unix.stackexchange.com where the question is on topic. – mchid Apr 30 '22 at 03:58

0 Answers0