
私は自分のWSLにROS(ディストリビューションはメロディック)を適切にインストールしたこと、そして完全なパッケージを適切にダウンロードするためにすべての手順を実行したことを確実に知っていますが、コマンドラインroslaunchまたはroslaunchに関連するものを使用すると、このメッセージに戻るだけです。
Command 'roslaunch' not found, but can be installed with:
sudo apt install python-roslaunch
コマンドラインを入力すると
sudo apt install python-roslaunch
それは私を
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
python-roslaunch : Depends: python-roslib but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
python-roslib をインストールすると、上記に似た別のエラーが発生します。すべて試しました。すべてを再インストールすることから、rootf ディレクトリにあるファイルに触れることまで、これまでのところ何も機能していません。何が問題なのかを少なくとも理解するのに役立つものがあれば、ありがたいです。
答え1
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get update --fix-missing
$ sudo apt-get autoclean
$ apt-get clear cache
答え2
これらはエラーを修正するための迅速かつ簡単な方法ですyou have held broken packages
。
で、sources.list ファイルを開き
/etc/apt/sources.list
、現在使用している Ubuntu リリースとは異なる Ubuntu リリースのソフトウェア ソースがないことを確認します。sources.list に誤ったリリース行が見つかった場合は、 で source.list ファイルを開き、sudoedit /etc/apt/sources.list
文字を先頭に付けて、sources.list 内の誤った行をコメント アウトし#
、sources.list ファイルを保存して、 を実行して、sudo apt update
利用可能なソフトウェア パッケージのリストを更新します。を選択壊れたパッケージを修正するSynaptic パッケージ マネージャーのオプション。次のコマンドを実行して Synaptic をインストールします。
sudo apt update sudo apt upgrade sudo apt install synaptic
Synapticを開き、Synapticで編集->壊れたパッケージを修正するそして繰り返します編集->壊れたパッケージを修正する二度目。
Synapticの左側のペインでカスタムフィルター下のスクリーンショットでマウスカーソルでマークされているボタン。左上のリストから壊れた中央のペインには、まだ修復が必要な壊れたパッケージがリストされます。
Select the broken packages one at a time. Select a broken package, and then open the terminal and run <code>apt policy <b><package-name></b></code>. The results of this command will tell you if that broken package was installed from the default Ubuntu repositories or from some other source. If the broken package was installed from some other source, maybe that package can be removed along with its software source and replaced by a different version of the same package from the default Ubuntu repositories. Usually this means fixing a broken package by downgrading that package to an older version.
このエラー メッセージが表示された場合:
Try 'apt-get -f install' with no packages (or specify a solution)
次のコマンドを実行します。
sudo apt update sudo apt upgrade sudo apt-get -f install
破損したパッケージを手動で削除します。
パッケージを探す
/var/lib/dpkg/info
ls -l /var/lib/dpkg/info | grep <package>
パッケージ フォルダーを別の場所に移動します。
cd /tmp && sudo mkdir new-package-location sudo mv /var/lib/dpkg/info/<package>.* /tmp/new-package-location/
次のコマンドを実行します。
sudo dpkg --remove --force-remove-reinstreq <package>
これらの方法がすべて機能しない場合は、壊れたパッケージは、オペレーティングシステムに深く埋め込まれているため、これらの方法のいずれも効果がない可能性があります。この深く埋め込まれた「何か」を探す最初の明らかな場所は、のソフトウェアソースです/etc/apt/sources.list
。sources.listファイルをチェックして、壊れたパッケージエラーの原因となる可能性のある非標準の行が含まれていないかどうかを確認します。標準的なUbuntuのsources.listファイルは、のsources.listファイルのようなものです。この答え。
疑わしい行をsources.listから削除する正しい方法は、その行の前に文字を付けてコメントアウトすることです#
。その後、を実行してsudo apt update
、利用可能なソフトウェアのリストを更新します。