web-dev-qa-db-ja.com

aptパッケージを削除できません(依存関係が満たされていない)

問題の説明

この投稿 の後にtexlive 2016をインストールしようとしたときにすべてが始まりました。次のようにPPAを追加しました。

Sudo add-apt-repository ppa:jonathonf/texlive

そしてtexlive-fullをインストールしました。残念ながら、インストールがクラッシュしたため、パッケージ全体を削除して再インストールすることにしました。

最初にtexlive-fullを使用してapt-get removeを削除しようとしましたが、次のエラーが表示されます。

$ Sudo apt-get remove texlive-full
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'texlive-full' is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 dvipng : Depends: texlive-base-bin
 feynmf : Depends: texlive-latex-base but it is not going to be installed
          Depends: texlive-font-utils but it is not going to be installed
          Depends: texlive-extra-utils but it is not going to be installed
 fragmaster : Depends: texlive-base-bin
              Depends: texlive-latex-base but it is not going to be installed
              Depends: texlive-extra-utils but it is not going to be installed
              Depends: texlive-font-utils but it is not going to be installed
 kile : Depends: texlive-latex-base but it is not going to be installed
        Recommends: texlive but it is not going to be installed
 latex-beamer : Depends: texlive-latex-base but it is not going to be installed
 latexmk : Depends: texlive-latex-base but it is not going to be installed
 prosper : Depends: texlive-latex-base but it is not going to be installed
 tex4ht-common : Depends: texlive-base-bin
                 Recommends: tex4ht but it is not going to be installed
 texlive-base : Depends: luatex (>= 0.70.1) but it is not going to be installed
                Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-latex-extra : Depends: luatex but it is not going to be installed
                       Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
                       Recommends: texlive-latex-extra-doc but it is not going to be installed
 texlive-latex-recommended : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                             Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-luatex : Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
                  Depends: luatex (>= 0.70.1) but it is not going to be installed
 texlive-math-extra : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                      Depends: texlive-fonts-recommended (>= 2013.20130512) but it is not going to be installed
                      Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-metapost : Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-pictures : Depends: luatex but it is not going to be installed
                    Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-pstricks : Depends: texlive-generic-recommended (>= 2013.20130512) but it is not going to be installed
                    Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
                    Recommends: texlive-font-utils but it is not going to be installed
                    Recommends: texlive-extra-utils but it is not going to be installed
 texlive-science : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                   Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-xetex : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                 Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 tipa : Depends: texlive-latex-base but it is not going to be installed
        Depends: texlive-base-bin
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

私は'apt-get -f installを試しましたが、これは私が得るものです:

$ Sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  luatex texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc
  texlive-generic-recommended texlive-latex-base
The following packages will be REMOVED:
  context
The following NEW packages will be installed:
  luatex texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc
  texlive-generic-recommended texlive-latex-base
0 upgraded, 8 newly installed, 1 to remove and 20 not upgraded.
1 not fully installed or removed.
Need to get 0 B/30,2 MB of archives.
After this operation, 9.608 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 1326901 files and directories currently installed.)
Removing context (2016.05.17.20160523-1~ubuntu14.04.1york0) ...
unknown option: format
dpkg: error processing package context (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 context
E: Sub-process /usr/bin/dpkg returned an error code (1)

同様に、Sudo apt-get install --reinstall texlive-fullE: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).メッセージで失敗します

これがすべて失敗した後、私は試しました:

Sudo rm /var/lib/dpkg/info/texlive-*
Sudo dpkg --configure -a
Sudo apt-get update
Sudo apt-get install textlive-full

しかし、まだ次のエラーが表示されます。

