Using Debian Linux is fine for most users as it ships very stable and rock solid package for everyone, and this is the main reason why most online servers are using Debian as their favorite Linux OS. But stability doesn’t mean latest version of system and apps, instead last stable or slightly old apps are used in it which many desktop and laptop users find not really intuitive. In this tutorial, I’ll explain how to install the latest version of GNOME, but it works the same way for any package.
The latest version of GNOME is not available in the default repository, but it is in the unstable release, so in this case we’ll set the system to use unstable repository for GNOME and related packages while use default repository for other things.
So, here we are not migrating everything to unstable, instead just setting up GNOME to use the unstable release for updating desktop environments. Your rest of the Debian system will stay on the rock solid stable repository and release.
Before we move to touch the system, ensure that you are logged in as a root or root-privileged user who can freely install any package without any restriction. If not, then check this tutorial, if you are intended to update normal user to root-privileged.
Prerequisite: Update Once Everything.
Since we are going to change major stuff here, it is good to update the system once to its most up-to-date one. For that, run the following commands:
sudo apt update && sudo apt upgrade
This may take few seconds and minutes depending on how soon you update it.
Note: If you are using a minimal version of Debian without GNOME, simply run the tasksel
command and install the Gnome desktop environment first.
Add the Unstable Repository First.
While I am writing this tutorial, I’m on Debian 12 Bookworm and currently available GNOME version of 43, which is close to over 2 years. Now GNOME 47 is available.
Usually Debian release go like this: experimental → unstable → testing → stable.
It means, the latest GNOME version 46 or 47 should be available on unstable.
Now add the unstable repository:
sudo nano /etc/apt/sources.list
You need to add these line at the end and do not delete any other stuff there:
deb http://deb.debian.org/debian/ unstable main contrib
deb-src http://deb.debian.org/debian/ unstable main contrib
Save and exit (simply, Ctrl+O to overwrite, Enter to save, Ctrl+X to exit).
Hold. Don’t update anything now.
Adjust the Preferences.
By default, APT will check for the latest version available from all the servers in sources.list and download the most recent one for every package on the system. We don’t want that; we only want to use the unstable repository for GNOME.
To fix that, we need to set some preferences and set lower priority to unstable.
For that, run the below command:
sudo nano /etc/apt/preferences
The file named preferences is not there, we need to create this. If you run the above command, it will show you a blank screen to type on it and then save the file.
Once you see a blank screen, copy-paste the below lines in it.
# STABLE - BOOKWORM
Package: *
Pin: release a=bookworm
Pin-Priority: 500
# UNSTABLE - SID
Package: *
Pin: release a=unstable
Pin-Priority: 100
# GNOME AUTO-UPGRADE FROM UNSTABLE - SID
Package: gnome-session
Pin: release a=unstable
Pin-Priority: 1000
Package: gnome-backgrounds
Pin: release a=unstable
Pin-Priority: 1000
Package: gnome-applets
Pin: release a=unstable
Pin-Priority: 1000
Package: gnome-control-center
Pin: release a=unstable
Pin-Priority: 1000
Package: mutter
Pin: release a=unstable
Pin-Priority: 1000
Package: gjs
Pin: release a=unstable
Pin-Priority: 1000
Here, the “Pin-Priority” will instruct the system to use—which release for what.
For this list, 100 is the lowest priority and 500/1000 are the high/highest.
By the above, it will instruct APT to update from unstable if instructed by command (lowest) and update the GNOME stuff only from unstable release (highest). While other things like apps will normally update on stable release (high).
It may sound confusing just looking at it, but it’s not. Stable release has the high priority, unstable has the lowest priority, and just to supersede “specifically the GNOME and related stuff from stable to unstable” it has the highest priority.
Save it. Close it.
Sync the Repositories Once.
As we have made some changes in the source list, update the system once:
sudo apt update
Now we can move ahead to actual installation.
Installation.
Now we can install what we were waiting for.
But here we will update using -t unstable
flag and parameter. Using APT with the -t unstable
flag tells it to get packages from the unstable repository.
Although we can directly update it, but this is for the current session stability.
The following packages need to be updated in order to update GNOME.
sudo apt -t unstable install gnome-session gnome-shell gnome-backgrounds gnome-applets gnome-control-center mutter gjs
Once you hit enter, the update process will begin.
During the installation, you may be prompted a few times, like update notes for that simply fast read it (not necessary I guess), press q to quit. And when prompted to restart services, hit YES if there is nothing critical on your system:
Once the installation is complete. Reboot the system, and you are on the latest GNOME version to enjoy everything like vanilla GNOME.
You can confirm this with neofetch
or screenfetch
like commands.
As we have set GNOME and related packages to highest (1000) priority, the system will often update itself to the latest available release for GNOME.
Bonus Installation Tip.
You can any unstable package now using -t unstable
flag and parameter, either related to GNOME or not. For example, I often use GNOME-tweaks.
To install or update that, run the following command like this:
sudo apt -t unstable install gnome-tweaks
Isn’t the great and fun to do that? Let me know in the comment section below.
Leave a Reply