Skip to content

Instantly share code, notes, and snippets.

@cdown
Last active February 27, 2024 19:01
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save cdown/5c5b53e1855d7812dfbc to your computer and use it in GitHub Desktop.
Save cdown/5c5b53e1855d7812dfbc to your computer and use it in GitHub Desktop.
Debian chroot inside Arch
pacman -S wget # needed for debootstrap
curl -o /tmp/db.deb http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.60~bpo70+1_all.deb
mkdir /opt/debootstrap
cd /opt/debootstrap
ar x /tmp/db.deb
tar xf data.tar.gz
mkdir /opt/debian
DEBOOTSTRAP_DIR=/opt/debootstrap/usr/share/debootstrap /opt/debootstrap/usr/sbin/debootstrap --arch amd64 wheezy /opt/debian/ http://ftp.uk.debian.org/debian/
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/
cat > /opt/debian/etc/apt/sources.list << 'EOF'
deb http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb http://security.debian.org/ wheezy/updates main non-free contrib
deb-src http://security.debian.org/ wheezy/updates main non-free contrib
deb http://ftp.uk.debian.org/debian/ wheezy-updates main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main non-free contrib
EOF
chroot /opt/debian /bin/bash
# inside chroot
apt-get update && apt-get dist-upgrade
apt-get install locales
dpkg-reconfigure locales
# add name to /etc/hosts
# optional
apt-get install curl sudo ncurses-term
groupadd sudo
useradd -m -G sudo -s /bin/bash chris
passwd chris
cat > /etc/sudoers << 'EOF'
root ALL=(ALL) ALL
%sudo ALL=(ALL) ALL
EOF
sudo -iu chris
apt-get install git
mkdir ~/git
git clone git://github.com/cdown/dotfiles.git ~/git/dotfiles
(cd ~/git/dotfiles && ./setup)
Copy link

ghost commented Jun 8, 2020

useful gist, using it right now to bring a ubuntu 20.04lts into manjaro. :)

@jcaesar
Copy link

jcaesar commented Oct 14, 2020

Hm. debootstrap exists as an arch package. Any reason not to use that?

@cdown
Copy link
Author

cdown commented Oct 14, 2020

probably because this paste is unmaintained and 6 years old ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment