Ubuntu apt-get 出现Error 404:Not found Package Repository Errors

最近重新要在Ubuntu上安装环境,所有的apt-get都会出现“Failed to fetch 404 Not Found” 错误

Err http://archive.ubuntu.com quantal/main amd64 Packages
  404  Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com quantal/restricted amd64 Packages
  404  Not Found [IP: 91.189.91.15 80]
 
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.15 80]
 
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.91.15 80]
 
 
Err http://security.ubuntu.com raring-security/main amd64 Packages         
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/restricted amd64 Packages   
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe amd64 Packages     
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/multiverse amd64 Packages   
  404  Not Found [IP: 91.189.91.15 80]</span>

为什么会出现此类错误?

Ubuntu 更新换代很快.  你的ubuntu一旦不是最新版本后,其仓库 (repository)就会被移到另外的服务器上面。所以不再是

 http://archive.ubuntu.com/ubuntu/dist/ 这里能找到的。

如何解决?

  1. 最简单的方式是更新ubuntu到最新版本:(不一定可用,我使用还是会出现404)

sudo apt-get dist-upgrade

  1. 另外,你可以通过修改  /etc/apt/sources.list 来把链接指向旧的版本仓库:

    • 使用以下实例代码将/etc/apt/sources.list中的所有 archive.ubuntu.com  和 security.ubuntu.com替换成  old-releases.ubuntu.com

sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

  • [可选]你可以再看看有没有  /etc/apt/sources.list.d/ 这个文件,可以把这个文件一起修改。以下是修改代码:

grep -E 'archive.ubuntu.com|security.ubuntu.com' /etc/apt/sources.list.d/*

  • 然后执行更新语句:

sudo apt-get update

  • 成功!




Make Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done Build type: Release -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Success -- Performing Test COMPILER_SUPPORTS_CXX0X -- Performing Test COMPILER_SUPPORTS_CXX0X - Success -- Using flag -std=c++11. -- Found OpenCV: /usr/local (found suitable version "4.2.0", minimum required is "4.2") OPENCV VERSION: 4.2.0 CMake Warning at CMakeLists.txt:43 (find_package): By not providing "Findrealsense2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "realsense2", but CMake did not find one. Could not find a package configuration file provided by "realsense2" with any of the following names: realsense2Config.cmake realsense2-config.cmake Add the installation prefix of "realsense2" to CMAKE_PREFIX_PATH or set "realsense2_DIR" to a directory containing one of the above files. If "realsense2" provides a separate development package or SDK, be sure it has been installed. CMake Error at CMakeLists.txt:116 (add_subdirectory): add_subdirectory given source "Thirdparty/g2o" which is not an existing directory. -- Configuring incomplete, errors occurred! See also "/home/robot/XTDrone/sensing/slam/vslam/ORB_SLAM3/build/CMakeFiles/CMakeOutput.log". make: *** 没有指明目标并且找不到 makefile。 停止。 ./build.sh: 第 9 行: cd: ../../g2o: 没有那个文件或目录 Configuring and building Thirdparty/g2o ... CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. Build type: Release -- Using flag -std=c++11. OPENCV VERSION: 4.2.0 CMake Warning at CMakeLists.txt:43 (find_package): By not providing "Findrealsense2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "realsense2", but CMake did not find one. Could not find a package configuration file provided by "realsense2" with any of the following names: realsense2Config.cmake realsense2-config.cmake Add the installation prefix of "realsense2" to CMAKE_PREFIX_PATH or set "realsense2_DIR" to a directory containing one of the above files. If "realsense2" provides a separate development package or SDK, be sure it has been installed. CMake Error at CMakeLists.txt:116 (add_subdirectory): add_subdirectory given source "Thirdparty/g2o" which is not an existing directory. -- Configuring incomplete, errors occurred! See also "/home/robot/XTDrone/sensing/slam/vslam/ORB_SLAM3/build/CMakeFiles/CMakeOutput.log". make: *** 没有指明目标并且找不到 makefile。 停止。 ./build.sh: 第 18 行: cd: ../../Sophus: 没有那个文件或目录 Configuring and building Thirdparty/Sophus ... CMake Error: The source directory "/home/robot/XTDrone/sensing/slam/vslam/ORB_SLAM3/build/build" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. make: *** 没有指明目标并且找不到 makefile。 停止。 Uncompress vocabulary ... Configuring and building ORB_SLAM3 ... mkdir: 无法创建目录"build": 文件已存在 CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. Build type: Release -- Using flag -std=c++11. OPENCV VERSION: 4.2.0 CMake Warning at CMakeLists.txt:43 (find_package): By not providing "Findrealsense2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "realsense2", but CMake did not find one. Could not find a package configuration file provided by "realsense2" with any of the following names: realsense2Config.cmake realsense2-config.cmake Add the installation prefix of "realsense2" to CMAKE_PREFIX_PATH or set "realsense2_DIR" to a directory containing one of the above files. If "realsense2" provides a separate development package or SDK, be sure it has been installed. CMake Error at CMakeLists.txt:116 (add_subdirectory): add_subdirectory given source "Thirdparty/g2o" which is not an existing directory. -- Configuring incomplete, errors occurred! See also "/home/robot/XTDrone/sensing/slam/vslam/ORB_SLAM3/build/CMakeFiles/CMakeOutput.log". make: *** 没有指明目标并且找不到 makefile。 停止。
最新发布
07-12
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值