如何从systemrescuecd在chroot中运行“apt-get”?

我用systemrescuecd 4.3.1启动,并运行如下。

$ 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 ... 

apt文件位于“/ dev / sda1”的“/ var / cache / apt / archives”中。

还是这样做是可行的? 任何人成功?

谢谢您的帮助。

Apt-get在chroot中运行得非常好。 问题是你似乎正在尝试安装我认为是DKMS内核模块的软件包。 这些types的软件包包括安装后脚本,用于检测正在运行的内核,并构build适当的模块。 与rescuecd运行的内核相关的模块不在chroot中,这就解释了错误。 但是你几乎肯定不想要一个与你的rescuecd运行的内核相关的模块。

所以要具体使用从救援环境中的chroot到apt-get来添加/删除DKMS包是不行的。 从理论上来说,理论上应该安装这个软件包,当你重新启动系统时,你可以重新运行这个命令来完成安装并正确地build立模块。

看到: