Debian – Can’t Install Package from Bookworm/Backports

debian

I have tried to install emacs 29.1 from bookworm-backports, but emacs --version still gives me the wrong 28.2 version.

user@user-x370pro4:~$ sudo apt install emacs/bookworm-backports
[sudo] password for user: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
emacs is already the newest version (1:29.1+1-5~bpo12+1).
Selected version '1:29.1+1-5~bpo12+1' (Debian Backports:stable-backports [all]) for 'emacs'
The following package was automatically installed and is no longer required:
  librnp0
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 67 not upgraded.
user@user-x370pro4:~$ emacs --version
GNU Emacs 28.2
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Above that, I cannot do sudo apt install emacs-gtk/bookworm-backports as I get the following:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Selected version '1:29.1+1-5~bpo12+1' (Debian Backports:stable-backports [amd64]) for 'emacs-gtk'
Selected version '1:29.1+1-5~bpo12+1' (Debian Backports:stable-backports [amd64]) for 'emacs-bin-common' because of 'emacs-gtk'
Selected version '1:29.1+1-5~bpo12+1' (Debian Backports:stable-backports [all]) for 'emacs-common' because of 'emacs-bin-common'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 emacs-common : Depends: emacs-el but it is not installable
E: Unable to correct problems, you have held broken packages.

Thank you very much!

Here is my sources.list:

# See https://wiki.debian.org/SourcesList for more information.
deb http://deb.debian.org/debian bookworm main non-free-firmware
deb-src http://deb.debian.org/debian bookworm main non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main non-free-firmware

deb http://security.debian.org/debian-security/ bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security/ bookworm-security main non-free-firmware

# Backports allow you to install newer versions of software made available for this release
deb http://deb.debian.org/debian bookworm-backports main non-free-firmware
deb-src http://deb.debian.org/debian bookworm-backports main non-free-firmware

Best Answer

You need:

sudo apt update
sudo apt install emacs -t bookworm-backports 
Related Question