Ubuntu 22.04 Tips & Tricks

Updated April 24

Ubuntu 22.04 was released this Thursday. It seems to be the most significant Ubuntu release since Ubuntu 16.04. Most of the issues related to workflow and performance have been fixed in the Gnome 42 release. The main Ubuntu distribution (with some tweaks and extensions) is finally usable as a daily driver.

This article provides some tips to set up your new system. You can run the commands given here directly, or download the scripts to modify and run.

1. Disable Swapfile

If you have an SSD and atleast 8 GB of RAM, you can turn off the swapfile to reduce excessive writes to the SSD. Enable ZRAM compression as well to make the best use of available RAM.

Run the following command in a terminal to disable and remove the swapfile.

wget -O - https://teejeetech.com/scripts/jammy/disable_swapfile | bash

2. Enable ZRAM compression

ZRAM creates a compressed swap disk that is located in RAM. The ZRAM disk is used when the system is low on memory. Since it is compressed, it increases the amount of available memory at the cost of slightly higher CPU cycles. Run the command below to enable ZRAM:

sudo apt install -y zram-config

Reboot and run zramctl in a terminal to check the swap usage.

2. Faster Internet

If you are facing slow network speeds and timeouts on Ubuntu 22.04, then your internet service provider is likely to blame. Many ISPs have slow DNS servers that cause delays and timeouts when loading web pages.

Change your WiFi Settings to switch to Google’s DNS servers.

Enter the values 8.8.4.4, 8.8.8.8 in the DNS field of the IPv4 tab.

Enter the values 2001:4860:4860::8888, 2001:4860:4860::8844 in the DNS field of the IPv6 tab.

Disconnect and reconnect to the WiFi connection to see the changes.

3. Remove Snaps

Snap and Flatpak packaging formats enable developers to distribute software more easily to Linux distributions. They can package their software once, and it will run on every Linux distribution that has support for Snap and Flatpak.

The Snap format receives a lot of hate for its slower startup time. However, similar to Flatpak and AppImages, Snaps make many software available for Linux which would not have been available otherwise.

Ubuntu 22.04 comes with some Snap packages pre-installed. If you don’t need them you can remove it to free up some disk space.

Run the following commands to remove Snap packages and place a hold on snapd so that it is not installed automatically by other packages.

sudo apt-get autoremove --purge -y snapd gnome-software-plugin-snap
sudo apt-mark hold snapd

Run the following commands to re-enable Snap support in the future. It will remove the hold on the snapd package and reinstall the snapd package manager.

sudo apt-mark unhold snapd
sudo apt install -y snapd

Flatpak support is not enabled by default on Ubuntu 22.04. Run the following command to add support for Flatpaks.

sudo apt install -y flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

4. Install Firefox or Google Chrome

Firefox is available as a Snap package in Ubuntu 22.04. Many see this as an attempt by Canonical to push the Snap packaging format. However this change was due to a request by Mozilla to reduce the effort required to support multiple Ubuntu releases. With snaps they can build a single package and deploy it to all supported Ubuntu releases.

  • The Firefox team benefits since they don’t need to spend effort on supporting multiple Ubuntu releases
  • The Ubuntu team benefits since they no longer need to maintain their own packages
  • The users benefit since they can use the latest Firefox even on older releases of Ubuntu.

On the downside Mozilla now has more control over Firefox than ever before. The Firefox package on Ubuntu and Linux Mint now comes directly from Mozilla without any changes to the default settings. If you wish to disable telemetry and advertising you need to do it yourself, instead of depending on your Linux distribution.

Installing the Firefox package from Ubuntu’s repositories using APT will install the Snap package instead. This was done to enable users of previous Ubuntu releases to upgrade to 22.04 LTS using Ubuntu’s Upgrade tool. However it makes things more difficult for people trying to install the DEB version from other repositories.

Run the following command to install the Beta version of Firefox from Mozilla’s repositories. We are installing the Beta version since the stable version of Firefox is not yet available in Mozilla’s repositories for Jammy.

wget -O - https://teejeetech.com/scripts/jammy/install_firefox_next | bash

If you prefer to trust Google with your data instead of Mozilla, run the following command to install Google Chrome instead 😉

wget -O - https://teejeetech.com/scripts/jammy/install_google_chrome | bash

5. Install some useful apps

Run the following command to install VLC, GParted and some other useful apps.

Note: This is single command split over several lines. All lines should be copied and pasted as a single command.

sudo apt install -y \
    vlc gparted synaptic shutter \
    gnome-tweaks gnome-shell-extensions gnome-shell-extension-manager \
    boxes fonts-cascadia-code fonts-firacode

This will install the new Shell Extension Manager which is a GUI to browse and install extensions from extensions.gnome.org

6. Install Extensions

You can use the Extension Manager from the step above to install some useful extensions. Installing too many extensions can cause instability and crashes so be careful to install only what you need. Some recommended extensions are listed in the screenshot below.

Avoid using Dash-to-Panel and any other dock-like extensions since they cause Gnome shell to crash frequently in my experience.

7. Remove unwanted apps

You can remove some of the default apps to free up disk space.

sudo apt autoremove --purge -y \
    thunderbird gnome-games \
    rhythmbox totem deja-dup \
    simple-scan cheese hexchat \
    aisleriot gnome-{mahjongg,mines,sudoku} sgt-*

8. Customize the dock

You can switch to a dark mode, change the accent color, and customize the dock from Settings > Appearance.

9. Change the Click Action for the Dock

Run the following command to enable the ‘focus-minimize-or-previews‘ mode.

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'focus-minimize-or-previews'

This works in the following manner:

  1. If an app has multiple windows open, then left-clicking the dock icon will display a preview of open windows. You can switch between windows by clicking the preview image.
  2. If there is only one window, then left-clicking the dock icon will focus the window and bring it to front.
  3. If there is only one window, and the window is already focussed, then left-clicking the dock icon will minimize the window.

10. Customize the terminal

The default theme for the terminal still uses the purple color from previous releases of Ubuntu.

Run the below command to change the theme to something more modern.

wget -O - https://teejeetech.com/scripts/jammy/tweak_terminal | bash
Before
After

11. Install Nala

Nala is a prettier frontend for APT that makes it easier to install packages from the command line. It has the same syntax as apt. You can substitute the command nala for all commands that use apt.

Run the below command to install Nala from it’s official repository.

wget -O - https://teejeetech.com/scripts/jammy/install_nala | bash

Switch to the fastest Ubuntu mirrors in your region:

sudo nala fetch

Update your system:

sudo nala update && sudo nala upgrade

12. Install Deb-Get

Deb-get is a new tool from Martin Wimpress for installing third-party software on Ubuntu.

Install Deb-get with the following command:

sudo apt install -y curl
curl -sL https://raw.githubusercontent.com/wimpysworld/deb-get/main/deb-get | sudo -E bash -s install deb-get

List available software:

sudo deb-get list

Install Google Chrome (for example):

sudo deb-get install google-chrome-stable

This Post Has 2 Comments

  1. timrich1968

    What should we do to update teejee PPAs, e.g. baqpaq?

    1. Tony George

      There’s no need to update. The Focal repo will work fine on Jammy. If you wish you can re-run the installation command to switch to the Jammy repo.

Comments are closed.