Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How remove emacs full?

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

like image 537
Renato Cassino Avatar asked Dec 23 '22 21:12

Renato Cassino


2 Answers

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?

like image 155
Tim X Avatar answered Dec 27 '22 09:12

Tim X


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

like image 26
Prabhat Roy Avatar answered Dec 27 '22 09:12

Prabhat Roy