Ubuntu18.04 下载和安装package/library时报错及解决方法汇总

在Ubuntu系统里面下载和安装一些库和包总是报各种各样的错误,记录一下:

  1. apt-get install安装包时报错
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

删除锁定文件,然后重新run一次指令就好

sudo rm /var/lib/dpkg/lock-frontend

sudo rm /var/lib/dpkg/lock
  1. rosdep install --from-paths src --ignore-src -r -y安装依赖项时报错
After this operation, 652 kB of additional disk space will be used.
Err:1 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-rosserial-client amd64 0.8.0-0bionic.20210921.215203
  404  Not Found [IP: 64.50.236.52 80]
Err:2 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-rosserial-python amd64 0.8.0-0bionic.20210921.203044
  404  Not Found [IP: 64.50.236.52 80]
Err:3 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-rosserial amd64 0.8.0-0bionic.20210921.220548
  404  Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-rosserial-client/ros-melodic-rosserial-client_0.8.0-0bionic.20210921.215203_amd64.deb  404  Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-rosserial-python/ros-melodic-rosserial-python_0.8.0-0bionic.20210921.203044_amd64.deb  404  Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-melodic-rosserial/ros-melodic-rosserial_0.8.0-0bionic.20210921.220548_amd64.deb  404  Not Found [IP: 64.50.236.52 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: the following rosdeps failed to install
  apt: command [sudo -H apt-get install -y ros-melodic-apriltag] failed
  apt: command [sudo -H apt-get install -y ros-melodic-joint-state-publisher-gui] failed
  apt: command [sudo -H apt-get install -y ros-melodic-robot-localization] failed
  apt: command [sudo -H apt-get install -y ros-melodic-teleop-twist-keyboard] failed
  apt: command [sudo -H apt-get install -y ros-melodic-imu-transformer] failed
  apt: command [sudo -H apt-get install -y ros-melodic-rosserial] failed
  apt: Failed to detect successful installation of [ros-melodic-apriltag]
  apt: Failed to detect successful installation of [ros-melodic-joint-state-publisher-gui]
  apt: Failed to detect successful installation of [ros-melodic-robot-localization]
  apt: Failed to detect successful installation of [ros-melodic-teleop-twist-keyboard]
  apt: Failed to detect successful installation of [ros-melodic-imu-transformer]
  apt: Failed to detect successful installation of [ros-melodic-rosserial]

这个只需要更新一下apt-get就行了

sudo apt-get update

你可能感兴趣的:(Ubuntu,ubuntu)