DEV Community

loading...

Things I always install on Ubuntu

davidjones418 profile image David Jones Updated on ・5 min read

I have a short attention span for desktop Linux and take the destroy-everything-and-start-again approach to system configuration, so I reinstall Ubuntu a lot. Here’s a rough list of stuff that I set up on a clean installation. I’m assuming 20.04 LTS but this should mostly apply for later versions.

Keyboard layout

Find this in Settings > Language and Region > Input Sources.

Keyboard preview of “English (intl., with AltGr dead keys)” in GNOME

I use a layout listed as English (intl., with AltGr dead keys). This gives me easy access to typographical quotes (“”‘’) and a few other non-ASCII characters that I use frequently on keyboards with a right Alt key. Do this first because switching between layouts is just confusing.

Google Chrome

Download and install the deb from the Google Chrome (UK) downloads page with Firefox. I use both browsers.

1Password

Install the 1Password X Chrome extension and 1Password X Firefox extension.

I keep all of my account details in 1Password so I install it early on. There’s no desktop app for Linux; I’ve used the op CLI occasionally but mostly I just copy and paste from the browser addons.

cURL

sudo apt install curl
Enter fullscreen mode Exit fullscreen mode

This is pretty essential because I have no idea how to use wget. Some of the following scripts also use it.

NextDNS

curl -sSL https://nextdns.io/repo.gpg | sudo apt-key add -
sudo add-apt-repository 'deb https://nextdns.io/repo/deb stable main'
sudo apt install nextdns
sudo nextdns install \
  -config "$NEXTDNS_ID" \
  -report-client-info \
  -auto-activate
Enter fullscreen mode Exit fullscreen mode

where $NEXTDNS_ID is your configuration ID, found at my.nextdns.io. There is also an install script at sh -c "$(curl -sSL https://nextdns.io/install)".

I use NextDNS instead of browser plugins to block ads and trackers at the DNS level, and move my DNS traffic away from my ISP.

Git

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
Enter fullscreen mode Exit fullscreen mode

The package in the default repositories can lag behind a few minor versions and I occasionally want to use new features. Homebrew requires git.

Homebrew (Linuxbrew)

Add to ~/.profile:

if [ -z "$HOMEBREW_PREFIX" ]; then
    export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
    export HOMEBREW_CELLAR="$HOMEBREW_PREFIX/Cellar"
    export HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew"
    export PATH="$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin${PATH+:$PATH}"
    export MANPATH="$HOMEBREW_PREFIX/share/man${MANPATH+:$MANPATH}:"
    export INFOPATH="$HOMEBREW_PREFIX/share/info:${INFOPATH:-}"
fi
Enter fullscreen mode Exit fullscreen mode

then

. ~/.profile
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Enter fullscreen mode Exit fullscreen mode

The test for $HOMEBREW_PREFIX ensures that the paths are appended to only once, when ~/.profile is sourced at login, and not in subsequent login shells or when ~/.profile is sourced manually as above.

The Homebrew documentation recommends adding a line like eval $(/path/to/brew shellenv) to ~/.profile instead. There’s probably a very good reason for this; I use the above approach to avoid errors on startup if /path/to/brew disappears for some reason (it happens, I’m trigger-happy with my rm -rfs.)

Fish shell

brew install fish
Enter fullscreen mode Exit fullscreen mode

and suppress the default greeting:

fish -c 'set -U fish_greeting'
Enter fullscreen mode Exit fullscreen mode

Fish is like Bash with a conscience. It isn’t a POSIX shell so I leave the default shell as Bash, allowing me to paste random scripts I’ve found on the internet into GNOME Terminal without having to think too hard.

The following commands still assume Bash.

Neovim

brew install neovim
Enter fullscreen mode Exit fullscreen mode

and add to ~/.profile:

if [ -x "$HOMEBREW_PREFIX/bin/nvim" ]; then
    export EDITOR="$HOMEBREW_PREFIX/bin/nvim"
fi
Enter fullscreen mode Exit fullscreen mode

I mostly use nvim for the Alt-e command editor in Fish.

GitHub CLI

