Skip to content

Instantly share code, notes, and snippets.

@erm3nda
Forked from cdown/gist:5c5b53e1855d7812dfbc
Last active June 18, 2019 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erm3nda/403cde24aa7b9da58a67f7d35988fa0f to your computer and use it in GitHub Desktop.
Save erm3nda/403cde24aa7b9da58a67f7d35988fa0f 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 $USER
passwd $USER
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment