As you may already know, starting from the Ubuntu 18.04 version, the default desktop environment is GNOME. Prior to that, Ubuntu used a custom desktop environment called Unity. GNOME is one of the most popular desktop environments which is known for its simplicity, accessibility, and ease of use. While Ubuntu uses the GNOME DE by default, it's important to note that Ubuntu's version of GNOME is heavily customized. Some of you may not like the customized version of GNOME in Ubuntu. If you're one of them, this tutorial will help you to restore Vanilla GNOME desktop with flatpaks support in Ubuntu, much like what you'd find in a fresh Fedora installation.
Table of Contents
The following screenshot shows you the default desktop of Ubuntu 23.04.
As you can see, the Ubuntu's GNOME desktop looks very different than the standard GNOME desktop.
The Ubuntu development team have implemented a series of changes in GNOME DE to deliver a unique and user-friendly experience for the average Linux user. For instance, Ubuntu includes a dock on the left side of the screen, which is reminiscent of the Unity Launcher. These customizations aim to improve usability and maintain a familiar interface for users transitioning from Ubuntu's former Unity environment.
As I've already stated, some of you might prefer to use the stock GNOME desktop instead of the customized GNOME found in the current versions of Ubuntu Linux.
Fortunately, I found a shell script that restores Ubuntu with a clean GNOME desktop with flatpaks, similar to a fresh Fedora install. The script is called "ubuntu-debullshit".
Ubuntu-debullshit is an automated shell script used to remove snaps, install flatpaks, and restore the vanilla GNOME interface in Ubuntu Linux.
The Ubuntu-debullshit script does more than just revert Ubuntu to the stock GNOME desktop. It performs some additional actions. Here's what it can do:
This script has been officially tested on Ubuntu 23.04. The developer also claims that it should work on Ubuntu 22.04 as well.
First of all, update your Ubuntu system to latest version:
$ sudo apt update
$ sudo apt full-upgrade
Reboot the system to apply the updates:
$ sudo reboot
Close all running applications except the terminal and run the 'ubuntu-debullshit' script to restore Vanilla GNOME desktop in Ubuntu Linux:
$ sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/polkaulfield/ubuntu-debullshit/main/ubuntu-debullshit.sh)"
You will prompted to enter sudo password. After entering it, you will see following options:
[sudo] password for ostechnix: ▐ ▗ ▐ ▐ ▝▜ ▝▜ ▐ ▝ ▗ ▗ ▗ ▗ ▐▄▖ ▗ ▗ ▗▗▖ ▗▟▄ ▗ ▗ ▄▟ ▄▖ ▐▄▖ ▗ ▗ ▐ ▐ ▄▖ ▐▗▖ ▗▄ ▗▟▄ ▐ ▐ ▐ ▐▘▜ ▐ ▐ ▐▘▐ ▐ ▐ ▐ ▐▘▜ ▐▘▐ ▐▘▜ ▐ ▐ ▐ ▐ ▐ ▝ ▐▘▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▐ ▀▘ ▐ ▐ ▐▀▀ ▐ ▐ ▐ ▐ ▐ ▐ ▀▚ ▐ ▐ ▐ ▐ ▝ ▝▄▜ ▐▙▛ ▝▄▜ ▐ ▐ ▝▄ ▝▄▜ ▝▙█ ▝▙▞ ▐▙▛ ▝▄▜ ▝▄ ▝▄ ▝▄▞ ▐ ▐ ▗▟▄ ▝▄ ▐ By @polkaulfield Choose what to do: 1 - Apply everything (RECOMMENDED) 2 - Disable Ubuntu report 3 - Remove app crash popup 4 - Remove snaps and snapd 5 - Install flathub and gnome-software 6 - Install firefox flatpak 7 - Install vanilla GNOME session 8 - Install adw-gtk3 and latest adwaita icons q - Exit Enter your choice: <strong>1</strong>
As you can see, you can individually pick an action to perform or run all actions automatically. Make your choice by entering the respective number. The first option is recommended. Simply type '1' to apply everything and hit ENTER key. This is fully automated. Just sit back and relax while the script does its job. This process may take some time, depending on your internet speed.
Once all tasks are completed, you will se the following output. Type 'y' to reboot your system.
[...] Removing apport-symptoms (0.24) ... Removing gdb (13.1-2ubuntu2) ... Removing libbabeltrace1:amd64 (1.5.11-1build1) ... Removing libsource-highlight4v5:amd64 (3.1.9-4.2build1) ... Removing libboost-regex1.74.0:amd64 (1.74.0-18.1ubuntu3) ... Removing libc6-dbg:amd64 (2.37-0ubuntu2) ... Removing libdebuginfod1:amd64 (0.188-2.1) ... Removing libdebuginfod-common (0.188-2.1) ... Removing libipt2 (2.0.5-1) ... Removing libsource-highlight-common (3.1.9-4.2build1) ... Removing python3-systemd (235-1build2) ... Removing ubuntu-mono (20.10-0ubuntu2) ... Processing triggers for man-db (2.11.2-1) ... Processing triggers for libc-bin (2.37-0ubuntu2) ... [*] Done! Reboot now? (y/n) <strong>y</strong>
Congratulations! All Ubuntu-related customizations are gone. You will now see a Ubuntu system with a stock GNOME desktop.
Here are a few screenshots that shows how Ubuntu 23.04 desktop looks with vanilla GNOME DE.
You can view the entire code of the ubuntu-debullshit script here. The code is simple and quite easy to understand.
Under the hood, the ubuntu-debullshit runs a series of commands and performs the appropriate actions.
Let us have quick look at what each part does in this script.
If you select this option, the ubuntu-debullshit script will perform all of the subsequent actions one by one, automatically. This is the recommended option.
This is part of the ubuntu-debullshit script will disable Ubuntu report.
disable_ubuntu_report() { ubuntu-report send no apt remove ubuntu-report -y }
The disable_ubuntu_report() function will run the following two commands:
For those wondering, the ubuntu-report is a tool that collects and reports hardware and other information about your Ubuntu system to help improve the Ubuntu distribution.
This part of the script will disable generating automatic crash reports.
remove_appcrash_popup() {apt remove apport apport-gtk -y}
The remove_appcrash_popup() function will run the apt remove apport apport-gtk -y, which will uninstall both apport and apport-gtk packages from your system.
This part of the script will remove the snaps and snapd from your Ubuntu system.
remove_snaps() { while [ "$(snap list | wc -l)" -gt 0 ]; do for snap in $(snap list | tail -n +2 | cut -d ' ' -f 1); do snap remove --purge "$snap" done done systemctl stop snapd systemctl disable snapd systemctl mask snapd apt purge snapd -y rm -rf /snap /var/lib/snapd for userpath in /home/*; do rm -rf $userpath/snap done cat <<-EOF | tee /etc/apt/preferences.d/nosnap.pref Package: snapd Pin: release a=* Pin-Priority: -10 EOF }
This script, defined as the function remove_snaps(), is designed to completely remove Snap and all installed Snap packages from your Linux system.
Let's break down the above code and see what each part does.
The while loop and for loop:
The while loop checks if there are any Snap packages installed by counting the number of lines output by snap list command. If there are any Snap packages installed (snap list | wc -l returns a number greater than 0), it enters the loop.
The for loop then goes through each Snap package installed (snap list | tail -n +2 | cut -d ' ' -f 1 gives a list of installed Snap packages) and removes it using the snap remove --purge "$snap" command.
The while loop will keep running until all Snap packages have been removed.
The systemctl commands:
These commands stop the Snap service using systemctl stop snapd command, prevent it from starting at boot using systemctl disable snapd command, and mask the service to prevent it from being started by other services using systemctl mask snapd command.
The apt purge command:
This command removes the snapd package from the system, which is the daemon that manages Snap packages. The -y option automatically answers 'yes' to any prompts.
The rm -rf commands:
These commands remove the directories /snap and /var/lib/snapd, which are used by Snap, and the snap directory in each user's home directory (i.e. /home/*).
The cat command with a heredoc (<<-EOF … EOF):
This command creates a new APT preferences file at /etc/apt/preferences.d/nosnap.pref that prevents snapd from being installed again. The Pin-Priority: -10 line means that snapd will not be considered for installation.
In summary, this script function is used to completely remove Snap from a system and prevent it from being installed again.
This part of the script installs Flatpak, sets up the Flathub repository for Flatpak apps, and installs the GNOME Software application with its suggested packages.
setup_flathub() { apt install flatpak -y flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo apt install --install-suggests gnome-software -y }
The function setup_flathub() runs the following commands and performs the respective actions.
For those wondering, GNOME Software is an app store-like interface for managing applications on GNOME-based systems.
Suggested Read:
- A Beginners Guide To Flatpak
The function restore_firefox() installs the Firefox web browser using Flatpak.
restore_firefox() {flatpak install -y app/org.mozilla.firefox/x86_64/stable}
Here, the flatpak install -y app/org.mozilla.firefox/x86_64/stable command installs the stable version of the Firefox web browser as a Flatpak application.
This is the main part of this script.
setup_vanilla_gnome() { apt install gnome-session fonts-cantarell adwaita-icon-theme-full gnome-backgrounds gnome-tweaks qgnomeplatform-qt5 -y update-alternatives --set gdm-theme.gresource /usr/share/gnome-shell/gnome-shell-theme.gresource apt remove ubuntu-session -y }
The setup_vanilla_gnome() function will a vanilla GNOME desktop environment on your Ubuntu system. This function will run the following commands one by one:
This part of script will install both adwaita theme and adwaita icon set in your Ubuntu system.
The install_adwgtk3() function downloads and installs the adw-gtk3 and adw-gtk3-dark themes, and then sets one of these themes as the default theme for the current user based on their color-scheme preference.
install_adwgtk3() { logged_user=$(logname) sudo apt install dbus-x11 wget https://github.com/lassekongo83/adw-gtk3/releases/download/v4.6/adw-gtk3v4-6.tar.xz -O /tmp/adw-gtk3.tar.xz tar -xvf /tmp/adw-gtk3.tar.xz -C /usr/share/themes flatpak install -y runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22 flatpak install -y runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22 if [ "$(sudo -Hu $logged_user dbus-launch gsettings get org.gnome.desktop.interface color-scheme)" == ''\''prefer-dark'\''' ]; then sudo -Hu $logged_user dbus-launch gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark' sudo -Hu $logged_user dbus-launch gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' else sudo -Hu $logged_user dbus-launch gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3' fi }
Here,
The following function install_icons() is a script that downloads and installs the Adwaita icon theme on your system.
install_icons() { wget https://deb.debian.org/debian/pool/main/a/adwaita-icon-theme/adwaita-icon-theme_43-1_all.deb -O /tmp/adwaita-icon-theme.deb apt install /tmp/adwaita-icon-theme.deb -y }
Here,
If you don't like Ubuntu, why are you using it? Why not just install Debian or Mint and be done with it? You may have these questions in mind. I can think of two reasons.
Other than these two reasons, I don' see any particular reasons to use it. If you think of any worthy reasons, please let me know via the comment section below.
In this guide, we explained the steps to revert back to the original, Vanilla GNOME desktop, complete with support for flatpaks, much like what you'd find in a fresh Fedora installation.
The Ubuntu-debullshit script is a transformative tool for Ubuntu Linux users who prefer simplicity and tradition. By removing snaps, installing flatpaks, and restoring the original GNOME desktop environment, this script enables users to customize their Ubuntu experience to better suit their needs.
It's not only an easy, but also quickest way to declutter your system and return to a more classic, less bloated Ubuntu setup.
Resource:
Atas ialah kandungan terperinci Cara memulihkan desktop vanila gnome dengan sokongan flatpak di Ubuntu. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!