安装程序包,出现E: Unable to locate package ros-melodic-***错误

如在安装UR5e机器人驱动时出现

E: Unable to locate package ros-melodic-ur-client-library

解决方法如下:

需要替换一下/etc/apt/sources.list.d/ros-latest.list文件,同时更新一下key

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update


然后再输入安装命令

sudo apt-get install ros-melodic-ur-client-library
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cython fltk1.3-doc fluid gir1.2-geocodeglib-1.0 gir1.2-gtk-2.0 hddtemp
  libatk1.0-dev libfltk-cairo1.3 libfltk-forms1.3 libfltk-images1.3
  libfltk1.3-dev libfwup1 libgdk-pixbuf2.0-dev libgtk2.0-dev libllvm8
  libopenni-dev libopenni-sensor-pointclouds0 libopenni0 libopenni2-0
  libopenni2-dev libpango1.0-dev libpcl-apps1.8 libpcl-common1.8
  libpcl-features1.8 libpcl-filters1.8 libpcl-io1.8 libpcl-kdtree1.8
  libpcl-keypoints1.8 libpcl-ml1.8 libpcl-octree1.8 libpcl-outofcore1.8
  libpcl-people1.8 libpcl-recognition1.8 libpcl-registration1.8
  libpcl-sample-consensus1.8 libpcl-search1.8 libpcl-segmentation1.8
  libpcl-stereo1.8 libpcl-surface1.8 libpcl-tracking1.8
  libpcl-visualization1.8 libtf0d libtf2-ros0d libvtk6.3-qt libxcomposite-dev
  linux-hwe-5.4-headers-5.4.0-67 linux-hwe-5.4-headers-5.4.0-70
  linux-hwe-5.4-headers-5.4.0-72 openni-utils python-attr python-autobahn
  python-automat python-cbor python-click python-colorama python-configparser
  python-constantly python-future python-gmpy python-hyperlink
  python-incremental python-lz4 python-mpi4py python-nacl python-pam
  python-pyasn1-modules python-pyglet python-qrcode python-serial
  python-service-identity python-snappy python-trie python-twisted
  python-twisted-bin python-twisted-core python-txaio python-u-msgpack
  python-ubjson python-vtk6 python-wsaccel ros-melodic-actionlib-tutorials
  ros-melodic-bond-core ros-melodic-bondpy ros-melodic-camera-calibration
  ros-melodic-camera-info-manager ros-melodic-common-msgs
  ros-melodic-common-tutorials ros-melodic-compressed-depth-image-transport
  ros-melodic-depth-image-proc ros-melodic-desktop
  ros-melodic-diagnostic-aggregator ros-melodic-diagnostic-analysis
  ros-melodic-diagnostic-common-diagnostics ros-melodic-diagnostics
  ros-melodic-executive-smach ros-melodic-filters ros-melodic-gazebo-plugins
  ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros-pkgs
  ros-melodic-geometry ros-melodic-geometry-tutorials ros-melodic-image-common
  ros-melodic-image-pipeline ros-melodic-image-publisher
  ros-melodic-image-rotate ros-melodic-image-transport-plugins
  ros-melodic-image-view ros-melodic-interactive-marker-tutorials
  ros-melodic-kdl-parser-py ros-melodic-laser-assembler
  ros-melodic-laser-filters ros-melodic-laser-pipeline
  ros-melodic-librviz-tutorial ros-melodic-mk ros-melodic-nodelet-core
  ros-melodic-nodelet-tutorial-math ros-melodic-pcl-msgs
  ros-melodic-pluginlib-tutorials ros-melodic-polled-camera ros-melodic-robot
  ros-melodic-ros ros-melodic-ros-base ros-melodic-ros-comm
  ros-melodic-ros-core ros-melodic-ros-tutorials ros-melodic-rosbash
  ros-melodic-rosboost-cfg ros-melodic-roscpp-core
  ros-melodic-roscpp-tutorials ros-melodic-roscreate ros-melodic-roslang
  ros-melodic-roslisp ros-melodic-rosmake ros-melodic-rospy-tutorials
  ros-melodic-rviz-plugin-tutorials ros-melodic-rviz-python-tutorial
  ros-melodic-self-test ros-melodic-simulators ros-melodic-smach
  ros-melodic-smach-msgs ros-melodic-smach-ros ros-melodic-stage
  ros-melodic-stage-ros ros-melodic-stereo-image-proc ros-melodic-stereo-msgs
  ros-melodic-theora-image-transport ros-melodic-turtle-actionlib
  ros-melodic-turtle-tf ros-melodic-turtle-tf2 ros-melodic-turtlesim
  ros-melodic-urdf-parser-plugin ros-melodic-urdf-sim-tutorial
  ros-melodic-urdf-tutorial ros-melodic-vision-opencv
  ros-melodic-visualization-marker-tutorials
  ros-melodic-visualization-tutorials ros-melodic-viz sbcl tcl-vtk6
  ubuntu-web-launchers vtk6 x11proto-composite-dev
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  ros-melodic-ur-client-library
0 upgraded, 1 newly installed, 0 to remove and 341 not upgraded.
Need to get 144 kB of archives.
After this operation, 697 kB of additional disk space will be used.
Get:1 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-ur-client-library amd64 0.2.2-1bionic.20210601.153958 [144 kB]
Fetched 144 kB in 2s (78.4 kB/s)                        
Selecting previously unselected package ros-melodic-ur-client-library.
(Reading database ... 337469 files and directories currently installed.)
Preparing to unpack .../ros-melodic-ur-client-library_0.2.2-1bionic.20210601.153958_amd64.deb ...
Unpacking ros-melodic-ur-client-library (0.2.2-1bionic.20210601.153958) ...
Setting up ros-melodic-ur-client-library (0.2.2-1bionic.20210601.153958) ...

显示完成ur_client_library的安装
 

你可能感兴趣的:(ROS)