ROS のインストールで発生したエラーと解決策

报错1 パッケージ 'python-rosinstall' にはインストール候補がありません

E: Package 'python-rosinstall' has no installation candidate
E: Package 'python-rosinstall-generator' has no installation candidate
E: Package 'python-wstool' has no installation candidate
yyq@ubuntu:~$ sudo apt-get install python-wstool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-wstool is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-wstool

E: Package 'python-wstool' has no installation candidate

エラーの理由は現在python3のバージョンがサポートされているためで、
解決策は各コマンドにpython3を持ってくることです

yyq@ubuntu:~$ sudo apt-get install python3-rosinstall -y //安装成功
yyq@ubuntu:~$ sudo apt-get install python3-rosinstall-generator -y //安装成功
yyq@ubuntu:~$ sudo apt-get install python3-wstool -y //安装成功

报错2 bash: /opt/ros/melodic/setup.bash: そのようなファイルやディレクトリはありません

yyq@ubuntu:~$ source ~/.bashrc
bash: /opt/ros/melodic/setup.bash: No such file or directory
bash: /opt/ros/neotic/setup.bash: No such file or directory

解決策
ここに入力して、gedit .bashrc現在のパスに .bashrc ファイルが存在するかどうかを判断します.存在する場合は、このコマンドを使用できます.そうでない場合は、前に.bashrc絶対パスを追加します.

エラー 3

apt-get /var/lib/dpkg/lock-frontend

ソリューション
ubuntu を再起動します

报错4 問題を解決できません。破損したパッケージを保持しています。

yyq@ubuntu:~$ sudo apt install catkin
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:
 catkin : Depends: python3-catkin-pkg (>= 0.4.14-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

エラーの理由は、catkin をインストールするときに、ros のバージョン名を指定する必要があるためです。

解決

yyq@ubuntu:~$ sudo apt install ros-noetic-catkin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-noetic-catkin is already the newest version (0.8.10-1focal.20210423.221558).
ros-noetic-catkin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

报错5 rosbash : 依存: catkin ですが、インストールされる予定はありません

rosbash : Depends: catkin but it is not going to be installed

解決策
sudo apt install ros-noetic-rosbash//ここでの私のバージョンは noetic です。異なるバージョンには独自のバージョン名が入ります

おすすめ

転載: blog.csdn.net/m0_61780496/article/details/129912943