目录
Ubuntu GNOME Default Desktop Look
What is Ubuntu-debullshit?
Restore Vanilla GNOME in Ubuntu
Ubuntu-debullshit Script Explanation
1. Apply Everything
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
Why not just install Debian?
Conclusion
首页 系统教程 操作系统 如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

Mar 24, 2025 am 09:07 AM

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

Ubuntu GNOME Default Desktop Look

The following screenshot shows you the default desktop of Ubuntu 23.04.

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

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".

What is 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:

  • Completely removes snaps.
  • Installs a fresh, 'Vanilla' GNOME session.
  • Sets up both flathub and gnome-software with the flatpak plugin.
  • Replaces the snap version of Firefox with a flatpak version.
  • Disables Ubuntu's default theming.
  • Activates the libadwaita theme for gtk3 applications using adw-gtk3.
  • Enables GNOME integration with QT applications.
  • Installs the adwaita 43 icon theme.
  • Disables the data reporting component.
  • Disables the pop-up that appears following a system crash.

This script has been officially tested on Ubuntu 23.04. The developer also claims that it should work on Ubuntu 22.04 as well.

Restore Vanilla GNOME in Ubuntu

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>
登录后复制

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

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>
登录后复制

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

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.

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面

Ubuntu-debullshit Script Explanation

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.

1. Apply Everything

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.

2. Disable Ubuntu Report

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:

  • ubuntu-report send no: This command tells ubuntu-report not to send a report about your system. The send command is used to send a report, and the no argument means that you're choosing not to send it.
  • apt remove ubuntu-report -y: Removes the ubuntu-report package from your system. The -y option automatically answers 'yes' to any prompts.

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.

3. Remove app crash popup

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.

  • apport: This is a package that automatically generates crash reports. When a program crashes, apport can create a detailed report that developers can use to understand what went wrong and fix the issue.
  • apport-gtk: This is a graphical front-end for apport. It provides a user-friendly way to view and manage crash reports.

4. Remove snaps and snapd

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.

5. Install flathub and gnome-software

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.

  • apt install flatpak -y: Installs Flatpak on your system.
  • flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo: This command adds the Flathub repository as a source for Flatpak applications. Flathub is the app store for Flatpak apps. The --if-not-exists option ensures that Flathub is only added if it hasn't already been added.
  • apt install --install-suggests gnome-software -y: Installs the GNOME Software application, along with any packages that are suggested for it. The --install-suggests option tells apt to also install any packages that are suggested for gnome-software.

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

6. Install firefox 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.

7. Install vanilla GNOME session

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:

  • apt install gnome-session fonts-cantarell adwaita-icon-theme-full gnome-backgrounds gnome-tweaks qgnomeplatform-qt5 -y: Installs several packages related to the GNOME desktop environment.
  • update-alternatives --set gdm-theme.gresource /usr/share/gnome-shell/gnome-shell-theme.gresource: This command sets the default GNOME Display Manager (GDM) theme to the vanilla GNOME theme. update-alternatives is a system utility to manage default commands for specific tasks. The --set option is used to manually set the path to the .gresource file for the GDM theme. In this case, /usr/share/gnome-shell/gnome-shell-theme.gresource is the path to the version of the GDM theme that you want to set as the default.
  • apt remove ubuntu-session -y: This command removes the ubuntu-session package from your system. This package provides the default Ubuntu Session and removing it will leave you with the standard GNOME session.

8. Install adw-gtk3 and latest adwaita icons

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,

  • logged_user=$(logname): This command retrieves the username of the user who initiated the session and stores it in the variable logged_user.
  • sudo apt install dbus-x11: This command installs the dbus-x11 package, which includes the dbus-launch utility needed for the script to change user settings later on.
  • wget https://github.com/lassekongo83/adw-gtk3/releases/download/v4.6/adw-gtk3v4-6.tar.xz -O /tmp/adw-gtk3.tar.xz: This command downloads the adw-gtk3 theme file from GitHub and saves it in the /tmp directory.
  • tar -xvf /tmp/adw-gtk3.tar.xz -C /usr/share/themes: This command extracts the downloaded theme file to the /usr/share/themes directory.
  • flatpak install -y runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22 and flatpak install -y runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22: These commands install the adw-gtk3 and adw-gtk3-dark themes for Flatpak applications.
  • The if statement and the commands within it: This block checks the current user's color-scheme preference using the gsettings utility. If the user prefers a dark theme, it sets the adw-gtk3-dark theme as the default GTK theme and sets the color-scheme preference to 'prefer-dark'. If the user does not prefer a dark theme, it sets the adw-gtk3 theme as the default GTK theme.

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,

  • 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: This command downloads the Adwaita icon theme package from the Debian repository and saves it as adwaita-icon-theme.deb in the /tmp directory.
  • apt install /tmp/adwaita-icon-theme.deb -y: This command installs the Adwaita icon theme package that was downloaded in the previous step.

