Package management of installed system from live environment

A fast inquiry - would certainly value a fast solution - exists a means to install plans to a system on HDD from a USB/CD/DVD live environment?


Though I would certainly enjoy a fast solution, it does not always need to be straightforward, if the only practical remedy is perhaps a little difficult/complicated. I'm considering in some way transforming the target directory site of dpkg to the hard drive as opposed to the live environment or something. Certainly, I do not recognize just how to do that or perhaps if it is feasible, therefore the inquiry. Hope my input aids me get aid.

2022-06-07 14:33:09
Source Share
Answers: 1

You'll need to chroot right into the system. Think sda1 is your HDD:

sudo su
mount /dev/sda1 /mnt
for f in proc sys dev ; do mount --rbind /$f /mnt/$f ; done
chroot /mnt/

From after that on you are making use of the origin of your HDD as origin and also you can apt-get update or yum update or whatever the HDD - system needs.

Exit with STRG+D or by keying exit.

EDIT: occasionally you appear to need to replicate /etc/resolv.conf to your chroot as mentioned by enzotib in the remarks.

2022-06-07 14:51:41