2

I'm trying to install pkg in a limited space embedded system. I use busybox's dpkg. To let dpkg work, I just touch a file

touch /var/lib/dpkg/status                                               

But, it still can not work.

$dpkg -i ntpdate_4.2.4p4+dfsg-8lenny3_sh4.deb                           
dpkg: package ntpdate depends on netbase, which is not installed or flagged to be installed

How to flag the netbase as installed? I mean cheat to let dpkg treat it could install.

Daniel YC Lin
  • 153
  • 1
  • 2
  • 7

2 Answers2

1

You need dpkg to ignore dependencies, use the following command:

dpkg -i --force-depends mypackage.deb

Or, in case you have more problems arising, use:

dpkg -i --force-all mypackage.deb

But be warned, package dependencies are almost always true dependencies, as in, the program might be linked against them.

And using the above commands, will install the package fine, but dpkg will label it as broken.

Waleed Hamra
  • 731
  • 6
  • 16
  • Hi @Waleed, --force-depends doesn't help with a completely uninitialised dpkg system. --force-all is not recognised by busybox flavor of dpkg. I've updated the question to reflect that. Kind regards, Rob – Robert Cutajar Feb 03 '15 at 19:19
0

The answer might be to use debootstrap anyway. Here's a howto https://www.debian.org/releases/lenny/arm/apds03.html.en

The process I managed to use is with the --foreign parameter, which creates a root filesystem ready to be bootstrapped. My command:

debootstrap --foreign --arch amd64 --variant minbase \
   --keyring /usr/share/keyrings/debian-keyring.gpg \
   jessie debstaged

cd debstaged
tar -czf ../iso/debstaged.tar.gz *
cd ..

The root filesystem tar/gzipped is in my iso folder that I use to create a bootable CD

Once I boot the CD which only has a minimalist busybox initramfs, I can simply untar that filesystem and complete the installation:

mount /dev/sr0 /mnt
mkdir /tmp/root
mount -t tmpfs debroot /tmp/root
cd /tmp/root
tar -xzf /mnt/debstaged.tar.gz
umount /mnt
chroot . /debootstrap/debootstrap --second-stage

At this point, I have a ready configured debian system root in /tmp/root.

The answer is obviously incomplete, but if we could figure which files are necessary and manage to debinify the busybox system, there could be a way. This resource was quite helpful as well - http://lists.busybox.net/pipermail/busybox/2014-June/081017.html

I should be able to switch to the new root like that, but my kernel doesn't have devtmpfs which is required by systemd init:

echo > /proc/sys/kernel/hotplug
umount /proc
umount /sys

exec switch_root -c /dev/console /tmp/root /sbin/init

Kind regards, Rob