Why not just install Debian?

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.

  1. Driver support - Ubuntu tends to be more compatible with a wider range of hardware. For the latest Bluetooth and WiFi drivers in Debian, you'll need to install the non-free firmware package. And also, getting the latest Mesa 3D on Debian can be quite challenging.
  2. Snap - Some users feel that Snaps go against the open-source philosophy because they are controlled by Canonical and the Snap Store is not open source.

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.

Conclusion

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:

  • Ubuntu-debullshit Repository

以上是如何在Ubuntu中恢复带有Flatpak支持的香草Gnome桌面的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

<🎜>:泡泡胶模拟器无穷大 - 如何获取和使用皇家钥匙
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系统,解释
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆树的耳语 - 如何解锁抓钩
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

Java教程
1672
14
CakePHP 教程
1428
52
Laravel 教程
1332
25
PHP教程
1276
29
C# 教程
1256
24
Linux管理员的薪水是多少? Linux管理员的薪水是多少? Apr 17, 2025 am 12:24 AM

Linux管理员的平均年薪在美国为75,000至95,000美元,欧洲为40,000至60,000欧元。提升薪资可以通过:1.持续学习新技术,如云计算和容器技术;2.积累项目经验并建立Portfolio;3.建立职业网络,拓展人脉。

Linux系统管理员的主要任务是什么? Linux系统管理员的主要任务是什么? Apr 19, 2025 am 12:23 AM

Linux系统管理员的主要任务包括系统监控与性能调优、用户管理、软件包管理、安全管理与备份、故障排查与解决、性能优化与最佳实践。1.使用top、htop等工具监控系统性能,并进行调优。2.通过useradd等命令管理用户账户和权限。3.利用apt、yum管理软件包,确保系统更新和安全。4.配置防火墙、监控日志、进行数据备份以确保系统安全。5.通过日志分析和工具使用进行故障排查和解决。6.优化内核参数和应用配置,遵循最佳实践提升系统性能和稳定性。

Linux和Windows之间虚拟化支持有哪些差异? Linux和Windows之间虚拟化支持有哪些差异? Apr 22, 2025 pm 06:09 PM

Linux和Windows在虚拟化支持上的主要区别在于:1)Linux提供KVM和Xen,性能和灵活性突出,适合高定制环境;2)Windows通过Hyper-V支持虚拟化,界面友好,与Microsoft生态系统紧密集成,适合依赖Microsoft软件的企业。

Linux的主要目的是什么? Linux的主要目的是什么? Apr 16, 2025 am 12:19 AM

Linux的主要用途包括:1.服务器操作系统,2.嵌入式系统,3.桌面操作系统,4.开发和测试环境。Linux在这些领域表现出色,提供了稳定性、安全性和高效的开发工具。

很难学习Linux吗? 很难学习Linux吗? Apr 18, 2025 am 12:23 AM

学习Linux并不难。1.Linux是一个开源操作系统,基于Unix,广泛应用于服务器、嵌入式系统和个人电脑。2.理解文件系统和权限管理是关键,文件系统是层次化的,权限包括读、写和执行。3.包管理系统如apt和dnf使得软件管理方便。4.进程管理通过ps和top命令实现。5.从基本命令如mkdir、cd、touch和nano开始学习,再尝试高级用法如shell脚本和文本处理。6.常见错误如权限问题可以通过sudo和chmod解决。7.性能优化建议包括使用htop监控资源、清理不必要文件和使用sy

Linux软件的未来:Flatpak和Snap会替换本机桌面应用程序吗? Linux软件的未来:Flatpak和Snap会替换本机桌面应用程序吗? Apr 25, 2025 am 09:10 AM

多年来,Linux软件分布依赖于DEB和RPM等本地格式,并深深地根深蒂固。 但是,Flatpak和Snap已经出现,有望成为应用程序包装的通用方法。 本文考试

在Linux中比较文件的前7个工具(示例) 在Linux中比较文件的前7个工具(示例) Apr 28, 2025 am 09:21 AM

本指南探讨了用于比较Linux中文本文件的各种方法,Linux是系统管理员和开发人员的关键任务。 我们将介绍命令行工具和视觉差异工具,突出显示其优势和适当的用例。 假设

Linux和Windows之间的用户帐户管理有什么区别? Linux和Windows之间的用户帐户管理有什么区别? May 02, 2025 am 12:02 AM

Linux和Windows在用户账户管理上的主要区别在于权限模型和管理工具。Linux使用基于Unix的权限模型和命令行工具(如useradd、usermod、userdel),而Windows采用自己的安全模型和图形用户界面(GUI)管理工具。

See all articles