GNU/Linux >> Linux の 問題 >  >> Ubuntu

Studio 12.04でのOpencvインストールの問題–依存関係の破損?

この質問にはすでに回答があります :PPAを追加した後、満たされていない依存関係を解決するにはどうすればよいですか?

(14の回答)
7年前に閉鎖されました。

問題:

OpenCV(ビデオ分析)をインストールしようとしていますが、UbuntuOpenCVのインストールドキュメントに従っています。

提供されたスクリプトには、しばらくの間実行された行があり、予想よりも多くのパッケージ(ubuntu-studioビデオなど)が削除されています:

sudo apt-get -qq remove ffmpeg x264 libx264-dev

スクリプトが以下の行に到達すると、爆弾が発生します:

sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg

エラーメッセージは次のとおりです。

E: Unable to correct problems, you have held broken packages.

試みられた解決策:

最初にUpdate-Managerを実行し、sudo apt-get updateを実行しました 、再起動し、上記のスクリプト行を手動で実行しようとしましたが、変更はありません。

その後、次の回答に従いました:

  • PPAを追加した後、満たされていない依存関係を解決するにはどうすればよいですか?

sudo apt-get install -fを実行しました 何も変わっていないようでした。一部のパッケージは不要になり、apt-get autoremoveで削除できると記載されていました。 、だから私はそれを実行しました。いくつかのパッケージが削除されたので、installを再実行しました 上記のコマンド。壊れたパッケージを保持するのと同じ問題。

次に、sudo apt-get -u dist-upgradeを実行しました。 、結果の応答の一部は次のとおりです。

The following packages have been kept back: gstreamer0.10-ffmpeg

それが何を意味するのかわかりません。 Update-Managerに表示され、確認できないことは知っています。

その後、実行しました

sudo dpkg --configure -a

その後、再実行しました

sudo apt-get -f install

この非常に興味深いコメントがありましたが、パッケージはまだアップグレードされていませんでした。

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gstreamer0.10-ffmpeg : Depends: libavcodec53 (< 5:0) but it is not going to be installed or
                                 libavcodec-extra-53 (< 5:0) but 5:0.7.2-1ubuntu1+codecs1~oneiric2 is to be installed
E: Unable to correct problems, you have held broken packages.

それから私は走りました

sudo apt-get -u dist-upgrade

保持されているパッケージが1つあることが示されたので、実行しました

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade

パッケージをアップグレードせずに終了したので、実行しました

sudo apt-get remove --dry-run gstreamer0.10-ffmpeg:i386

そしてそれは私に与えました:

*The following packages will be REMOVED:
  arista gstreamer0.10-ffmpeg
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Remv arista [0.9.7-3ubuntu1]
Remv gstreamer0.10-ffmpeg [0.10.12-1ubuntu1]*

しかし、私が再実行したとき

sudo apt-get -u dist-upgrade

パッケージがまだそこにあることを示しました。

*The following packages have been kept back:
  gstreamer0.10-ffmpeg
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.*

その後、Synaptic PMに入り、gstreamer0.10-ffmpegを完全に削除しました 。

再実行

sudo apt-get -u dist-upgrade

そして言われた

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

ただし、元のapt-getを実行すると opencvをインストールするコマンド(この質問の先頭にある最初のコード)でも、同じ壊れたパッケージエラーが発生しました。

だから私は試しました:

$ cat /etc/apt/sources.list
# 

# deb cdrom:[Ubuntu-Studio 11.10 _Oneiric Ocelot_ - Release i386 (20111011.1)]/ oneiric main multiverse restricted universe

# deb cdrom:[Ubuntu-Studio 11.10 _Oneiric Ocelot_ - Release i386 (20111011.1)]/ oneiric main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free license. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu oneiric partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu oneiric main
# deb-src http://extras.ubuntu.com/ubuntu oneiric main
# deb http://download.opensuse.org/repositories/home:/popinet/xUbuntu_11.04 ./ # disabled on upgrade to precise

その後、私は走りました:

$ sudo apt-get check
Reading package lists... Done
Building dependency tree       
Reading state information... Done

ただし、次のコマンドを使用してOpenCVのインストールを実行しようとすると、同じ壊れたパッケージメッセージが表示されるため、問題はまだ解決されていません。

sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg

次に実行しました:

$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Del linux-generic 3.2.0.55.65 [1,714 B]
Del linux-libc-dev 3.2.0-54.82 [858 kB]
Del initramfs-tools-bin 0.99ubuntu13.2 [9,758 B]
Del firefox-globalmenu 24.0+build1-0ubuntu0.12.04.1 [8,958 B]
Del apport 2.0.1-0ubuntu17.5 [147 kB]
Del firefox-locale-en 24.0+build1-0ubuntu0.12.04.1 [578 kB]
Del thunderbird-locale-en-gb 1:24.0+build1-0ubuntu0.12.04.1 [14.0 kB]
Del linux-libc-dev 3.2.0-55.85 [860 kB]
Del thunderbird-globalmenu 1:24.0+build1-0ubuntu0.12.04.1 [8,782 B]
Del apport-gtk 2.0.1-0ubuntu17.5 [9,200 B]
Del thunderbird 1:24.0+build1-0ubuntu0.12.04.1 [29.3 MB]
Del firefox 24.0+build1-0ubuntu0.12.04.1 [28.1 MB]
Del thunderbird-locale-en-us 1:24.0+build1-0ubuntu0.12.04.1 [14.0 kB]
Del linux-image-generic 3.2.0.54.64 [2,262 B]
Del linux-headers-generic 3.2.0.55.65 [2,244 B]
Del linux-image-generic 3.2.0.55.65 [2,260 B]
Del python-apport 2.0.1-0ubuntu17.5 [81.1 kB]
Del initramfs-tools 0.99ubuntu13.2 [49.2 kB]
Del linux-headers-generic 3.2.0.54.64 [2,258 B]
Del linux-headers-lowlatency-pae 3.2.0.55.44 [2,256 B]
Del linux-headers-lowlatency-pae 3.2.0.54.43 [2,250 B]
Del thunderbird-locale-en 1:24.0+build1-0ubuntu0.12.04.1 [342 kB]
Del python-problem-report 2.0.1-0ubuntu17.5 [9,466 B]
Del procps 1:3.2.8-11ubuntu6.2 [225 kB]
Del linux-generic 3.2.0.54.64 [1,722 B]