$ Sudo apt-get install texlive-full
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 dvipng : Depends: texlive-base-bin
 feynmf : Depends: texlive-latex-base but it is not going to be installed
      Depends: texlive-font-utils but it is not going to be installed
      Depends: texlive-extra-utils but it is not going to be installed
 fragmaster : Depends: texlive-base-bin
          Depends: texlive-latex-base but it is not going to be installed
          Depends: texlive-extra-utils but it is not going to be installed
          Depends: texlive-font-utils but it is not going to be installed
 kile : Depends: texlive-latex-base but it is not going to be installed
    Recommends: texlive but it is not going to be installed
 latex-beamer : Depends: texlive-latex-base but it is not going to be installed
 latexmk : Depends: texlive-latex-base but it is not going to be installed
 prosper : Depends: texlive-latex-base but it is not going to be installed
 tex4ht-common : Depends: texlive-base-bin
             Recommends: tex4ht but it is not going to be installed
 texlive-base : Depends: luatex (>= 0.70.1) but it is not going to be installed
            Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-full : Depends: texlive-lang-polish (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-generic-extra (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-indic (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-spanish (>= 2013.20130512) but it is not going to be installed
            Depends: latex-sanskrit but it is not going to be installed
            Depends: texlive-omega (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-cyrillic (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-humanities-doc (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-english (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-latex-extra-doc (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-european (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-publishers-doc (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-african (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-portuguese (>= 2013.20130512) but it is not going to be installed
            Depends: tex4ht (>= 20051214) but it is not going to be installed
            Depends: texlive-fonts-extra (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-fonts-recommended-doc (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-italian (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-extra-utils (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-bibtex-extra (>= 2013.20130512) but it is not going to be installed
            Depends: latex-cjk-all (>= 4.6.0+cvs20060714-2) but it is not going to be installed
            Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-font-utils (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-fonts-recommended (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-french (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-german (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-arabic (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-fonts-extra-doc (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-plain-extra (>= 2013.20130512) but it is not going to be installed
            Depends: cm-super (>= 0.3.3-3) but it is not going to be installed
            Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-music (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-generic-recommended (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-formats-extra (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-humanities (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-publishers (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-games (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-greek (>= 2013.20130512) but it is not going to be installed
            Depends: context but it is not going to be installed
            Depends: lcdf-typetools but it is not going to be installed
            Depends: texlive-lang-czechslovak (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-cjk (>= 2013.20130512) but it is not going to be installed
            Depends: texlive-lang-other (>= 2013.20130512) but it is not going to be installed
 texlive-latex-extra : Depends: luatex but it is not going to be installed
                       Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
                       Recommends: texlive-latex-extra-doc but it is not going to be installed
 texlive-latex-recommended : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                             Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-luatex : Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
                  Depends: luatex (>= 0.70.1) but it is not going to be installed
 texlive-math-extra : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                      Depends: texlive-fonts-recommended (>= 2013.20130512) but it is not going to be installed
                      Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-metapost : Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-pictures : Depends: luatex but it is not going to be installed
                    Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-pstricks : Depends: texlive-generic-recommended (>= 2013.20130512) but it is not going to be installed
                    Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
                    Recommends: texlive-font-utils but it is not going to be installed
                    Recommends: texlive-extra-utils but it is not going to be installed
 texlive-science : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                   Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 texlive-xetex : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
                 Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
 tipa : Depends: texlive-latex-base but it is not going to be installed
        Depends: texlive-base-bin
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Ubuntu 14.04 LTSを使用しています。

その他の問題

問題は、何もインストールできないことです。例えば:

$ Sudo apt-get install travis
[Sudo] password for chung: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  cp2k gnuplot pymol grace
The following packages will be REMOVED:
  context
The following NEW packages will be installed:
  travis
0 upgraded, 1 newly installed, 1 to remove and 36 not upgraded.
1 not fully installed or removed.
Need to get 793 kB of archives.
After this operation, 66,0 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://ftp.belnet.be/ubuntu.com/ubuntu/ trusty/universe travis AMD64 140117-1 [793 kB]
Fetched 793 kB in 1s (452 kB/s) 
dpkg: warning: files list file for package 'texlive-science-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-science' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-metapost' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-base-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-math-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pstricks' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-recommended' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-recommended-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pictures-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pictures' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pstricks-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-luatex' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-metapost-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-base' missing; assuming package has no files currently installed
(Reading database ... 1349546 files and directories currently installed.)
Removing context (2016.05.17.20160523-1~ubuntu14.04.1york0) ...
unknown option: format
dpkg: error processing package context (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 context
E: Sub-process /usr/bin/dpkg returned an error code (1)

これを試しました ソリューション

パート1

走った

Sudo apt-get clean
Sudo apt-get autoclean
Sudo apt-get -f install

最後のコマンドでは、次のメッセージが表示されます。

$ Sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  context
0 upgraded, 0 newly installed, 1 to remove and 41 not upgraded.
1 not fully installed or removed.
After this operation, 68,2 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: warning: files list file for package 'texlive-metapost' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-base-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-math-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pstricks' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-recommended' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-recommended-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pictures-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pictures' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pstricks-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-luatex' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-metapost-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-base' missing; assuming package has no files currently installed
(Reading database ... 1349546 files and directories currently installed.)
Removing context (2016.05.17.20160523-1~ubuntu14.04.1york0) ...
unknown option: format
dpkg: error processing package context (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 context
E: Sub-process /usr/bin/dpkg returned an error code (1)

次にSudo dpkg --configure -aをもう一度実行し、Sudo apt -f installを実行しましたが、何も変更されず、dist-upgradeが上記のエラーを再生します。

上記と同じエラーメッセージで終了するSudo apt-get -o Debug::pkgProblemResolver=yes dist-upgradeを試しました。

パート2

aptを使用してppa-purgeをインストールできなかったため、次を実行して手動でインストールしました。

mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && Sudo dpkg -i ./*.deb

その後、そもそも問題の原因となったPPAを削除しました。私が走った:

Sudo apt-get autoremove --purge texlive*

そして、私はこれらのエラーメッセージを受け取りました:

The following packages have unmet dependencies:
 aptitude:i386 : Depends: libapt-pkg4.12:i386 (>= 0.8.16~exp12ubuntu6) but it is not going to be installed
                 Depends: libboost-iostreams1.46.1:i386 (>= 1.46.1-1) but it is not installable
                 Depends: libcwidget3:i386 but it is not going to be installed
                 Depends: libept1.4.12:i386 but it is not going to be installed
                 Depends: libsigc++-2.0-0c2a:i386 (>= 2.0.2) but it is not going to be installed
                 Depends: libxapian22:i386 but it is not going to be installed
                 Recommends: apt-xapian-index:i386 but it is not installable
                 Recommends: libparse-debianchangelog-Perl:i386 but it is not installable
 dvipng : Depends: texlive-base-bin
 feynmf : Depends: texlive-latex-base but it is not going to be installed
          Depends: texlive-font-utils but it is not going to be installed
          Depends: texlive-extra-utils but it is not going to be installed
 fragmaster : Depends: texlive-base-bin
              Depends: texlive-latex-base but it is not going to be installed
              Depends: texlive-latex-recommended but it is not going to be installed
              Depends: texlive-extra-utils but it is not going to be installed
              Depends: texlive-font-utils but it is not going to be installed
 kile : Depends: texlive-latex-base but it is not going to be installed
        Recommends: texlive but it is not going to be installed
 latex-beamer : Depends: texlive-latex-base but it is not going to be installed
 latex-xcolor : Depends: texlive-latex-recommended but it is not going to be installed
 latexmk : Depends: texlive-latex-base but it is not going to be installed
 pgf : Depends: texlive-latex-recommended but it is not going to be installed
 ppa-purge : Depends: aptitude but it is not going to be installed
 prosper : Depends: texlive-latex-base but it is not going to be installed
           Depends: texlive-pstricks but it is not going to be installed
           Depends: texlive-latex-recommended but it is not going to be installed
 purifyeps : Depends: texlive-metapost but it is not going to be installed
 tex4ht-common : Depends: texlive-base-bin
                 Recommends: tex4ht but it is not going to be installed
 tipa : Depends: texlive-latex-base but it is not going to be installed
        Depends: texlive-base-bin
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

次に:

Sudo add-apt-repository --remove ppa:jonathonf/texlive
Sudo apt-get autoclean

これらのコマンドではエラーは発生しませんでした。

ただし、上記の手順では問題は解決しませんでした。 Sudo apt -f installの出力は次のとおりです。

$ Sudo apt -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  aptitude aptitude-common libcwidget3 libept1.4.12
Suggested packages:
  aptitude-doc-en aptitude-doc tasksel debtags libcwidget-dev
The following packages will be REMOVED:
  aptitude:i386 context
The following NEW packages will be installed:
  aptitude aptitude-common libcwidget3 libept1.4.12
0 upgraded, 4 newly installed, 2 to remove and 42 not upgraded.
3 not fully installed or removed.
Need to get 2.520 kB of archives.
After this operation, 64,8 MB disk space will be freed.
Do you want to continue? [Y/n] 
Get:1 http://ftp.belnet.be/ubuntu.com/ubuntu/ trusty/main aptitude-common all 0.6.8.2-1ubuntu4 [700 kB]
Get:2 http://ftp.belnet.be/ubuntu.com/ubuntu/ trusty/main libcwidget3 AMD64 0.5.16-3.5ubuntu1 [307 kB]
Get:3 http://ftp.belnet.be/ubuntu.com/ubuntu/ trusty/main libept1.4.12 AMD64 1.0.12 [142 kB]
Get:4 http://ftp.belnet.be/ubuntu.com/ubuntu/ trusty/main aptitude AMD64 0.6.8.2-1ubuntu4 [1.371 kB]
Fetched 2.520 kB in 1s (1.752 kB/s) 
dpkg: warning: files list file for package 'texlive-metapost' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-base-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-math-extra' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pstricks' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-recommended' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-latex-recommended-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pictures-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pictures' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-pstricks-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-luatex' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-metapost-doc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'texlive-base' missing; assuming package has no files currently installed
(Reading database ... 1349665 files and directories currently installed.)
Removing aptitude (0.6.6-1ubuntu1) ...
Removing context (2016.05.17.20160523-1~ubuntu14.04.1york0) ...
unknown option: format
dpkg: error processing package context (--remove):
 subprocess installed post-removal script returned error exit status 1
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Errors were encountered while processing:
 context
E: Sub-process /usr/bin/dpkg returned an error code (1)

私の適切なソース

これ/etc/apt/sources.listの内容であり、 これらは私のPPAですcat /etc/apt/sources.list.d/*の出力)

2

壊れたカーネル4.14.36および4.14.37を修正しなければならないという今日の頭痛の種は、シンボリックリンクエラーのため削除できませんでした。

このQ&Aを参照: 不明なオプションで破損したPPAパッケージを削除 、ただし「チート」メソッドに従って、ファイル/var/lib/dpkg/info/context.postrmを編集し、次の行の後:

#!/bin/sh

行を挿入

exit 0

ファイルを保存して使用します:

Sudo apt install -f

エラーなしで実行されるはずです。

2