docker镜像如下:

今天在运行的容器内使用 apt-get update 命令进行更新时,发下很多404错误。

 Err http://archive.ubuntu.com wily-updates/restricted amd64 Packages
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-updates/universe amd64 Packages
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-security/main Sources
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-security/restricted Sources
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-security/universe Sources
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-security/main amd64 Packages
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-security/restricted amd64 Packages
Not Found [IP: 91.189.88.152 ]
Err http://archive.ubuntu.com wily-security/universe amd64 Packages
Not Found [IP: 91.189.88.152 ]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily/main/source/Sources 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily/restricted/source/Sources 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily/universe/source/Sources 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily/main/binary-amd64/Packages 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily/restricted/binary-amd64/Packages 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily/universe/binary-amd64/Packages 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily-updates/main/source/Sources 404 Not Found [IP: 91.189.88.152 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/wily-updates/restricted/source/Sources 404 Not Found [IP: 91.189.88.152 80]

经查,每一个Ubuntu发布版本都有它的结束时间,通常,Ubuntu发布版本支持18个月,而LTS (Long Term Support)(长期支持)版本分别支持3年(服务器版)和5年(桌面版)。

当一个Ubuntu发布版本到达结束期后,它的库将不再能够访问,并且你也不会得到任何维护更新和安全补丁。当写这个的时候,我的15.10版本已经到了它的结束期了。
对于那些使用旧版本的Ubuntu的用户,这是一个过期库的归档。因此,Ubuntu过期后,我们必须把源切换到 old-releases.ubuntu.com。

下面的方法通过切换到旧版本的源来解决“404 Not Found”错误。

首先,使用旧版本的源来替换当前主源

$ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
$ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

现在,应该能够在旧版本的Ubuntu镜像系统上进行安装或者更新了

在完成操作之后,输入 exit命令来退出这个容器。

此时ID为5a76c9bb0d02的容器,是按我们的需求更改的容器。我们可以通过命令 docker commit来提交容器副本。

sudo docker commit -m="has update" -a="zpt" 5a76c9bb0d02 zpt/ubuntu:v2

各个参数说明:

  • -m:提交的描述信息

  • -a:指定镜像作者

  • 5a76c9bb0d02:容器ID

  • runoob/ubuntu:v2:指定要创建的目标镜像名

接下来我们可以使用 docker images 命令来查看我们的新镜像 zpt/ubuntu:v2

Docker 更新镜像的更多相关文章

  1. [Linux] - Manjaro ARM 系统配置(更新镜像源,安装 Docker 和 Dotnet Core)

    硬件:Raspberry Pi 4B系统:Manjaro-ARM-xfce-rpi4-19.08网址:https://manjaro.org/ Issue系统启动后,中文字符显示为小方格乱码 解决:安 ...

  2. docker创建镜像及push镜像出错问题

    docker build  出错 Got permission denied while trying to connect to the Docker daemon socket at unix:/ ...

  3. docker 操作镜像的基本操作

    以安装mysql为例 1.拉取镜像 docker pull mysql 错误的启动 [root@localhost ~]# docker run --name mysql01 -d mysql 42f ...

  4. docker 拷贝镜像文件

    1.概述 我们制作好镜像后,有时需要将镜像复制到另一台服务器使用. 能达到以上目的有两种方式,一种是上传镜像到仓库中(本地或公共仓库),但是另一台服务器很肯能只是与当前服务器局域网想通而没有公网的,所 ...

  5. docker之镜像管理命令

    一.docker image 镜像管理命令 指令 描述ls 列出本机镜像build 构建镜像来自Dockerfilehistory 查看镜像历史inspect 显示一个或多个镜像详细信息pull 从镜 ...

  6. docker探索-镜像使用(四)

     前言 当运行容器时,使用的镜像如果在本地中不存在,docker 就会自动从 docker 镜像仓库中下载,默认是从 Docker Hub 公共镜像源下载. 1.查看本地主机上的镜像列表 [root@ ...

  7. Docker 创建镜像、修改、上传镜像

    Docker 创建镜像.修改.上传镜像 –创建镜像有很多方法,用户可以从 Docker Hub 获取已有镜像并更新,也可以利用本地文件系统创建一个. 一.创建镜像 创建镜像有很多方法,用户可以从 Do ...

  8. Docker发布镜像至Docker Hub

    第一步:Docker生成镜像 docker@default:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE metal-workbench- ...

  9. Docker 更新版本

    Docker 更新版本 原来版本 1.10 更新后的版本 19.03.1 更新 Docker 版本需要注意的问题: 注意系统是否支持新版本的储存驱动. 19.03.01 版本默认使用的储存驱动是 ov ...

随机推荐

  1. 【页面置换算法】LRC算法和FIFS算法

    算法介绍 FIFO:该算法总是淘汰最先进入内存的页面,即选择在内存中驻留时间最久的页面予以淘汰.该算法实现简单,只需把一个进程已调入内存的页面,按先后次序链接成一个队列,并设置一个指针,称为替换指针, ...

  2. layui select使用问题

    1.需要引用form模板 layui.use(['form'], function () { var form = layui.form; }); 2.html代码 <div class=&qu ...

  3. win7下配置mysql的my.ini文件

    一.环境 操作系统是win7 x64, mysql是5.6.40. 二. 怎么配置? 修改my.ini文件, 添加[client], 在下面加一行 default-character-set=utf8 ...

  4. npm修改淘宝原

    //修改之前查看一下npm config get registry https://registry.npmjs.org/ //设置源npm config set registry https://r ...

  5. 阿里分布式事务解决方案-GTS

    摘要: 本文将深入和大家探讨微服务架构下,分布式事务的各种解决方案,并重点为大家解读阿里巴巴提出的分布式事务解决方案----GTS.该方案中提到的GTS是全新一代解决微服务问题的分布式事务互联网中间件 ...

  6. vue父子组件及非父子组件通信

    1.父组件传递数据给子组件 父组件数据如何传递给子组件呢?可以通过props属性来实现 父组件: <parent> <child :child-msg="msg" ...

  7. [Swift]LeetCode72. 编辑距离 | Edit Distance

    Given two words word1 and word2, find the minimum number of operations required to convert word1 to  ...

  8. [Swift]LeetCode254.因子组合 $ Factor Combinations

    Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a func ...

  9. [Swift]LeetCode724. 寻找数组的中心索引 | Find Pivot Index

    Given an array of integers nums, write a method that returns the "pivot" index of this arr ...

  10. [Swift]LeetCode905. 按奇偶排序数组 | Sort Array By Parity

    Given an array A of non-negative integers, return an array consisting of all the even elements of A, ...