しかし、OpenCVインストールコマンドを実行すると、次のようになります。

E: Unable to correct problems, you have held broken packages.

そこで、ほぼ完全に最初からやり直しました。今回は、Preciseへのアップグレードが無効になっているリポジトリを追加し直しました。

関連:「upowerd [4116]:未処理のアクション「バインド」」メッセージがsyslogをいっぱいにしますか?

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

$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done

$ sudo apt-get clean

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-gudev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  python-gudev
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 106 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 614874 files and directories currently installed.)
Removing python-gudev ...
Processing triggers for python-support ...

$ sudo dpkg --configure -a

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ sudo apt-get -u dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ cat /etc/apt/sources.list.d/*

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/earth/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/earth/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/earth/deb/ stable main
# deb http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu precise main # disabled on upgrade to precise
# deb-src http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu precise main # disabled on upgrade to precise
deb http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu oneiric main
deb-src http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu oneiric main
# deb http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu precise main # disabled on upgrade to precise
# deb-src http://ppa.launchpad.net/kxstudio-team/ppa/ubuntu precise main # disabled on upgrade to precise
## Please report any bug on https://bugs.launchpad.net/medibuntu/
# deb http://packages.medibuntu.org/ precise free non-free #Medibuntu - Ubuntu 11.10 "oneiric ocelot" disabled on upgrade to precise
# deb-src http://packages.medibuntu.org/ oneiric free non-free #Medibuntu (source) - Ubuntu 11.10 "oneiric ocelot"
## Please report any bug on https://bugs.launchpad.net/medibuntu/
deb http://packages.medibuntu.org/ oneiric free non-free #Medibuntu - Ubuntu 11.10 "oneiric ocelot"
#deb-src http://packages.medibuntu.org/ oneiric free non-free #Medibuntu (source) - Ubuntu 11.10 "oneiric ocelot"
## Please report any bug on https://bugs.launchpad.net/medibuntu/
# deb http://packages.medibuntu.org/ precise free non-free #Medibuntu - Ubuntu 11.10 "oneiric ocelot" disabled on upgrade to precise
# deb-src http://packages.medibuntu.org/ oneiric free non-free #Medibuntu (source) - Ubuntu 11.10 "oneiric ocelot"
# deb http://www.openfoam.org/download/ubuntu precise main # disabled on upgrade to precise
deb http://www.openfoam.org/download/ubuntu oneiric main
# deb http://www.openfoam.org/download/ubuntu precise main # disabled on upgrade to precise
deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main

結果:

しかし、OpenCVインストールコマンドを実行しようとすると、このエラーが発生します:

E: Unable to correct problems, you have held broken packages.

他に何をする必要がありますか?

関連:bash:=:そのようなファイルまたはディレクトリはありません.bashrc?

Ubuntu Studio 13.xxにアップグレードすると、この問題は解決しますか(または複雑になりますか)?

承認された回答:

わかりました、私はあなたと同じ問題で実行しました(ただし別のパッケージで)。したがって、安価な解決策として、apt-getの代わりに 使用適性:

sudo apt-get install aptitude
sudo aptitude install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg

私の場合、依存関係の解決策を提供します:

The following actions will resolve these dependencies:

      Remove the following packages:                       
1)      libcupsimage2-dev                                  
2)      libsane-dev                                        
3)      libtiff5-dev                                       

      Keep the following packages at their current version:
4)      libcv-dev [Not Installed]                          
5)      libcvaux-dev [Not Installed]                       
6)      libhighgui-dev [Not Installed]                     
7)      libopencv-contrib-dev [Not Installed]              
8)      libopencv-dev [Not Installed]                      
9)      libopencv-highgui-dev [Not Installed]              
10)     libopencv-legacy-dev [Not Installed]               
11)     libopencv-objdetect-dev [Not Installed]            
12)     libopencv-videostab-dev [Not Installed]         

与えられた解決策を受け入れました。Nを選択できます 解決策が破壊的すぎる場合(私の場合は-devでした もう使用しない可能性が高いパッケージですが、確認する必要があります )。次に、インストールコマンドを再実行しましたが、すべて問題ありませんでした。


Ubuntu
  1. Ubuntu 16.04フレッシュインストール後に壊れたパッケージ?

  2. 問題を引き起こすゲスト追加をインストールしますか?

  3. Apt-getを使用してコマンドラインからパッケージのリストをインストール/削除しますか?

  1. Ubuntu 20.04/21.10にOBSStudio27.2をインストールする方法

  2. Ubuntu 20.04にOpenCVをインストールするにはどうすればいいですか?

  3. apt-get を使用してローカルの .deb パッケージをインストールする方法

  1. Ubuntu18.04にOpenCVをインストールする方法

  2. 壊れたパッケージを修正する方法は?

  3. Valgrind –壊れたパッケージの保持に問題がありますか?