kelleyk / ppa-emacs

Packaging repository for my Emacs PPA
https://launchpad.net/~kelleyk/+archive/ubuntu/emacs
97 stars 4 forks source link

Conflict between emacs27-common and emacs28-common #24

Open dmusican opened 2 years ago

dmusican commented 2 years ago

Installing emacs28 with emacs27 installed is bad, I learned the hard way. I tried to install emacs28 (via sudo apt install emacs28) and got this error:

dpkg: error processing archive /var/cache/apt/archives/emacs28-common_28.1~1.git5a223c7f2e-kk1+20.04_all.
deb (--unpack):                                                                                          
 trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs27-common 27.1~1.git86d
8d76aa3-kk2+20.04                                                                                        
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)                                     
Selecting previously unselected package libasan6:amd64.                                                  
Preparing to unpack .../libasan6_10.3.0-1ubuntu1~20.04_amd64.deb ...                                     
Unpacking libasan6:amd64 (10.3.0-1ubuntu1~20.04) ...                                                     
Selecting previously unselected package libgcc-10-dev:amd64.                                             
Preparing to unpack .../libgcc-10-dev_10.3.0-1ubuntu1~20.04_amd64.deb ...                                
Unpacking libgcc-10-dev:amd64 (10.3.0-1ubuntu1~20.04) ...                                                
Selecting previously unselected package libgccjit0:amd64.                                                
Preparing to unpack .../libgccjit0_10.3.0-1ubuntu1~20.04_amd64.deb ...                                   
Unpacking libgccjit0:amd64 (10.3.0-1ubuntu1~20.04) ...                                                   
Selecting previously unselected package emacs28.                                                         
Preparing to unpack .../emacs28_28.1~1.git5a223c7f2e-kk1+20.04_amd64.deb ...                             
Unpacking emacs28 (28.1~1.git5a223c7f2e-kk1+20.04) ...                                                   
Errors were encountered while processing:                                                                
 /var/cache/apt/archives/emacs28-common_28.1~1.git5a223c7f2e-kk1+20.04_all.deb                           
E: Sub-process /usr/bin/dpkg returned an error code (1)     

So I tried to fix it by uninstalling emacs27, but no good:

sudo apt remove emacs27                                                                                
Reading package lists... Done                                                                            
Building dependency tree                                                                                 
Reading state information... Done                          
You might want to run 'apt --fix-broken install' to correct these.                                       
The following packages have unmet dependencies:
emacs28 : Depends: emacs28-common but it is not going to be installed                                   
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). 

Various forms of uninstalling, trying to remove emacs27-common or emacs28-common didn't help. nor did apt --fix-broken install.

After some Googling, sudo dpkg -P emacs27-common seems to have been the critical step; after this, I was able to install emacs28.

So... I got myself out of trouble, but someone else is likely to land in the same place.

dajohans commented 2 years ago

Can confirm, this also happened me on Ubuntu Mate 22.04 after first installing the ppa version of Emacs 28 and then trying to install Emacs 27 from Ubuntus default repository. Good to hear that you found a fix! I didn’t, so my ”fix” was to reinstall the OS.

dmusican commented 2 years ago

Oh, right, I should followup: for me it was on (gnome) Ubuntu 20.04.

(sorry to hear about your OS reinstall, @dajohans!)

pataquets commented 2 years ago

Same here. Doing the apt --fix-broken install and purging emacs27 and emacs27-common before attempting upgrade again fixed it for me.

kelleyk commented 2 years ago

Oh, no, I'm sorry to hear that you wound up reinstalling the OS! This is related to #16, which is one of the bigger long-standing issues with the PPA packaging, I think. I tried to improve the situation a while ago but my changes didn't completely address the issue.

I think that the best possible outcome here is that the PPA's packages become more similar to the Debian/Ubuntu-provided ones. I haven't had more time to look into making that happen, but I would be very happy to take suggestions or contributions.

I'd also love to chat with any of the folks who maintain those distro-provided Emacs packages if they happen to be reading!

neverkas commented 11 months ago

Thanks! Same happens to me but before that I had to purge another one

jelou@jelou-Lenovo-B570:~$ sudo dpkg -P emacs27 emacs27-common
dpkg: warning: ignoring request to remove emacs27 which isn't installed
dpkg: dependency problems prevent removal of emacs27-common:
 emacs27-el depends on emacs27-common.

dpkg: error processing package emacs27-common (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 emacs27-common
jelou@jelou-Lenovo-B570:~$ sudo dpkg -P emacs27-el
(Reading database ... 475783 files and directories currently installed.)
Removing emacs27-el (27.1~1.git86d8d76aa3-kk2+20.04) ...
jelou@jelou-Lenovo-B570:~$ sudo dpkg -P emacs27-common
(Reading database ... 474294 files and directories currently installed.)
Removing emacs27-common (27.1~1.git86d8d76aa3-kk2+20.04) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...