brew install gh
gh auth login
Enter fullscreen mode Exit fullscreen mode

gh is an easier way to interact with GitHub repos.

bat

brew install bat
Enter fullscreen mode Exit fullscreen mode

Like cat with a pager and syntax highlighting. A drop-in replacement for cat if used in a pipeline.

exa

brew install exa
Enter fullscreen mode Exit fullscreen mode

An almost drop-in replacement for ls with some nice defaults.

fd

brew install fd
Enter fullscreen mode Exit fullscreen mode

A much more intuitive alternative to find.

ripgrep

brew install rg
Enter fullscreen mode Exit fullscreen mode

A very fast alternative to grep.

jq

brew install jq
Enter fullscreen mode Exit fullscreen mode

A stream editor for JSON.

Volta

Add to ~/.profile:

if [ -z "$VOLTA_HOME" ]; then
    export VOLTA_HOME="/home/volta/.volta"
    export PATH="$VOLTA_HOME/bin:$PATH"
fi
Enter fullscreen mode Exit fullscreen mode

then

. ~/.profile
sudo mkdir -p $VOLTA_HOME
sudo chown $USER:$USER $VOLTA_HOME
/bin/bash -c "$(curl -fsSL https://get.volta.sh)" -- --skip-setup
Enter fullscreen mode Exit fullscreen mode

Add fish completions:

mkdir -p .config/fish/completions
volta completions fish > .config/fish/completions/volta.fish
Enter fullscreen mode Exit fullscreen mode

Volta is the nicest Node.js version manager that I’ve used. The installer defaults to ~/.volta; I’m putting it in its own home directory for consistency with Linuxbrew.

Node.js

volta install node
Enter fullscreen mode Exit fullscreen mode

Installs the current LTS, which is generally a sensible system default.

Yarn

volta install yarn
Enter fullscreen mode Exit fullscreen mode

Currently installs Yarn 1.x. Yarn recommends using the system yarn to install per-project yarns.

degit

volta install degit
Enter fullscreen mode Exit fullscreen mode

A really nice alternative to git clone or downloading archives from GitHub.

JetBrains Mono

degit --force JetBrains/JetBrainsMono/fonts/otf ~/.local/share/fonts/JetBrainsMono
Enter fullscreen mode Exit fullscreen mode

Rerun this command to update the font. Check JetBrains Mono releases for updates. The version listed on the homepage was a few releases behind the GitHub repo when this was written and did not include OTF files.

I really like JetBrains Mono. I’m the kind of person for whom terminal support for programming ligatures can’t come soon enough.

Since writing this I discovered kitty, which does ligatures plus a load of other cool stuff by default! I already feel more productive in kitty than in GNOME Terminal. Here’s my current ~/.config/kitty/kitty.conf:

font_family JetBrains Mono
font_size 13.0

foreground #dddddd
background #380C2A

shell /home/linuxbrew/.linuxbrew/bin/fish

map ctrl+c copy_and_clear_or_interrupt

Visual Studio Code

Download and install the deb from the Visual Studio Code home page.

~/.config/Code/User/settings.json looks a bit like this:

{
  "window.titleBarStyle": "custom",
  "window.dialogStyle": "custom",

  "terminal.integrated.shell.linux": "/home/linuxbrew/.linuxbrew/bin/fish",
  "terminal.integrated.automationShell.linux": "/usr/bin/bash",

  "editor.fontFamily": "'JetBrains Mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
  "editor.fontLigatures": true
}
Enter fullscreen mode Exit fullscreen mode

Discussion (19)

Collapse
therealkevinard profile image
Kevin Ard

Not trying to hijack the post, but we all know people will be reading the comments lol.

github.com/astaxie/bat is a curl alternative that's easier to use.

github.com/go-task/task is my new favorite thing. It's a more modern approach to Make - much more fluid.

rclone.org/ is a pretty agnostic tool for cloud backups. From their home page: "The Swiss army knife of cloud storage"

Collapse
davidjones418 profile image
David Jones Author

Nice, thanks for these!

bat sounds awesome, I love httpie. I’d need to figure out how to install it next to bat the Rust tool, hopefully one of them comes with an alias.

