Results 1 to 2 of 2

Thread: The Ultimate Minimal Ubuntu Installation Guide (i3 or OpenBox)

  1. #1
    Join Date
    Feb 2017
    Beans
    2

    The Ultimate Minimal Ubuntu Installation Guide (i3 or OpenBox)

    Let’s install Ubuntu - minimal edition (using i3 Window Manager or OpenBox)

    Disclaimer: a minimal version of Ubuntu is not for everyone. Ubuntu, the full distro, is the best place for a beginner to start. Minimal versions are stripped down and do not include many of the tools you might want as a beginner.

    I love Ubuntu, and I am a fan of minimal builds. Sometimes the out-of-the-box feeling that you get with Ubuntu or a flavor thereof feels bloated. This is why I choose to run a minimal build. Also, I like cutting edge, which is hard to get with a non-rolling release distro. That being said, I will be using the MOST current versions of Ubuntu for this tutorial, which at the time of writing this is 17.04, Zesty Zapus. This should, however, be almost identical for 16.04 and 16.10.

    What you need:
    A computer with a linux distro on it, or a live distro on a USB stick
    An 8 GB partition, at least (the bigger the better; 8 GB will not be enough to do much). I don’t recommend overwriting your whole computer, and I recommend having another distro or Windows available for troubleshooting.
    Disk Image Mounter (available from gnome-disk-utility) or a similar program and an archive mounter/extractor (these are found on full versions of Ubuntu already)
    A wired internet connection (yes, a plug into your computer)
    A USB stick / flash drive / thumb drive

    Sections:
    Getting the mini.iso file
    Installing your minimal Ubuntu
    Partitioning
    First Boot
    Get a working distro
    Second boot, the fun begins
    Moving away from minimal - Theming

    Getting the mini.iso file

    The very most minimal build of Ubuntu is from the mini.iso file, which is around 60 megabytes (give or take). The 17.04 version is available at:

    http://archive.ubuntu.com/ubuntu/dists/zesty/main/installer-amd64/current/images/netboot/

    This ISO is really just a text based front end. You will need an internet connection that plugs into your computer for the install, just a heads up. The mini.iso downloads and builds Ubuntu onto whatever partition you tell it to, and then installs grub.

    Now you need to get the mini.iso you have downloaded onto a USB for installation. How do you do this? Well from a full Linux machine, or even a live version of Ubuntu, you need to do the following:

    If you have a modern machine, say, within the last 5 years, you probably have UEFI. The mini.iso does not yet support UEFI out of the box, but it REALLY does.

    1a. Open the mini.iso with Archive Mounter or Disk Image Mounter and extract the files to a folder. I used a folder named mini on my desktop.

    1b. These files will be locked (aka you don’t have permission to mess with them). Open a terminal and open your file manager using

    Code:
    sudo -H thunar
    On Xubuntu the file manager is thunar, so make sure you don't write thunar if you don't use thunar (I usually use nautilus, this is just a live Xubuntu environment). (Ubuntu's Unity and Gnome use nautilus, on Cinnamon it is nemo, and there are others.) Right click on the original folder you made (remember, I made mini on my desktop) and go to properties. The third tab is permissions. Set all the permissions to read and write for your user. Also, set them recursively (all the way down through the folders).


    01 apply permissions.jpg

    2. Navigate to this folder. There is a boot folder and then a grub folder (inside boot) of the extracted ISO; there you should find a file named efi.img.

    3a. Open it with Disk Image Mounter (or another IMG mounting program). Navigate to this mounted drive (or folder).

    02 mount.jpg

    3b. Navigate to the newly mounted drive, probably in the left pane.

    4. Here you will find a folder called efi. This folder (and its contents) is what you need. All you have to do is copy the efi folder from here to the root of the original extracted ISO (at the same level as the boot folder from ISO). (then unmount this mounted IMG file)

    5. Now you have at least two folders in your root extracted folder, boot and efi, as well as a bunch of other files.

    03 efi copied.jpg

    6a. Just copy all these files to a FAT32 formatted USB drive. OR

    6b. You can burn all these files to an ISO with Brasero and sudo dd that ISO to your USB. But 6a is easier.

    7. Reboot and boot from this newly created USB, like when you originally installed Ubuntu. Also, make sure you plug in that ethernet cable now.

    Installing your minimal Ubuntu

    Put the USB into the computer and boot just like when you would normally install Ubuntu. Hopefully you will find the minimal ISO boots and you can start the installation. Answer the questions, they're pretty easy and straightforward.

    Choose your languages, keyboard, and location. Make your hostname whatever you want. I like mui for minimal Ubuntu install, but ubuntu is perfectly fine.

    Probably don’t change the mirror, it will fill it in based on the locations you selected.

    Partitioning

    I only give myself about 25 -30 GB of space for the root (/) partition. I give myself 100 GB for my /home partition. On my 250 GB SSD, this setup gives me about 120 GB left for other distros and Windows.

    If you’re confused about partitioning, check here first for a refresher:

    https://help.ubuntu.com/community/HowtoPartition

    The installer should select your EFI partition automatically for grub, don’t worry about that.

    I recommend manual partitioning.



    For the screen where you edit your partitions, you’ll need at the very least a root partition. I recommend at least 8 GB. No name is required. Use as EXT4, but other filesystems are available if you like. For root, the mount point should be /. Nothing else is required, so just go down to done setting up this partition.



    If you want, you can have other partitions. But this is the easiest partition scheme. If you plan to have a lot of files, like gaming on Steam or videos and music, I recommend your root partition be large. Personally, as I wrote before, I split my home and root so that I can make new distros I install use the same /home partition.

    Finish and write changes to disk. If you want a swap partition, go ahead. But I don’t use swap anymore because I have 16 GB of RAM and I only ever “poweroff” my machine, I don’t sleep or suspend. So I am comfortable with a setup having no swap partition. If your machine has less than 8 GB of RAM, I would recommend a swap partition. But that is not a scientific recommendation.



    When configuring updates, that’s up to you. I do no automatic updates because I usually do manual updates incessantly anyway. Like I said, I like to be up to date.

    Software selection - If you want the bare minimum Ubuntu like I do, uncheck the only checked software. There should be no checks. Otherwise, look over the things you want and select them. The more you select here, the more packages will be installed (in this picture, Xubuntu desktop is selected, but for minimal do not select any).

    08 software selection.png

    If you select nothing on this tab, you will get a Ubuntu build with approximately 238 packages. Pretty sweet if you ask me.

    The rest of the installation process is very straight forward. When it is finished, remove your USB and reboot into your new Ubuntu machine.

    Pictures from the installation media (not the desktop files portion) were borrowed from https://onetransistor.blogspot.com/2...i-enabled.html

    First Boot

    Upon your first boot into Ubuntu, you will probably not have a working setup (it works, but looks like it does not). So, to prevent this initial scare, during your grub screen press “e” on the first option (which should be Ubuntu).

    On the linux line, one of the longer one lines that take more than one line, past half way down, you will see “$vt_handoff”. Ensure you remove this portion of the line and press F10 to boot into your new build. You will be presented with tty1 and you may see some errors, but probably without any real issues.

    Congratulations!

    Get a working distro

    Lets fix that grub so you don’t have to press “e” every time you restart your machine.

    Code:
    sudo apt install nano
    nano is my preferred command line interface (CLI) text editor. Feel free to use any other if you like. If you're using a GUI already, or if you're editing this partition from a working machine, SSH, or some other GUI, you can feel free to use gedit, geany, mousepad, or any other GUI text editor. Unfortunately, that isn't going to work well without a working GUI environment (namely X).

    Code:
    sudo nano /etc/default/grub
    On the “GRUB_CMDLINE_LINUX_DEFAULT” entry remove “quiet” and “splash”. Mine is just left with =””.

    In the command line interface nano, Ctrl+O saves and Ctrl+X closes and will take you back to the CLI.

    Now update your grub with

    Code:
    sudo update-grub && sudo update-grub2
    Voila. You shouldn’t have that issue anymore.

    Now what you want is a nice, small, working distro. You have that, technically, but you need to get a more usable interface going. You need a display manager, at least a window manager (or a full desktop environment, networking packages, some common drivers, probably a compositor, and a display server.

    For your display manager I recommend lightdm. This is a very friendly, lightweight display manager. With that I also recommend the gtk greeter and the settings package. I will list the commands after all my recommendations.

    For your window manager I recommend i3 (with preference for i3-gaps). OpenBox is also a good option for a lightweight, minimalist window manager. If you prefer your windows to move around and adjust size with the mouse, probably go with OpenBox. If you are looking to move to a more exciting, tiling, window manager, you should check out i3.

    For networking I prefer wicd. Usually I would go with Network Manager, but it has been giving me hard time lately. Though, Network Manager does have a nice CLI end called nmtui. wicd is lighter though.

    ubuntu-drivers-common will detect and install additional Ubuntu driver packages for you. (gpu-manager is a good example)

    mesa-utils and mesa-utils-extra have miscellaneous Mesa GL utilities, useful for more advanced processes using GPUs (i.e. GLX extension on xserver-xorg and glxinfo)

    compton is a lightweight compositor for X11, based on xcompmgr.

    For a file manager I prefer nautilus. But a lighter choice may be thunar. For a terminal emulator, I prefer gnome-terminal. Again, there are lighter choices.

    And finally, xorg is the X.Org X Window System (pretty standard right now) and xserver-xorg is the server side of it.

    Lets install:

    i3 minimal, like i prefer:

    Code:
    sudo apt install lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings i3 wicd ubuntu-drivers-common mesa-utils mesa-utils-extra compton xorg xserver-xorg nautilus gnome-terminal
    OpenBox minimal:

    Code:
    sudo apt install lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings openbox obconf obmenu wicd ubuntu-drivers-common mesa-utils mesa-utils-extra compton xorg xserver-xorg nautilus gnome-terminal
    From my personal experience, you want to install the recommendations.

    Some notes: if you have an nvidia GPU, also:

    Code:
    sudo apt install nvidia-375
    If you have an Intel processor, which you probably do, I recommend using Intel’s proprietary microcode, which is not open source.

    Code:
    sudo apt install intel-microcode
    If you are using a desktop and are going to keep the ethernet cord plugged in, SKIP this section. If you want to use a wifi dongle or wifi in general, I like to disable the ethernet port (I really only use a laptop and can reenable it if need be.

    Code:
    sudo nano /etc/network/interfaces
    To disable the ethernet port (somewhat superficially) put a # (the hash) symbol next to each line here, except the source line.

    Now reboot with:

    Code:
    sudo poweroff --reboot
    And bask in your glory.

    Second boot, the fun begins

    CONGRATS, you’ve made it.

    If you’re using i3, you need to read the user guide over at i3.

    https://i3wm.org/docs/userguide.html

    It will help get you started and mastering the keyboard in no time.

    If you're using i3, I recommend putting

    Code:
    exec --no-startup-id compton -b
    Into your config file, that will enable compositing at boot. Also

    Code:
    exec --no-startup-id wicd-client --tray


    Will put a wifi applet in your tray. As will volumeicon (which you will need to install as volumeicon-alsa).

    Code:
    exec --no-startup-id volumeicon
    But I won’t get too deep into i3 and configs for this tutorial.

    If you’re using OpenBox, I recommend finding obmenu-generator. That will create fun, dynamic, pipe menus for you on the go.

    For both i3 and OpenBox I recommend using nitrogen for your wallpaper. There are other options, however.

    Moving away from minimal - Theming

    What you have created is a nice, working minimal Ubuntu build with less than 800 packages. But lets get it looking better. For this we will install a whole mess of themes and some appearance tweaking tools.

    Top GTK Themes Download -
    WARNING - Using the "Top GTK Themes Download" defeats the idea of a minimal build because it installs many files, themes, and stuff you're not going to use (you can only use one theme at a time!). But it isn't that much. If you want a bunch to look at and choose from, follow this small section. If not, install one theme you like and move onto the applying themes section.

    Navigate to your downloads file

    Code:
    cd ~/Downloads/
    Install git and get to downloading (doesn't take long):

    Code:
    sudo apt install git && git clone https://github.com/tliron/install-gnome-themes


    Now navigate to those files:

    Code:
    cd ./install-gnome-themes/
    And run their install script this will take approximately 5 minutes

    Code:
    ./install-gnome-themes
    Script information borrowed from: http://ubuntuhandbook.org/index.php/...-ubuntu-16-04/

    How to apply these themes

    BOOM! You have a ton of themes. But how do you implement these themes, you may ask? Well I recommend using all of the following programs for changing themes on i3: lxappearance, gtk-chtheme, and qt4-qtconfig. lxappearance is a nice program from LXDE that switches your GTK+ themes. gtk-chtheme is a little program for changing your GTK+ 2.0 themes. The third program, qt4-qtconfig is a QT 4 configuration tool. You will see how they work in a minute.

    Lets install them:

    Code:
    sudo apt install lxappearance gtk-chtheme qt4-qtconfig
    Now, if you're using i3, use alt+d to run dmenu at the top of your screen and open lxappearance. You should have listed the themes your previously downloaded and installed with the script. Select a theme you like here (I like Candra-Theme-3.20-Dark and Darker). Press apply. Go to the icon theme tab and select the icons you like and apply. That should be basically it for lxappearance.

    Now close this and alt-d to open gtk-chtheme. Whatever theme you choose in lxappearance, pick the same one here. Apply. Okay and close. Now alt-d to open qt4-qtconfig, which you may notice has installed itself as qtconfig-qt4.

    The first drop down menu is Select GUI Style. Select GTK+ here. Then go to file, save. Then file, exit.

    Its that easy! Make sure you do the same for icon packs. I like Numix but it is getting a little old. For Numix icon pack all you need to do after install is set it in lxappearance.
    Last edited by vandelsand; May 18th, 2017 at 07:49 PM.

  2. #2
    Join Date
    Jan 2018
    Beans
    1

    Re: The Ultimate Minimal Ubuntu Installation Guide (i3 or OpenBox)

    Hi vandelsand,

    Thanks for a fantastic guide, very clear and informative.

    Regarding the black screen boot issue, I have posted a question on Ask Ubuntu.

    I'd be very grateful if you had any feedback, or perhaps you are curious yourself.

    Obviously not having a friendly boot process isn't the end of the world, but there are practical advantages if you're using encrypted LVM and it's a good opportunity to improve my Linux knowledge.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •