Truly Minimal Ubuntu Installation with a Window Manager
I wanted to a have a real minimal linux installtion where I could decide exactly what packages I want. To truly embrace this ideology, you have to use Arch Linux, and being me, I was just too afraid to try it out. I eventually did, but that's for another day.
Ubuntu Desktop has a minimal installation option but I it's still not minimal enough. The only way forward is to install the server edition of Ubuntu and then install your graphical environment. I've decided to use the i3 window manager.
Assumptions
- You have a basic Ubuntu installation, possibly Ubuntu Server 20.04
- You have set up proper network connectivity
- You have root access
Pre-installation Steps
We need to have the building blocks of a graphical UI, for which we need xorg
.
sudo apt install xorg xinit
We now need to be able to compile i3
.
We can use the i3
from apt
, but I prefer to use i3-gaps
which looks a bit nicer and is unfortunately not availble in the repos.
Hence, we need the following packages for compiling and making.
sudo apt install git make gcc autoconf
Now, we install all the dependancies of i3-gaps
sudo apt install libpango1.0-dev libyajl-dev libstartup-notification0-dev \
libev-dev libtool libxkbcommon-dev libxkbcommon-x11-dev libxcb1-dev libxcb-randr0-dev \
libxcb-util0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-cursor-dev \
libxcb-xinerama0-dev libxcb-xkb-dev libxcb-shape0-dev libxcb-xrm-dev xutils-dev
Installing i3
Now that our build environment is ready, we can compile and install i3
Update: The installtion process has completely changed. Please refer to official documentation.
There are 2 popular versions of i3
that I know of
I prefer installing i3-gaps
by resolved.
However, the installation procedure is the same for all variants.
Also, this might be a few commits behind i3-gaps
.
So clone, make and install i3
git clone https://github.com/Airblader/i3
cd i3
autoreconf --force --install
rm -rf build
mkdir build
cd build
../configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
At this point, your i3
installation is complete.
Note : In case you get a dependancy error (there shouldn't be any), read the error output carefully. Install the missing packages and repeat the above step from scratch.
Enabling i3 to run after login
Till now, your i3
is ready but you need a way to initiate it after logging in.
Which is why we installed xinit
.
-
Create
~/.xinitrc
and edit it as follows#!/bin/sh exec /usr/bin/i3
-
Run
startx
in the terminal - Your
i3
WM should start up
Now you have a minimal install of Ubuntu, running i3
.
Conclusion
Keep in mind, this setup is so barebones that some functions, that we take for granted in a standard "bloated" DEs, are missing. You need to create scripts for them OR find lightweight alternatives.
Some lightweight alternatives which I use are
- Status-bar - polybar
- Login manager or a display manager -
lightdm
- Program launcher - rofi
- Poweroff/reboot/logout menu - rofi again
- Display auto-detection system -
xrandr
- Notification manager - dunst
- Wallpaper manager - nitrogen
- Compositor - picom
- Audio control - pavucontrol
A good thing about all the above mentioned programs is that they are highly customizable, so you can set it exactly how you want it. You can think that you are creating your own desktop environment. Setting this up can be time-consuming, but you can be assured that there are no unneccessary backgroud processes.
Happy tweaking!