Collapse
adriens profile image
SALES

I have also switched to httpie

Collapse
zoedreams profile image
Collapse
davidjones418 profile image
David Jones Author

I’ve tried the ProtonVPN CLI for Linux and it works great. This is a personal list and fortunately I don’t have much use for a VPN, but I’d recommend Proton to anyone who does.

Collapse
zoedreams profile image
☮️✝️☪️🕉☸️✡️☯️

bookmarked. its free for one connection. That is super nice. Thank you for the link.

Collapse
therealkevinard profile image
Kevin Ard

Another one for the vpn crowd. I was looking at nord, but then noticed Digital Ocean has a one-click app for Pihole+OpenVPN.

Took about 5 mins to setup on a $5 droplet, and I've been running ~4 clients for a few months with no problem.

I get about 75% of my baseline/direct bandwidth.
Not bad for 5 dollars.

Collapse
zoedreams profile image
☮️✝️☪️🕉☸️✡️☯️

Thats a nice price. Nords openVPN is kinda slow but its newish IKE protocol now is a lot faster with better encryption. Does that service cycle IP's and block ads; like on youtube? Thanx for the info, ill take a look at that. Generally i setup my own openvpn but have enjoyed the relatively stable and cheap nord service. express vpn is also pretty cheap and fast too.

Thread Thread
therealkevinard profile image
Kevin Ard

As a service... It's not a service :)
DO provides hosting for your own setup, and - coincidentally - they have a one-click setup.
Beyond that, it's all yours and you can do what you want with it. I've seen in VPN discussions that you're only as private as whoever runs your VPN - well, in this case, that's you.

It doesn't naturally rotate ip addresses for you, but if you were in a situation where you needed to switch, it takes all of 30 seconds to move a droplet elsewhere (changing its ip in the process).

Thread Thread
zoedreams profile image
☮️✝️☪️🕉☸️✡️☯️

thank you for the info, that is aweoms.

im sure you could make a cron job to do that to -- switch droplets for you. ?

Thread Thread
therealkevinard profile image
Kevin Ard

Yup. They have a fluid api and cli client, too.

Collapse
dewhallez profile image
Akin Wale

Once write up thanks for sharing.

Why do you use Homebrew instead of apt?

Collapse
davidjones418 profile image
David Jones Author • Edited

Thanks for reading!

Some of my main reasons for preferring Homebrew are that the packages are (nearly) always up-to-date with upstream, are confined to one directory that I can delete if things go very wrong (apt has no restrictions on where it can install files as far as I’m aware), and it’s a large, central community compared to the Debian package ecosystem (Debian, Ubuntu, PPAs, private repos) so it is much easier to find help.

The most important one for me is that it’s a less powerful tool, so I’m less likely to break my system with a stay command or configuration change.

Collapse
therealkevinard profile image
Kevin Ard

TBH, I didn't even know brew ran on Linux until I read this (ofc, makes sense now lol).
I'm considering.

It's not a pain to get going?

Thread Thread
davidjones418 profile image
David Jones Author

I haven’t had any serious problems after a year or so of using it on Linux, which is a big 🍻 from someone who’s very adept at breaking software. The differences with Homebrew on Mac that I’m aware of are that it installs itself to a new home directory rather than /usr/local by default, and Cask isn’t supported. It should be low risk to try, as you can sudo rm -rf /home/linuxbrew if you don’t like it.

Collapse
dewhallez profile image
Akin Wale

Thank you for the explanation.

Collapse
wclayferguson profile image
Clay Ferguson

Here's a script that will keep you from having to trust some arbitrary group of programmers not to steal your passwords.

quanta.wiki/u/WClayFerguson/passwo...

Collapse
mkunikow profile image
Michal Kunikowski

Instead Volta, homebrew you can consider asdf

Collapse
davidjones418 profile image
David Jones Author

I’m just building frontend/JAMstack apps at the moment and Volta does everything I need reliably, unobtrusively, and very fast. I’ve appreciated asdf in the past for Ruby and Elixir projects, and if I ever move back into that ecosystem it’s one of the first tools that I’d reach for.

Forem Open with the Forem app