I've installed emacs28 from snapshot (emacs-snapshot-common) without realizing it's the latest bleeding edge and not the latests stable version. I tries installing 26.3 from Kevin Kelly's repo, as described here, but got an error:
Unpacking emacs26-common (26.3~1.git96dd019-kk1+18.04) ...
dpkg: error processing archive /var/cache/apt/archives/emacs26-common_26.3~1.git96dd019-kk1+18.04_all.deb (--unpack):
trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs-snapshot-common 20200427:100116-e49d3a4~ubuntu18.04.1
I then tried to uninstall both of them but I get:
jonathan@DESKTOP-2VSOFC3:~$ sudo apt-get remove emacs-snapshot-common
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:
emacs-snapshot : Depends: emacs-snapshot-common (= 20200427:100116-e49d3a4~ubuntu18.04.1) but it is not going to be installed
emacs26 : Depends: emacs26-common but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I also tried:
sudo dpkg-divert --package emacs26 --divert /usr/include//emacs-module.h.moved --rename /usr/include/emacs-module.h
but that didn't help either...
I'd really appreciate any help getting out of this mess. Thanks!
EDIT: somehow, running remove again for both versions worked, but I still get the same error trying to install emacs-26... while running "emacs&" returns:
emacs-28.0.50: command not found
So now I'm completely without a working version of emacs :'(