参考:

Docker containers can't resolve DNS on Ubuntu 14.04 Desktop Host

Unable to locate package错误解决办法

问题:

运行:

  1. make -f docker.mk base-docker-image

时,出现如下错误:

  1. Sending build context to Docker daemon 9.728 kB
  2. Step 1/25 : FROM ubuntu:14.04
  3. ---> b969ab9f929b
  4. Step 2/25 : RUN apt-get update
  5. ---> Running in 652b2dccd5a0
  6. Err http://archive.ubuntu.com trusty InRelease
  7. Err http://archive.ubuntu.com trusty-updates InRelease
  8. Err http://archive.ubuntu.com trusty-security InRelease
  9. Err http://archive.ubuntu.com trusty Release.gpg
  10. Could not resolve 'archive.ubuntu.com'
  11. Err http://archive.ubuntu.com trusty-updates Release.gpg
  12. Could not resolve 'archive.ubuntu.com'
  13. Err http://archive.ubuntu.com trusty-security Release.gpg
  14. Could not resolve 'archive.ubuntu.com'
  15. Reading package lists...
  16. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease
  17. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease
  18. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/InRelease
  19. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'archive.ubuntu.com'
  20. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'archive.ubuntu.com'
  21. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'archive.ubuntu.com'
  22. W: Some index files failed to download. They have been ignored, or old ones used instead.
  23. ---> 9f577de31291
  24. Removing intermediate container 652b2dccd5a0
  25. Step 3/25 : RUN apt-get install -y automake autopoint bison bridge-utils build-essential cmake ethtool flex g++ gdb git libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libedit-dev libev-dev libevent-dev libffi-dev libglib2.0-dev libgmp-dev libhiredis-dev libjson0 libjson0-dev libjudy-dev libnl-route-3-dev libpcap0.8 libpcap0.8-dev libpcap-dev libtool libssl-dev mktemp openssh-server packit pkg-config python-dev python-pip python-pygraph python-pygraphviz python-setuptools python-texttable python-thrift python-yaml quagga redis-server redis-tools subversion tcpdump texinfo tshark valgrind vim xterm
  26. ---> Running in 21e5ad980543
  27. Reading package lists...
  28. Building dependency tree...
  29. Reading state information...
  30. Package mktemp is not available, but is referred to by another package.
  31. This may mean that the package is missing, has been obsoleted, or
  32. is only available from another source
  33. However the following packages replace it:
  34. coreutils
  35. Package vim is not available, but is referred to by another package.
  36. This may mean that the package is missing, has been obsoleted, or
  37. is only available from another source
  38. E: Unable to locate package automake
  39. E: Unable to locate package autopoint
  40. E: Unable to locate package bison
  41. E: Unable to locate package bridge-utils
  42. E: Unable to locate package build-essential
  43. E: Unable to locate package cmake
  44. E: Unable to locate package ethtool
  45. E: Unable to locate package flex
  46. E: Unable to locate package gdb
  47. E: Unable to locate package git
  48. E: Unable to locate package libboost-dev
  49. E: Unable to locate package libboost-filesystem-dev
  50. E: Unable to locate package libboost-program-options-dev
  51. E: Unable to locate package libboost-system-dev
  52. E: Unable to locate package libboost-test-dev
  53. E: Unable to locate package libboost-thread-dev
  54. E: Unable to locate package libedit-dev
  55. E: Unable to locate package libev-dev
  56. E: Unable to locate package libevent-dev
  57. E: Unable to locate package libffi-dev
  58. E: Unable to locate package libglib2.0-dev
  59. E: Couldn't find any package by regex 'libglib2.0-dev'
  60. E: Unable to locate package libgmp-dev
  61. E: Unable to locate package libhiredis-dev
  62. E: Unable to locate package libjson0-dev
  63. E: Unable to locate package libjudy-dev
  64. E: Unable to locate package libnl-route-3-dev
  65. E: Unable to locate package libpcap0.8
  66. E: Couldn't find any package by regex 'libpcap0.8'
  67. E: Unable to locate package libpcap0.8-dev
  68. E: Couldn't find any package by regex 'libpcap0.8-dev'
  69. E: Unable to locate package libpcap-dev
  70. E: Unable to locate package libtool
  71. E: Unable to locate package libssl-dev
  72. E: Package 'mktemp' has no installation candidate
  73. E: Unable to locate package openssh-server
  74. E: Unable to locate package packit
  75. E: Unable to locate package pkg-config
  76. E: Unable to locate package python-dev
  77. E: Unable to locate package python-pip
  78. E: Unable to locate package python-pygraph
  79. E: Unable to locate package python-pygraphviz
  80. E: Unable to locate package python-setuptools
  81. E: Unable to locate package python-texttable
  82. E: Unable to locate package python-thrift
  83. E: Unable to locate package python-yaml
  84. E: Unable to locate package quagga
  85. E: Unable to locate package redis-server
  86. E: Unable to locate package redis-tools
  87. E: Unable to locate package subversion
  88. E: Unable to locate package tcpdump
  89. E: Unable to locate package texinfo
  90. E: Unable to locate package tshark
  91. E: Unable to locate package valgrind
  92. E: Package 'vim' has no installation candidate
  93. E: Unable to locate package xterm
  94. The command '/bin/sh -c apt-get install -y automake autopoint bison bridge-utils build-essential cmake ethtool flex g++ gdb git libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libedit-dev libev-dev libevent-dev libffi-dev libglib2.0-dev libgmp-dev libhiredis-dev libjson0 libjson0-dev libjudy-dev libnl-route-3-dev libpcap0.8 libpcap0.8-dev libpcap-dev libtool libssl-dev mktemp openssh-server packit pkg-config python-dev python-pip python-pygraph python-pygraphviz python-setuptools python-texttable python-thrift python-yaml quagga redis-server redis-tools subversion tcpdump texinfo tshark valgrind vim xterm' returned a non-zero code: 100
  95. make: *** [base-docker-image] Error 100

