| title | Debian Chroot in Parch Linux |
|---|---|
| description | A Guide to have debian under Parch Linux |
| published | true |
| date | 2024-04-05 10:42:59 UTC |
| tags | debian, parch |
| editor | markdown |
| dateCreated | 2024-04-05 10:37:55 UTC |
The chroot Linux utility can modify the working root directory for a process, limiting access to the rest of the file system.
- Install Debootstrap
sudo pacman -Sy
sudo pacman -S debootstrap- Make a Folder inside /opt for your debian new root
sudo mkdir /opt/debian- Set Debootstrap location and start Debootstraping :D
DEBOOTSTRAP_DIR=/opt/debootstrap/usr/share/debootstrap /opt/debootstrap/usr/sbin/debootstrap --arch amd64 bookworm /opt/debian/ http://ftp.uk.debian.org/debian/- Note : You can change the debian version by changing the bookworm to your version codename. You can find debian codenames here.
- Mount the Directories
mount -t proc proc /opt/debian/proc/
mount -t sysfs sys /opt/debian/sys/
mount -o bind /dev /opt/debian/dev/
mount -o bind /dev/pts /opt/debian/dev/pts/- Setup the repositories for your chrooted system
cat > /opt/debian/etc/apt/sources.list << 'EOF'
deb http://ftp.uk.debian.org/debian/ bookworm main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ bookworm main non-free contrib
deb http://security.debian.org/ bookworm/updates main non-free contrib
deb-src http://security.debian.org/ bookworm/updates main non-free contrib
deb http://ftp.uk.debian.org/debian/ bookworm-updates main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ bookworm-updates main non-free contrib
EOF- Note : Change the Codename to your installed Version
- Chroot to your debian
chroot /opt/debian /bin/bash- Upgrade the Debian and regenerate the locales:
apt-get update && apt-get dist-upgrade
apt-get install locales
dpkg-reconfigure locales- Add a name to /etc/hosts
echo mywonderfulldebian >> /etc/hosts- Add a new user to the chroot
apt-get install curl sudo ncurses-term
groupadd sudo
useradd -m -G sudo -s /bin/bash parch
passwd parch- note : Replace parch with your username
- add new user to sudoers
cat > /etc/sudoers << 'EOF'
root ALL=(ALL) ALL
%sudo ALL=(ALL) ALL
EOF- connect to your user
sudo -iu parchor
su parch