I installed Emacs in my Ubuntu and I cannot uninstall (and cannot install anything more)
▶ sudo apt-get install tig
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-bin-common : Depends: emacs-common (= 1:26.1+1-3.2ubuntu2) but it is not going to be installed
emacs-el : Depends: emacs-common (= 1:26.1+1-3.2ubuntu2) but it is not going to be installed
emacs-gtk : Depends: emacs-common (= 1:26.1+1-3.2ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I tried to run the command apt --fix-broken install
, and I receive this error message:
▶ sudo apt --fix-broken install -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
emacs-common
Suggested packages:
emacs-common-non-dfsg ncurses-term
The following NEW packages will be installed:
emacs-common
0 upgraded, 1 newly installed, 0 to remove and 133 not upgraded.
3 not fully installed or removed.
Need to get 0 B/13,3 MB of archives.
After this operation, 68,4 MB of additional disk space will be used.
(Reading database ... 185527 files and directories currently installed.)
Preparing to unpack .../emacs-common_1%3a26.1+1-3.2ubuntu2_all.deb ...
Unpacking emacs-common (1:26.1+1-3.2ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/emacs-common_1%3a26.1+1-3.2ubuntu2_all.deb (--unpack):
trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs26-common 26.2~1.gitfd1b34b-kk1+19.04
Errors were encountered while processing:
/var/cache/apt/archives/emacs-common_1%3a26.1+1-3.2ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
How can I do to solve this?
Thanks
Try to remove the broken packages which have missing dependencies e.g.
sudo apt remove --purge emacs-bin-common emacs-el emacs-gtk
If that doesn't work, try again with the --force flag added.
How did you try to uninstall emacs initially?
First, remove from Ubuntu software. If not removed, then try to use this command for broken package:
sudo apt remove --purge emacs-bin-common emacs-el emacs-gtk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With