DEV Community

Cover image for Maximize your experience on Ubuntu Desktop
Proman4713
Proman4713

Posted on • Updated on

Maximize your experience on Ubuntu Desktop

Welcome back to the third article of the "Leveraging Linux for Development" series! In this article, I'll go over the steps you should take after getting a fresh installation of Ubuntu Desktop to solve common issues such as:

  • Slow boot time
  • Slow app startup
  • Sluggish navigation
  • and more...

Let's get right into it!


Install Ubuntu 22.04.04 LTS

I recommend installing Ubuntu 22.04.04 LTS (Jammy Jellyfish) and not Ubuntu 24.04 LTS (Noble Numbat) since 24.04 is currently unstable and not compatible with all hardware yet. Your Jammy Jellyfish installation will warn you when the updates for Noble Numbat are okay to install (with the release of 24.04.1 on August 29th).

The first thing you want to do is to get a USB drive with at least 8GB of free space, this is the drive that you will use to boot into the Ubuntu Installation. To get the Jammy Jellyfish ISO file (which is used to create a bootable media on the USB), go to the Jammy Jellyfish Releases page and download the ISO (or download it directly). Then follow the rest of the Ubuntu Installation Guide normally and install Ubuntu Jammy Jellyfish!
I suggest that you go with the minimal installation since the extended installation can fill your system with bloat you'll never use.

For Windows users who want to Dual Boot with Ubuntu or have WSL and think that it's enough, the next article is entirely made for you!

Reduce GRUB timeout

After installing Ubuntu Desktop, go to the terminal app and run this command:

sudo gedit /etc/default/grub
Enter fullscreen mode Exit fullscreen mode

and set the GRUB_TIMEOUT variable to a small number like 5 seconds. While this does not necessarily speed up the boot time, it is useful for providing small but enough delay at startup for Dual Boot users (which will be addressed in the next article) and users who need to enter UEFI firmware settings or recovery mode.

To update GRUB with this new configuration run:

sudo update-grub
Enter fullscreen mode Exit fullscreen mode

Next time you reboot, you will find that the GRUB timeout has been set to 5 seconds!

Pick the optimal server for Ubuntu Software updates

Open the launchpad (Win + A or click "Show Applications"), go to "Software & Updates" -> "Ubuntu Software" -> "Download from" -> "Other...", this will show a list of all available Download Servers for Ubuntu Software.

Click on "Select Best Server", wait for it to finish, then click "Choose Server" and "Close".

This could drastically speed up package installation and updates, which makes the experience smoother but not technically more performant.

Use Nala instead of APT

Run:

sudo apt install nala
Enter fullscreen mode Exit fullscreen mode

Nala uses the same "APT-DPKG" library that APT uses, it's just a different front-end that's much faster (and also much cooler) than APT (You can cross-use APT and Nala with no issues). You can also use the sudo nala fetch command to do the same Ubuntu mirror check as the previous item and select up to 16 optimal mirrors.

Use XORG instead of Wayland for older hardware

If your hardware is relatively old, you might notice that the fresh Ubuntu installation is a bit sluggish, and this could largely be because your hardware is too old for Wayland. In this case, you can switch to XORG since Wayland could cause anything from glitches to freezes.