解决方法:

该问题分为两个子问题,一个是Err http://archive.ubuntu.com trusty InRelease,另外一个是E: Unable to locate package [name] .

第一个问题其实并非是DNS问题,就原文来看,是Docker的bridge连接问题:

  1. sudo apt-get install bridge-utils
  2. pkill docker
  3. iptables -t nat -F
  4. ifconfig docker0 down
  5. brctl delbr docker0
  6. sudo service docker restart

It will force docker to recreate the bridge and reinit all the network rules

第二个问题 => tf serving docker build failed at apt-get update/install

This looks like a connectivity problem on your machine where Docker cannot access the network. Please make sure that your machine can access the internet, and if it still doesn't work I would recommend asking Docker support to help configure it to work with your proxy.

2017/2/17

Docker:Err http://archive.ubuntu.com trusty InRelease & E: Unable to locate package [name] 问题的更多相关文章

  1. Ubuntu : 解决更新时出现 Unable to locate package update

    当用apt-get更新软件包时常出现错误提示Unable to locate package update, 尤其是在ubuntu server上,解决方法是:     先更新apt-get      ...

  2. Ubuntu下,如何解决Unable to locate package

    在虚拟机上新装了一个ubuntu 12.10,想在上面装一个Git,却发生了以下错误信息 我觉得原因可能是我换了163的源,没有更新所以找不到这个包. 这时候就要使用 sudo apt-get upd ...

  3. 【转】ubuntu 11.04使用apt-get安装软件时一直提示E:unable to locate package

    问题: VMware虚拟机安装了ubuntu 11.04,在使用apt-get安装软件时一直提示E:Unable to locate package. 百度了原因,说是要更新源,使用命令:sudo a ...

  4. Ubuntu的Unable to locate package无法更新源问题解决方案

    https://blog.csdn.net/long19910605/article/details/47017889/ 问题: 更新源时提示不能联网(does the network require ...

  5. ubuntu 安装nginx, 出现 Unable to locate package

    今天在初始化一台新的ubuntu 服务器时,敲上了 sudo apt-get install nginx 来安装nginx, 却发现提示:  Reading package lists... Done ...

  6. linux -- Ubuntu报错“unable to locate package...”

    有时候在Ubuntu命令行中执行安装某个文件的时候,如:sudo apt-get install xinit ,报 “unable to locate package...” 错误,解决办法如下 1. ...

  7. Ubuntu install 错误 E:Unable to locate package

    今天在 Ubuntu 上执行 sudo apt install sl 命令,结果报错:E:Unable to locate package sl 上网查询了一下,先更新一下 apt-get,执行:su ...

  8. Ubuntu:Unable to locate package ***

    在Ubuntu 上使用apt-get 安装包时遇到  Unable to locate package 的信息 解决方案: 更细apt-get然后重新安装 #sudo apt-get update   ...

  9. Ubuntu Server安装telnet服务时"Unable to locate package telnetd"解决方法

    装好Ubuntu Server 12.04后,用apt-get安装telnetd报"E: Unable to locate package telnetd",解决方法如下: 虚拟机 ...

随机推荐

  1. C#如何判断程序调用的exe已结束

    二个方法:以运行系统记事本为例 方法一:这种方法会阻塞当前进程,直到运行的外部程序退出System.Diagnostics.Process exep = System.Diagnostics.Proc ...

  2. c# 执行 CreateHandle() 时无法调用值 Dispose()

    在多线程C#开发中,遇到错误 执行 CreateHandle() 时无法调用值 Dispose().,这个错误是在关闭窗体的时候出来的. 原因是因为窗体还存在CreateHandle()事件,所以还不 ...

  3. ios 屏幕旋转的问题

    在ios6之前我们旋转屏幕只需要实现shouldAutorotateToInterfaceOrientation就行了 - (BOOL)shouldAutorotateToInterfaceOrien ...

  4. poj3171 Cleaning Shifts【线段树(单点修改区间查询)】【DP】

    Cleaning Shifts Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4422   Accepted: 1482 D ...

  5. PL/SQL编程基础(五):异常处理(EXCEPTION)

    异常处理 异常产生所带来的问题: 使用EXCEPTION程序块进行异常处理: 实现用户自定义异常. 使用异常可以保证在程序中出现运行时异常时程序可以正常的执行完毕: 用户可以使用自定义异常进行操作. ...

  6. apidemos编译出错

    编译api 19的(4.4.2)apidemos一直报xml相关资源出错. 把build-toos 22删除,替换成19版本的,就ok了. 真是坑啊. 学习新东西难免遇到坑.

  7. Fast and Accurate Traffic Matrix Measurement Using Adaptive Cardinality Counting

    paper-CaiPan.pdf http://conferences.sigcomm.org/sigcomm/2005/paper-CaiPan.pdf

  8. 【mlflow】mlflow打包、启动、换用mysql backend、mysql配置

    mlflow是一个自动化机器学习平台,支持python2也支持python3 mlflow9.0添加了数据库作为tracking data的存储: https://github.com/mlflow/ ...

  9. Strategic Game--hdu1054(最小覆盖点)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1054 求最小覆盖点,也就是求最大匹配,要用邻接表写,不然会TLE:当然也可以用HK算法: #inclu ...

  10. 记一次踩坑:使用ksoap-android时造成的okhttp依赖冲突问题

    项目中需要调用webservice接口,android SDK中并没有直接访问webservice接口的方法,于是我引入了ksoap-android的jar包,来实现访问webservice接口.刚开 ...