Here is a short guide on setting up Ubuntu Linux 18.04 to be comfortable, high-performance development environment for everyday use.
This is kind of a summary of things I think important when you have Linux as a primary operating system.
About me — I am developer, architect and Tech Lead and I was using Linux for past 3 years as a primary desktop OS. Here is the latest notes on installing and running Linux Ubuntu.
Partition and installing
Use GPT partition layout. It is more flexible and have a benefit that partition number does not depend on on the order of partitions, i.e. if you delete partition in the middle, number for existing partions will not change.
For maximum compatibility, use ext4 filesystem (Dropbox does not support other filesystems).
Align partitions on 1Mb boundary for best SSD life. (Check afterwards using “sudo parted /dev/nvme0n1 align-check”)
Please consider full-disk encryption when you install Linux. You can also enable it after install but it is much, much more difficult.
LVM does not sense on desktop/laptop machine. If you have a no spare disk compartments you better of replacing SSD entirely instead of resizing to the bigger disk.
It is nice to have a way to boot into the temporary environment in case of you need to do some changes or temporarily check things. It is also great to have it without a need of separate USB flash disk.
Use gparted or during install, create 10GB rescue partition. Format it as ext4. Label and enter name rescue.
Add following file to /boot/grub as custom.cfg
Download xubuntu-18.04.3-desktop-amd64.iso and ubuntu-18.04.3-desktop-amd64.iso and put them in the root directory of rescue partition.
Run “update-grub” and it will add this menu entries to Grub boot menu.
- lm-sensors —Install to monitor temperatures, on modern hardware it will detect sensors automatically
- etckeeper — Commits /etc to git. Execute (cd /etc && sudo git log) to see latest changes. Useful to keep track of things you and package control changes.
Kernel and system tweaks
- Enable maximum file watches — needed for a lot of stuff, for example Dropbox, Docker.
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- Disable USB power control — sometimes can result in high CPU usage in kworker process.
- Remove snaps — Broken technology. See mount command output — it actually installs every package as a loopback device! What if you have 100 of them?!
sudo apt autoremove — purge snapd gnome-software-plugin-snap
- Disable telemetry— Telemetry gathering for Ubuntu are implemented by using two packages. Remove them.
sudo apt remove ubuntu-report
sudo apt remove popularity-contest
- Image Viewing — Remove shotwell image viewer and install nomacs — If you are a fan of IrfanView you will find that nomacs are actually quite decent image viewer. Set it as default image viewer in Settings. Nomacs 3.12 (not in repo) have a dark theme!
sudo apt remove shotwell
sudo apt install nomacs
- Screenshots — Install from custom repo and fix Edit menu to allow quick screenshot editing. https://itsfoss.com/shutter-edit-button-disabled/
sudo add-apt-repository ppa:linuxuprising/shutter
sudo apt install shutter
- This is modern, good looking theme. Install by running:
sudo add-apt-repository ppa:communitheme/ppa
sudo apt install ubuntu-communitheme-session
Install these important packages
- gnome-tweak-tool Swiss army knife for Gnome. Install it to enable user themes and enable user extensions.
- gnome-shell-extensions Enables shell extensions (see below)
These, and some others are usually not used, but launched with desktop. You can remove them.
apt remove speech-dispatcher speech-dispatcher-audio-plugins
sudo apt remove gnome-todo gnome-todo-common
Keyboard shortcuts & mouse settings
- Show all applications — Ctrl-Escape (like in Windows, does not interfere with terminal apps)
- Show the run command prompt — Super+R (like in Windows, does not interfere with terminal apps)
- Disable natural scrolling in Mouse & Touchpad
- multi-monitor — displays task list and launcher menu on every monitor you connect, convenient if you work primarily on the external monitor after you connect it to the PC
- USB eject menu — adds USB eject menu to the task list menu
- Disable jack notification — Disables prompt when you connect headphones.
Enable search on right click by building gnome-terminal from source using my patch.
Enable embedded dark mode.
This is a default, integrated backup UI for duplicity. It is pretty basic but does its job.
Lower its priority level
You can run it with lower priority level so it will not interfere with interactive applications.
- Copy /etc/xdg/autostart/org.gnome.DejaDup.Monitor.desktop to ~/.config/autostart folder
- Open file by editor and prepend Exec=… with Exec=nice …
This way deja-dup will start with nice level 10 and all commands started by it (duplicity) will also be nice level 10.
Exclude more files (hidden)
Open dconf-editor at “org/gnome/deja-dup” and edit exclude-list to exclude .dot folders or files manually.
Lower its priority level
You can do the same trick as with Deja-dup and lower its priority by copying slack.desktop file and editing Exec= line.
Lower its priority level
The same trick will work for Dropbox! But rewrites its shortcut every time you launch it 😱. Make change and make “chmod a-w dropbox.desktop” so it will not be able to write shortcut file 😀
Midnight Commander — sudoedit for root owned files.
Add to .bashrc following lines:
Create file on $PATH mysudoedit:
This way, if you try to edit file in Midnight Commander it will ask for password. This way you will not loose changes if you accidentially trying to edit file you can not write to.
Visual Studio Code — build from source
I really like vscodium project for giving me an option to build VSCode from source. It also removes all telemetry.
Use build instructions and it will create folder VSCode-linux-x64 with binaries. I don’t move it anywhere but just symlink it to my $HOME/bin folder.
- Put desktop into ~/.local/share/applications.
- Put vscodium.png into ~/.local/share/icons.
- Make symbolic link “code” from $HOME/src/vscodium/VSCode-linux-x64 to $HOME/bin/code
Now you can start your code by typing “> code .” in any folder. Also you can start by desktop launcher.
While Ubuntu by default have decent fonts installed, it is good to have other fonts to use in code editors or terminals. Here are some examples:
This way you get reliable, high performance development environment, which also looks nice 😎