loading...
Cover image for Customizing a new Linux system

Customizing a new Linux system

drmikecrowe profile image drmikecrowe ・2 min read

Bootstrap an Ubuntu/Debian based system effortlessly using linux-bootstrap

GitHub logo drmikecrowe / linux-bootstrap

Bootstrap a new linux system effortlessly

linux-bootstrap

Bootstrap an Ubuntu/Debian based system effortlessly. This script is idempotent, allowing you to re-run it at any time. Existing changes are detected and ignored, and you are only prompted for uninstalled changes.

Why?

When you first login to a new linux box, you have many default packages you typically install:

I've experimented with multiple ways to do this (and there are many). This seems to be the easiest way to maintain and expand as your preferences change.

Adapting to Your Needs

  • Fork the repo (natually)
  • If you want to use some/all of my defaults
    • Remove whatever packages you don't want out of src/tasks/all.sh (and delete those files in src/tasks/___.sh)
  • If you would like to start from scratch
    • Setup my repo as a remote: git remote add drmikecrowe https://github.com/drmikecrowe/linux-bootstrap.git

Why?

When you first login to a new linux box, you have many default packages you typically install:

  • Your dotfiles
  • Standard utilities like git, midnight commander, jq, direnv, etc

I've experimented with multiple ways to do this (and there are many). This seems to be the easiest way to maintain and expand as your preferences change.

Running

Download the main script and make it executable:

wget -q https://raw.githubusercontent.com/drmikecrowe/linux-bootstrap/master/target/bootstrap-1.0.0.sh
chmod +x bootstrap-1.0.0.sh
./bootstrap-1.0.0.sh all

You can see all the options as follows:

./bootstrap-1.0.0.sh

You can also install a single item like this:

./bootstrap-1.0.0.sh goenv

Demonstration

See a demo

Key concepts

This script uses Bashing to create the executable.

The key things I like to install are:

  • My dotfiles
  • Bash-it
  • Node via nodenv
  • Go via goenv
  • Python via pyenv
  • xonsh
  • docker
  • AWS cli
  • etckeeper
  • Increase fs.inotify.max_user_watches by increasing to 524288
  • Remove password prompt when executing sudo

If it's a GUI based system:

  • Install my favorite GUI packages like glogg meld synaptic kupfer remmina
  • Visual Studio Code
  • Opera
  • Spotify
  • TerraForm
  • Peek gif recorder
  • google-chrome
  • copyq
  • wavebox
  • etc.

Adapting to your needs

The genius of this system is how easy it is to add new items:

  • Fork the repo (natually)
  • Run the ./stub.sh abc to add abc as src/tasks/abc.sh
  • Edit src/tasks/abc.sh:
    • Add a test to determine if abc is already installed
    • Add the code to install it
  • Build using ./build.sh and push to your repo

Innards

  • Each task you answer (Y)es to writes the install steps from each install function (such as install_dotfiles) to ~/_todo.sh
  • Run all the commands in ~/_todo.sh

Posted on by:

drmikecrowe profile

drmikecrowe

@drmikecrowe

A lifelong geek who loves solving problems and discovering new technologies

Discussion

markdown guide