Skip to content

Instantly share code, notes, and snippets.

@46bit
Created February 16, 2015 03:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 46bit/37c0d5634bf78c3ff2fa to your computer and use it in GitHub Desktop.
Save 46bit/37c0d5634bf78c3ff2fa to your computer and use it in GitHub Desktop.
Arch Linux on DigitalOcean

Arch Linux on DigitalOcean

DigitalOcean are a promising host: good machines, lovely interface, lots of free credit floating about. However they don't support custom disk images, which leaves a lot of distros unusable.

You can use this script to replace a fresh Debian 7.0 droplet with an Arch system (including the Arch Kernel). While there's no reason to think this script does anything naughty, it isn't easy to be sure. DigitalOcean might make a change that renders it unbootable, so backups would be advisable.

  1. Create a new Debian 7.0 droplet (either 32-bit or 64-bit works).
  2. In the droplet (either SSH or console access works), run the following as root: wget https://raw.githubusercontent.com/gh2o/digitalocean-debian-to-arch/master/install.sh && bash install.sh
  3. Answer the questions as prompted.
    • If the script asks to remove a failed installation, there is a failed installation at /archroot that is unlikely to contain important data. It is safe and recommended to answer yes here.
    • Because the random number generator, required to generate keys for pacman, is painstakingly slow, the script will offer to install the package haveged which will speed it up. Again it is recommended to answer yes here.
  4. Sit back and relax! The system will automatically reboot once complete, and you should have a fully updated Arch Linux system in within minutes.
  5. You will be able to log in with your original root password. The replaced Debian files are located in /oldroot, which may be safely deleted to free up space.

I suggest running rm -rf /oldroot and rebooting before the next part. Your old user credentials will still work.

Necessary configuration

We'll configure the timezone, locale and swap. The system this creates is more minimal than ordinary Arch images: we'll need to install the base-devel package to install further software.

sudo ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
sudo sh -c 'echo en_GB.UTF-8 UTF-8 >> /etc/locale.gen'
sudo locale-gen
sudo sh -c 'echo LANG=en_GB.UTF-8 UTF-8 > /etc/locale.conf'
sudo mkinitcpio -p linux
sudo pacman -S base-devel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment