现象:

root@ubuntu:~# apt-get install -y docker.io
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  aufs-tools cgroup-lite git git-man liberror-perl
Suggested packages:
  btrfs-tools debootstrap lxc rinse git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  aufs-tools cgroup-lite docker.io git git-man liberror-perl
0 upgraded, 6 newly installed, 0 to remove and 221 not upgraded.
Need to get 3,400 kB/8,266 kB of archives.
After this operation, 51.4 MB of additional disk space will be used.
Err http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.2
  404  Not Found [IP: 112.124.140.210 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main git-man all 1:1.9.1-1ubuntu0.2
  404  Not Found [IP: 91.189.91.14 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main git amd64 1:1.9.1-1ubuntu0.2
  404  Not Found [IP: 91.189.91.14 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git-man_1.9.1-1ubuntu0.2_all.deb  404  Not Found [IP: 91.189.91.14 80]


E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git_1.9.1-1ubuntu0.2_amd64.deb  404  Not Found [IP: 91.189.91.14 80]


E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


解决:

(1)首先备份官方源,以免设置错误可恢复。
Ubuntu14.04更新源
2
(2)用编辑器打开 /etc/apt/sources.list文件。
Ubuntu14.04更新源

  1. (1)首先备份官方源,以免设置错误可恢复。

  2. Ubuntu14.04更新源
    1. (4)添加的源有很多,可根据自己的情况选择。

      #163

      deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

      deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

      deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

      deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

      deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

      deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

      deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

      deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

      deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

      deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

      #中科大

      deb http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

      deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

      deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

      deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

      deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

      deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

      deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

      deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

      deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

      deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

      #sohu

      deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse

      deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse

      deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse

      deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse

      deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

      deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse

      deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse

      deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse

      deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse

      deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

      #oschina

      deb http://mirrors.oschina.net/ubuntu/ trusty main restricted universe multiverse

      deb http://mirrors.oschina.net/ubuntu/ trusty-backports main restricted universe multiverse

      deb http://mirrors.oschina.net/ubuntu/ trusty-proposed main restricted universe multiverse

      deb http://mirrors.oschina.net/ubuntu/ trusty-security main restricted universe multiverse

      deb http://mirrors.oschina.net/ubuntu/ trusty-updates main restricted universe multiverse

      deb-src http://mirrors.oschina.net/ubuntu/ trusty main restricted universe multiverse

      deb-src http://mirrors.oschina.net/ubuntu/ trusty-backports main restricted universe multiverse

      deb-src http://mirrors.oschina.net/ubuntu/ trusty-proposed main restricted universe multiverse

      deb-src http://mirrors.oschina.net/ubuntu/ trusty-security main restricted universe multiverse

      deb-src http://mirrors.oschina.net/ubuntu/ trusty-updates main restricted universe multiverse

      #北京交通大学

      deb http://mirror.bjtu.edu.cn/ubuntu/ trusty main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates main multiverse

      # 北京理工

      deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe

      deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe

      deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe

      restricted universe

      #上海交大

      deb http://ftp.sjtu.edu.cn/ubuntu/ trusty universe restricted multiverse maindeb http://ftp.sjtu.edu.cn/ubuntu/ trusty-security universe restricted multiverse maindeb http://ftp.sjtu.edu.cn/ubuntu/ trusty-updates universe restricted multiverse maindeb http://ftp.sjtu.edu.cn/ubuntu/ trusty-proposed universe restricted multiverse maindeb http://ftp.sjtu.edu.cn/ubuntu/ trusty-backports universe restricted multiverse main

      #阿里云服务器

      deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

      deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

      deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

      deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

      deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

      deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

      deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

      deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

      deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

      deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

    2. (5)更新。

      Ubuntu14.04更新源

    然后再安装docker.io。就ok了
  3. root@ubuntu:/etc/apt# apt-get install docker.io
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      aufs-tools cgroup-lite git git-man liberror-perl
    Suggested packages:
      btrfs-tools debootstrap lxc rinse git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-mediawiki git-svn
    The following NEW packages will be installed:
      aufs-tools cgroup-lite docker.io git git-man liberror-perl
    0 upgraded, 6 newly installed, 0 to remove and 226 not upgraded.
    Need to get 3,285 kB/8,150 kB of archives.
    After this operation, 51.4 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://mirrors.163.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.3 [699 kB]
    Get:2 http://mirrors.163.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.3 [2,586 kB]
    Fetched 3,285 kB in 2s (1,366 kB/s)
    Selecting previously unselected package aufs-tools.
    (Reading database ... 68397 files and directories currently installed.)
    Preparing to unpack .../aufs-tools_1%3a3.2+20130722-1.1_amd64.deb ...
    Unpacking aufs-tools (1:3.2+20130722-1.1) ...
    Selecting previously unselected package docker.io.
    Preparing to unpack .../docker.io_1.6.2~dfsg1-1ubuntu4~14.04.1_amd64.deb ...
    Unpacking docker.io (1.6.2~dfsg1-1ubuntu4~14.04.1) ...
    Selecting previously unselected package liberror-perl.
    Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ...
    Unpacking liberror-perl (0.17-1.1) ...
    Selecting previously unselected package git-man.
    Preparing to unpack .../git-man_1%3a1.9.1-1ubuntu0.3_all.deb ...
    Unpacking git-man (1:1.9.1-1ubuntu0.3) ...
    Selecting previously unselected package git.
    Preparing to unpack .../git_1%3a1.9.1-1ubuntu0.3_amd64.deb ...
    Unpacking git (1:1.9.1-1ubuntu0.3) ...
    Selecting previously unselected package cgroup-lite.
    Preparing to unpack .../cgroup-lite_1.9_all.deb ...
    Unpacking cgroup-lite (1.9) ...
    Processing triggers for man-db (2.6.7.1-1) ...
    Processing triggers for ureadahead (0.100.0-16) ...
    ureadahead will be reprofiled on next reboot
    Setting up aufs-tools (1:3.2+20130722-1.1) ...
    Setting up docker.io (1.6.2~dfsg1-1ubuntu4~14.04.1) ...
    Adding group `docker' (GID 112) ...
    Done.
    docker start/running, process 9948
    Setting up liberror-perl (0.17-1.1) ...
    Setting up git-man (1:1.9.1-1ubuntu0.3) ...
    Setting up git (1:1.9.1-1ubuntu0.3) ...
    Setting up cgroup-lite (1.9) ...
    cgroup-lite start/running
    Processing triggers for libc-bin (2.19-0ubuntu6) ...
    Processing triggers for ureadahead (0.100.0-16) ...

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