To switch to XORG, log out from the power options. Choose your username, and before typing in your password, click on the gear icon in the bottom right of the screen. Whatever was already chosen in this menu, change it to the option containing the word "XORG" (This differs between releases so I'm just including a generic description of what the option will be), or if there are only two options ("Ubuntu" and "Ubuntu Wayland") then choose "Ubuntu".

Depending on your hardware, you will find that GNOME apps open up much faster and your experience is far smoother.

Remove the Snap package manager and install apps using .DEB files instead

The Snap package manager can really slow down system startup, and applications installed using Snap are also slower to start. To remove snap, check out this awesome article (Only follow that article until right before the "Installing Firefox as DEB" section) that already covers that!

Now time to start using .DEB files to install programs! There's an awesome tool to do this called GDEBI which allows you to install .DEB applications easily, to do this run:

sudo nala install gdebi
Enter fullscreen mode Exit fullscreen mode

Next time you install a program, preferably use its DEB package and install it using GDEBI by right-clicking on the DEB file and installing it with GDEBI

Gnome Tweaks and Gnome Shell Extensions Manager

Gnome Tweaks is a wonderful application that allows you to tweak various aspects of your OS, while the Extensions Manager allows you to install Gnome Extensions and customize them however you want! There are hundreds of available extensions that you could use to customize your experience on Ubuntu.
Run:

sudo nala install gnome-tweaks
Enter fullscreen mode Exit fullscreen mode

You can then open the Gnome Tweaks app and customize various aspects of your system! To install the Extensions Manager:

sudo nala install gnome-shell-extension-manager
Enter fullscreen mode Exit fullscreen mode

You can then open the Extension Manager and install various extensions to customize your Gnome Desktop experience!

Disable boot splash screen

While the Ubuntu splash screen that shows on boot looks very cool, it can slow down your system boot time a lot. To disable it, first, go to the same grub config file as the first step:

sudo gedit /etc/default/grub
Enter fullscreen mode Exit fullscreen mode

Next, change the GRUB_CMDLINE_LINUX_DEFAULT property to fsck.mode=skip quiet, that way the splash screen will not show the next time you boot into Ubuntu.
Update GRUB again:

sudo update-grub
Enter fullscreen mode Exit fullscreen mode

Install useful packages

Those are packages that don't necessarily come with a fresh Ubuntu installation but can be very useful, run this command to install them:

sudo nala install htop neofetch curl wget git
Enter fullscreen mode Exit fullscreen mode
  • htop shows some CPU and memory statistics about your PC which could help know what's slowing your PC down. This is sort of an equivalent of "Task Manager" on Windows.
  • neofetch shows various system information including your distribution, GPU name, and CPU name.
  • curl and wget are tools for sending network requests from the command line
  • git is used to interact with, well, Git!

Installing auto-cpufreq

auto-cpufreq is an awesome tool to manage your PC's resources, especially for laptop users. To install it, go to the GitHub page's installer and follow the instructions!

After you're done, you can go to the launchpad and start the auto-cpufreq app. Once it starts, click on the "install" button to enable auto-cpufreq. You can then restart the app to change your "Governor". Performance prioritizes device performance over battery life, Powersave prioritizes battery life over device performance, and Default changes the governor based on whether or not your laptop is plugged in.

For desktop users, choose a specific governor and keep it on, default would not matter for you.

Minimize apps on click-again

On Windows, if you open an app, wait for it to start, and then click on its icon again it minimizes itself.
While this behaviour makes sense, it's not the default behaviour on Ubuntu (on Ubuntu, nothing happens when you click again). And there's no way to change it through the GNOME settings GUI. To make apps minimize themselves on "click-again", run this command:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize-or-previews'
Enter fullscreen mode Exit fullscreen mode

Now whenever you click on an already-open app's item in the dock, it should minimize itself!

Install Disk Usage Analyzer (Baobab)

The Disk Usage Analyzer is to me a very useful app when it comes to knowing what takes the most space on my system. To install it, run:

sudo nala install baobab
Enter fullscreen mode Exit fullscreen mode

Next, open your launchpad and open the program, scan a specific drive you want, and wait for it to show you a diagram of all storage taken by your system!

Enable universe and/or multiverse repositories

The universe and multiverse repositories for packages include additional packages that are not included in the default Ubuntu Repository! Universe is for additional open-source repositories, while Multiverse is for closed-source repositories. To add universe run:

sudo add-apt-repository universe
Enter fullscreen mode Exit fullscreen mode

And to add multiverse run:

sudo add-apt-repository multiverse
Enter fullscreen mode Exit fullscreen mode

And to disable any of these repositories just run those same commands with the -r flag added!

Enable Ubuntu media codecs

Ubuntu does not come with all media codecs by default (for example, codecs for MOV files), to install all additional media codecs run:

sudo nala install ubuntu-restricted-extras -y
Enter fullscreen mode Exit fullscreen mode

And that's it, you can now use such codecs freely!

Set up UFW

UFW is a firewall system available for Linux systems that can help protect you online, to check your UFW version run:

ufw --version
Enter fullscreen mode Exit fullscreen mode

Make sure it's up to date by running:

sudo nala install ufw
Enter fullscreen mode Exit fullscreen mode

Enable it on system startup by running this command:

sudo systemctl enable ufw
Enter fullscreen mode Exit fullscreen mode

Start it:

sudo systemctl start ufw
Enter fullscreen mode Exit fullscreen mode

If sudo ufw status says inactive, run:

sudo ufw enable
Enter fullscreen mode Exit fullscreen mode

UFW status should now say active.

Install Stacer

Stacer is an open-source system cleaner and optimizer. It allows you to monitor all applications in a GUI manner, clean your system of trash, customize some aspects of your GNOME experience, and more! To install Stacer run:

sudo nala install stacer
Enter fullscreen mode Exit fullscreen mode

you can then open the app from the launchpad and tinker around however you like, I mostly use it to clean my system or monitor processes in a more "Task Manager"-looking interface than htop:
Stacer Processes Page

Decrease "Swappiness" (optional)

If you specified a swap area for Ubuntu during installation, you should make sure that this swap area is only used in the most extreme cases when your RAM is close to being fully taken up. This is because Swap Space is on your HDD/SSD, which is far slower than your dedicated RAM stick(s). If Ubuntu relies on swap too much, you can feel it's too slow even though you have plenty of RAM left. You can run cat /proc/sys/vm/swappiness to see what your current swappiness value is (should be 60 by default). You can decrease it temporarily [until you reboot] to try different values, to do this run:

sudo sysctl vm.swappiness=15
Enter fullscreen mode Exit fullscreen mode

To me, this value was best at 15, maybe lower would be even better but 15 was good enough. You can change this value however you want to experiment around since this is only a temporary change that's effective until you reboot. Once you find a good value, run this to keep it permanently:

sudo gedit /etc/sysctl.conf
Enter fullscreen mode Exit fullscreen mode

look for the vm.swappiness=<value> line, if it does not exist add it to the bottom:

vm.swappiness=15
Enter fullscreen mode Exit fullscreen mode

Save the file and your swappiness will decrease permanently until you manually change that file.

Preload (bonus)

I have seen many people talk about preload, however after I tried it for around two weeks I did not notice any difference, but that was mostly because I already did not have many applications on my Ubuntu Desktop installation.
Preload is a tool that preloads libraries for your most-used apps into memory before they start. But, before we get into installing preload. I must note that preload could be harmful to you depending on what your usage habits are, remember that preload is always running in the background to optimize your frequent app startups. However, if you only open a certain app once a day (like Brave Browser for me) and don't close it again, preload will keep the preloaded copy of Brave Browser that it doesn't even need since even if I close the Brave Browser window, Brave stays running in the background ready to be started again. So the additional preloaded copy is just a waste of memory!

If you execute some programs for only a few minutes, close them, and open them again a little while afterwards. Then preload is for those programs only (For me these programs are the files app and the terminal, both system apps that do not quite need preload).
So, depending on which use case you practice the most, you decide whether or not you are going to install preload:

sudo nala install preload
Enter fullscreen mode Exit fullscreen mode

And that's it, preload is now installed.


And that's it for today, everyone! I heavily recommend that you reboot your system after applying all those steps before continuing with your daily usage to make sure all changes have been applied.

The next article will be all about the transition from Windows to Linux and what to look out for before setting up dual boot to ensure that you don't regret the entire process.

If you notice I've missed anything, or have any suggestions, make sure to let me know in the comments!

Top comments (0)