Subject: bug#56497: Installation of emacs28 package fails

From: Eli Zaretskii <[email-masked]>
Date: Mon, 11 Jul 2022 19:13:27 +0300

> From: Emily Seville <[email-masked]>
> Date: Tue, 12 Jul 2022 00:05:44 +1000
> 
> I've uninstalled emacs package with Emacs 27.1 via sudo apt purge emacs before installation of new
> Emacs. After that I've done sudo add-apt-repository ppa:kelleyk/emacs && sudo apt
> update. At the and I ran sudo apt install emacs28 and obtain the following error (Does it mean that
> package is broken?):
> 
> Reading package lists... Done
> Building dependency tree... Done
> Reading state information... Done
> The following packages were automatically installed and are no longer required:
>   chromium-codecs-ffmpeg-extra emacs-bin-common emacs-common emacs-el emacs-gtk gstreamer1.0-vaapi libgstreamer-plugins-bad1.0-0 libjs-modernizr
>   libjs-requirejs libqt5positioning5 libqt5webchannel5 libqt5webengine-data libqt5webenginecore5 libqt5webenginewidgets5 libre2-9 ne-doc
> Use 'sudo apt autoremove' to remove them.
> The following additional packages will be installed:
>   emacs28-common
> The following NEW packages will be installed:
>   emacs28 emacs28-common
> 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
> Need to get 24.3 MB of archives.
> After this operation, 99.7 MB of additional disk space will be used.
> Do you want to continue? [Y/n] y
> Get:1 https://ppa.launchpadcontent.net/kelleyk/emacs/ubuntu jammy/main amd64 emacs28-common all 28.1~1.git5a223c7f2e-kk3+22.04 [2,466 B]
> Get:2 https://ppa.launchpadcontent.net/kelleyk/emacs/ubuntu jammy/main amd64 emacs28 amd64 28.1~1.git5a223c7f2e-kk3+22.04 [24.3 MB]
> Fetched 24.3 MB in 24s (1,014 kB/s)                                                                                                              
> Selecting previously unselected package emacs28-common.
> (Reading database ... 306224 files and directories currently installed.)
> Preparing to unpack .../emacs28-common_28.1~1.git5a223c7f2e-kk3+22.04_all.deb ...
> Unpacking emacs28-common (28.1~1.git5a223c7f2e-kk3+22.04) ...
> Selecting previously unselected package emacs28.
> Preparing to unpack .../emacs28_28.1~1.git5a223c7f2e-kk3+22.04_amd64.deb ...
> Unpacking emacs28 (28.1~1.git5a223c7f2e-kk3+22.04) ...
> dpkg: error processing archive /var/cache/apt/archives/emacs28_28.1~1.git5a223c7f2e-kk3+22.04_amd64.deb (--unpack):
>  trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs-common 1:27.1+1-3ubuntu5
> dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
> Errors were encountered while processing:
>  /var/cache/apt/archives/emacs28_28.1~1.git5a223c7f2e-kk3+22.04_amd64.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> What is the best way to fix it? I don't want to mess up my OS.

You seem to be using the Ubuntu installation scripts, so please report
this to the folks that are preparing the Ubuntu Emacs packages.
That's not us.