Linux – Install .deb packages into mounted fs

debiandpkglinuxmount

I have a ext2 partition on CF card to use in external device. I've inserted this card into my PC and mount it as /mnt/linux. I've installed (extracted) a linux distribution to this partition.
And I want to add some .deb packages to this partition. How should I do this? Is it possible?

The alternative way I use: I copy .deb packages into /mnt/linux/tmp dir, then insert CF card into external device, and install cd /tmp; dpkg -i XXX.deb from this device.

Best Answer

As vonbrand suggested, assuming you have a working Debian install on the CF card, you should be able to chroot to it and install normally:

sudo chroot /mnt/linux
sudo dpkg -i XXX.deb 
Related Question