Hi,
I tried installing emacs 28.1,which is not in repos, so I added this ppa:ubuntu-elisp/ppa
And Installed emacs which was version 30.0.5(should have checked
)
Then I removed that ppa and purged emacs and tried again with another ppa:kelleyk/emacs
But I couldn't install it, or any package, due to the following error
Building dependency tree
Reading state information... Done
emacs is already the newest version (1:26.3+1-1ubuntu2).
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I tried sudo apt --fix-broken install
which gives
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
emacs-snapshot-common emacs28-common liblockfile-bin liblockfile1
Use 'sudo apt autoremove' to remove them.
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 17 not upgraded.
10 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.
On pressing y
I get the followin error
(Reading database ... 357629 files and directories currently installed.)
Preparing to unpack .../emacs-common_1%3a26.3+1-1ubuntu2_all.deb ...
Unpacking emacs-common (1:26.3+1-1ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all
.deb (--unpack):
trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs-snapshot
-common 20230720:106523-f9bbe3189b0~ubuntu20.04.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
This is same for any package.
any help is appreciated.
Also any suggestions for downloading emacs version 28.1 or 28.2 are appreciated.(with these preferences ordered from most to least desirable )
- PPA/Deb package
- compile from source (help with prerequisite libraries)
Thanks :]
For the previous version of emacs, you can use sudo dpkg -i --force-overwrite (Path-to-program file)
following by sudo apt install -f
To remove:
sudo apt remove --purge emacs emacs-common
Looking at the kellyk repository you have already added:
You should be able to install with
sudo apt update && sudo apt install emacs28
HI,
Thanks for replying, your help is much appreciated.
What programs? emacs-bin-common,emacs-gtk and emacs-el?
If yes, then I tried whereis
command which only gave the path for emacs-gtk as
emacs-gtk: /usr/bin/emacs-gtk /usr/share/man/man1/emacs-gtk.1.gz
And not for the other two programs which returned empty values
emacs-el:
emacs-bin-common:
I also tried which
command with the same results
First, I would like to start with this quote:
Running the above command will install emacs28 from the repository, regardless of if it is a downgrade since you specified a version. So you may not need to do force-overwrite. Try installing emacs28 first and only try the following if it fails due to the presently installed packages.
Moreover, removing what you have installed currently should be as direct as:
sudo apt remove --purge emacs
Below this line addresses a situation where you must Force-Overwrite if all of the above fails.
In that case, you would look like this:
sudo dpkg -i --force-overwrite /usr/bin/emacs-gtk
I cannot install any package, emacs or any other, and get the follwing error
sudo apt install emacs28
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution
Strangly enough purge also gives the same error
~$ sudo apt remove --purge emacs28
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'emacs28' is not installed, so not removed
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
This results in the following error
sudo dpkg -i --force-overwrite /usr/bin/emacs-gtk
dpkg-deb: error: '/usr/bin/emacs-gtk' is not a Debian format archive
dpkg: error processing archive /usr/bin/emacs-gtk (--install):
dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
/usr/bin/emacs-gtk
Run
sudo apt --fix-broken install
You will notice that you ran a different command than the one I specified:
And the terminal tells you why:
The terminal also told you to run:
This is one reason that I really prefer to use the terminal for installation and removals. It is very communicative.
Once you have run sudo apt --fix-broken install
, then please run:
sudo apt clean && sudo apt autoremove
Because you want to clean the apt cache with the above command. Once that is done, follow the edit and both commands below.
EDIT: Looking further into this, it appears there is a standing packaging error from emacs itself that can cause tangled issues. To resolve, run:
sudo apt install --reinstall libotf1 libm17n-0
Now try:
sudo apt install -y emacs28
I already tried that as I mentioned above with the errors
Sorry, I realized I wasn't being clear above.
I tried purging emacs as well as emacs-snapshot(distributed via ubuntu/elsip ppa) and emacs28 (kellyk/emacs ppa)(which failed to install after partially building)
The error message said it couldn't write in a directory as it already had stuff in it (I believe from previous emacs-snapshot(ubuntu/elisp ppa version) install)
After which All apt install/purge commands for any program result in
sudo apt remove --purge emacs
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or spec
Ah, ok. Yes, we can all get in a bit of a hurry and try to relay a lot of information while also trying to keep a post short. It's not an easy balance. What about the below?
Running
sudo apt clean && sudo apt autoremove
Gives the same error as before.
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Running the following also gives package not found and te same error as before for libotf1 and libm17n-0 respectively
sudo apt install --reinstall libotf1 libm17n-0
sudo apt install --reinstall libotf1 libm17n-0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libotf1
sudo apt install --reinstall libm17n-0
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solutin
Have you yet tried:
sudo apt install -f
sudo dpkg --configure -a
I checked on this and it appears that libotf1 was introduced in Ubuntu 22.04. That would be why it is not showing up.
The package libotf0 precedes it. I was able to locate that package as present in the Focal Repos.
I did try
Which gave
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
emacs-snapshot-common emacs28-common liblockfile-bin liblockfile1
Use 'sudo apt autoremove' to remove them.
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 22 not upgraded.
10 not fully installed or removed.
Need to get 13.3 MB of archives.
After this operation, 68.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 Index of /ubuntu focal/universe amd64 emacs-common all 1:26.3+1-1ubuntu2 [13.3 MB]
Fetched 13.3 MB in 8s (1,746 kB/s)
(Reading database ... 357629 files and directories currently installed.)
Preparing to unpack .../emacs-common_1%3a26.3+1-1ubuntu2_all.deb ...
Unpacking emacs-common (1:26.3+1-1ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all.deb (--unpack):
trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs-snapshot-common 20230720:106523-f9bbe3189b0~ubuntu20.04.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I suspect there are residuals from previous Emacs install which is preventing another install
I did not try this before,
Running which gave
`sudo dpkg --configure -a
Setting up libxapian30:amd64 (1.4.14-2) ...
Setting up m17n-db (1.8.0-3) ...
Setting up libept1.6.0:amd64 (1.1+nmu3ubuntu3) ...
Setting up libm17n-0:amd64 (1.8.0-2) ...
Setting up synaptic (0.84.6ubuntu5) ...
dpkg: dependency problems prevent configuration of emacs-el:
emacs-el depends on emacs-common (= 1:26.3+1-1ubuntu2); however:
Package emacs-common is not installed.
Version of emacs-common on system, provided by emacs28-common:all, is <none>.
dpkg: error processing package emacs-el (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of emacs-gtk:
emacs-gtk depends on emacs-common (= 1:26.3+1-1ubuntu2); however:
Package emacs-common is not installed.
Version of emacs-common on system, provided by emacs28-common:all, is <none>.
dpkg: error processing package emacs-gtk (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of emacs-bin-common:
emacs-bin-common depends on emacs-common (= 1:26.3+1-1ubuntu2); however:
Package emacs-common is not installed.
Version of emacs-common on system, provided by emacs28-common:all, is <none>.
dpkg: error processing package emacs-bin-common (--configure):
dependency problems - leaving unconfigured
Setting up emacs28-common (28.1~1.git5a223c7f2e-kk3+20.04) ...
dpkg: dependency problems prevent configuration of emacs:
emacs depends on emacs-gtk (>= 1:26.3) | emacs-lucid (>= 1:26.3) | emacs-nox (>= 1:26.3); however:
Package emacs-gtk is not configured yet.
Package emacs-lucid is not installed.
Package emacs-nox is not installed.
dpkg: error processing package emacs (--configure):
dependency problems - leaving unconfigured
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Errors were encountered while processing:
emacs-el
emacs-gtk
emacs-bin-common
emacs
I agree with your thinking. But not with your conclusion. I think you are generally correct, but that should not result in the cat and mouse game we are getting here.
I have looked into this, in trying to figure out what is tangling this so badly, which we note here:
You are not alone in having this trouble with emacs across multiple versions.
Then we also see this happen:
Frankly, I think it is the emacs packaging that is broken.
Can you please try:
sudo rm /var/cache/apt/archives/*.deb
sudo apt clean && sudo apt autoclean
And relay the result of these two commands...
Digging some more I found this post with a very similar error.
From the post I was thinking of trying
sudo dpkg -i --force-overwrite /var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all.deb
sudo apt -f install
But honestly this behavior is so bizarre that I thought seeking advice before proceeding would be wiser
Edit:
Realised you advised something similar above
Should I try force overwrite before completely removing cache?
1 Like
Each of these options is a different path with different results.
The path I offered would clean out and remove the .deb package that is giving you trouble, giving us a chance to try installing it correctly and hopefully avoid repeating this harrowing experience.
The option you quoted seeks to Force Fix the install using that .deb package, hopefully working and avoiding having to retry the install.
If you opt for your quoted option, I recommend that you check
ls /var/cache/apt/archives
And ensure that this command named package emacs-common_1%3a26.3+1-1ubuntu2_all.deb
matches what you have listed (ls) in /var/cache/apt/archives
If it does not match, then change that package in the command to match what is listed in /var/cache/apt/archives
1 Like
Running these gives does clear the cache
Clean commands don't do anything(most probably due to recently running them)
I still couldn't install additional packages
I tried running --fix-broken-install again but it stopped again giving the same error as always(pretty sure I purged broken-tape-recorder
)
And created the same file emacs-common_1%3a26.3+1-1ubuntu2_all.deb
in /var/cache/apt/archives
Here is the terminal history In case I failed to see/mention something important
ls /var/cache/apt/archives
emacs-common_1%3a26.3+1-1ubuntu2_all.deb lock partial
(base) farhaan@Linux:~$ sudo rm /var/cache/apt/archives/*.deb
(base) farhaan@Linux:~$ ls /var/cache/apt/archives
lock partial
(base) farhaan@Linux:~$ sudo apt clean && sudo apt autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
(base) farhaan@Linux:~$ sudo apt install kitty
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.3+1-1ubuntu2)
emacs-el : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
emacs-gtk : Depends: emacs-common (= 1:26.3+1-1ubuntu2)
kitty : Depends: kitty-terminfo but it is not going to be installed
Recommends: kitty-doc but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
(base) farhaan@Linux:~$ ls /var/cache/apt/archives
lock partial
(base) farhaan@Linux:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
emacs-snapshot-common emacs28-common liblockfile-bin liblockfile1
Use 'sudo apt autoremove' to remove them.
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 22 not upgraded.
4 not fully installed or removed.
Need to get 13.3 MB of archives.
After this operation, 68.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 emacs-common all 1:26.3+1-1ubuntu2 [13.3 MB]
Fetched 13.3 MB in 7s (1,891 kB/s)
(Reading database ... 357629 files and directories currently installed.)
Preparing to unpack .../emacs-common_1%3a26.3+1-1ubuntu2_all.deb ...
Unpacking emacs-common (1:26.3+1-1ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all.deb (--unpack):
trying to overwrite '/usr/include/emacs-module.h', which is also in package emacs-snapshot-common 20230720:106523-f9bbe3189b0~ubuntu20.04.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/emacs-common_1%3a26.3+1-1ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
(base) farhaan@Linux:~$ ls /var/cache/apt/archives
emacs-common_1%3a26.3+1-1ubuntu2_all.deb lock partial
(base) farhaan@Linux:~$
What is the terminal output of
sudo apt purge `dpkg --get-selections | grep emacs | cut -f1`
sudo apt purge dpkg --get-selections | grep emacs | cut -f1
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:
dictionaries-common : Depends: emacsen-common (>= 2.0.5) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Can you please confirm that you did add this repo:
You can check in Software & updates
> Other
tab.
It is near 3am my time here - I need to go into a coma for a while.