Ubuntu 16.04にEmacs25パッケージをインストール中にエラーが発生しました。

Ubuntu 16.04にEmacs25パッケージをインストール中にエラーが発生しました。

Ubuntu 16.04にEmacs 24とEmacs-snapshot(現在のEmacs 27.0.50)でEmacs25パッケージをインストールしようとしています。

次のコマンドを実行しました。

sudo add-apt-repository ppa:kelleyk/emacs 
sudo apt-get update 

その後を追って走った

sudo apt install emacs25

その中でこれを受けました。

user@user-desktop:$ sudo apt install emacs25
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  emacs25-common
The following NEW packages will be installed:
  emacs25 emacs25-common
0 upgraded, 2 newly installed, 0 to remove and 132 not upgraded.
Need to get 0 B/21.0 MB of archives.
After this operation, 90.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 298195 files and directories currently installed.)
Preparing to unpack .../emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb ...
Unpacking emacs25-common (92792-c3ff671-emacs-25.2~ubuntu16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb (--unpack):
 trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs-snapshot-common 20190326:96618-9a6cba2~ubuntu16.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package emacs25.
Preparing to unpack .../emacs25_92792-c3ff671-emacs-25.2~ubuntu16.04.1_amd64.deb ...
Unpacking emacs25 (92792-c3ff671-emacs-25.2~ubuntu16.04.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for install-info (6.1.0.dfsg.1-5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

この問題をどのように解決できますか?

ベストアンサー1

引用した出力で次のエラーメッセージを使用してこの問題を解決できます。

Unpacking emacs25-common (92792-c3ff671-emacs-25.2~ubuntu16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/emacs25-common_92792-c3ff671-emacs-25.2~ubuntu16.04.1_all.deb (--unpack):
 trying to overwrite '/usr/share/emacs/site-lisp/subdirs.el', which is also in package emacs-snapshot-common 20190326:96618-9a6cba2~ubuntu16.04.1

emacs-snapshot-commonと両方がemacs25-common含まれているため、インストールに失敗しました/usr/share/emacs/site-lisp/subdirs.el

これにはいくつかの方法がありますが、Emacsパッケージ名にバージョン番号が含まれていますが、一緒にインストールするように設計されていないことを検討してください。 (実際には、Debian 10 と Ubuntu 18.10 以降、パッケージ名にはバージョン番号は含まれません。)

この問題を解決する最もきれいな方法は、ファイルのパッケージコピーの1つ(アーカイブしたいemacs25コピーなど)を転送することです。

sudo dpkg-divert --package emacs25 --divert /usr/share/emacs/site-lisp/subdirs.el.moved --rename /usr/share/emacs/site-lisp/subdirs.el

(構文はやや直観に反しています。dpkg-divertマンページ詳細はこちら)。これにより、他のパッケージによってsubdirs.el提供されるバージョンの名前が 。emacs25subdirs.el.moved

おすすめ記事