2

I boot with systemrescuecd 4.3.1, and run like below.

$ mkdir /tmp/os
$ mount /dev/sda1 /tmp/os
$ mount -o bind /sys /tmp/os/sys
$ mount -o bind /dev /tmp/os/dev
$ mount -o bind /proc /tmp/os/proc
$ /usr/bin/chroot /tmp/os /bin/sh -c "apt-get purge fglrx*; apt-get install fglrx*; update-initramfs -u -k 3.5.0-54-generic"
...
FATAL: Could not load /lib/modules/3.10.53-std431-amd64/modules.dep: No such file or directory
...
It's likely that 3.10.53-std431-amd64 belongs to a chroot's host
...

The apt files are in "/var/cache/apt/archives" on "/dev/sda1".

Or is it even practical doing this way? Anyone succeed?

Thanks for the help.

user180574
  • 225
  • 1
  • 3
  • 12

1 Answers1

1

Apt-get runs perfectly fine in a chroot. The problem is that you seem to be trying to install packages which I believe is a DKMS kernel module. These type of packages include post-install scripts that detect the running try to detect the running kernel and build an appropriate module. The modules related to the running kernel off your rescuecd are not in the chroot, which explains the error. But you almost certainly don't want a module for related to kernel you are running from your rescuecd anyway.

So to be specific using chroot from a rescue environment to apt-get to add/remove DKMS packages isn't really going to work very well. On the plus side, the package theoretically should be installed, and when you reboot the system you can just re-run the command to complete the install and get the modules built correctly.

See:

Zoredache
  • 130,897
  • 41
  • 276
  • 420