Preface
Goal: Updating linux in chroot environment.
Table of Content
-
Preface: Table of Content
-
1: Debian
-
2: Fedora
-
3: KaOSx
-
4: Miscellanous
Overview
One advantange of multiboot is that you can update other OS, while you are still working with current OS.
Here I use openSUSE as a primary OS, while updating other OS in chroot environment
These three OS below share very similar chroot method. There are only minor differences.
-
Debian
-
Fedora
-
KaOSx
1: Debian
Just use normal chroot method. The only issue is resolv.conf symbolic link.
chroot
Do this sequence of command, to do chroot:
I adapt the command above from Gentoo manual.
This will take you to Debian root.
Dio Putra suggestion
My friend, Dio Putra that has encrypted Debian partition, private message me, and gave me this suggestion.
-
mount -o bind
instead ofmount --rbind
, This rbind make this hard to be unmounted. -
umount -R
instead ofumount -f
-
No need to bind
/tmp
Rename resolv.conf
To enable internat access, we must have /etc/resolv.conf. We need to get rid of the original symlink, and replace with a new one.
/etc/resolv.conf -> /run/NetworkManager/resolv.conf
There is this other method using fstab.
Update
Restore resolv.conf
Do not forget to restore the original /etc/resolv.conf
Post chroot
Just exit, you will be back to original user prompt.
Unmount all
Sometimes the volume is busy,
you need the -f
argument.
Sometimes it can’t be unmount.
2: Fedora
Just use normal chroot method. The only issue is resolv.conf symbolic link.
chroot
Do this sequence of command, to do chroot:
This will take you to Fedora root.
Rename resolv.conf
But there is an issue that we have to solve with Fedora. There is no internet access, because /etc/resolv.conf does not exist. Normally we just need to copy the file, but it cannot be copied because it is a symlink to /var/run/NetworkManager/resolv.conf that does not exit.
/etc/resolv.conf -> /var/run/NetworkManager/resolv.conf
To solve this, we just need to rename
Open other terminal, and now you can copy.
Update
Restore resolv.conf
Do not forget to restore the original /etc/resolv.conf
Post chroot
Just exit, you will be back to original user prompt.
Unmount all
Sometimes the volume is busy,
you need the -f
argument.
3: KaOSx
Just use normal chroot method. No issue at all.
chroot
Do this sequence of command, to do chroot:
I adapt the command above from Gentoo manual.
This will take you to KaOSx root.
Copy resolv.conf
To enable internat access, we must have /etc/resolv.conf.
No need to restore anything later.
Update
Post chroot
Just exit, you will be back to original user prompt.
Unmount all
Sometimes the volume is busy,
you need the -f
argument.
Sometimes it can’t be unmount.
4: Miscellanous
Reading
arch-chroot
If you are in Ubuntu, you are lucky, that Ubuntu support arch-install-scripts.
Tools
- Bhaskar Chowdhury: github.com/…/change_os_root
What’s Next?
Consider continue reading [ Network: Samba ], or consider [ GhostBSD - Multiboot ].