我想为 Ubuntu 18.04 和 16.04 创建一个本地存储库。我只对下载 64 位软件包感兴趣。我正在使用“apt-mirror”将软件包下载到硬盘上。
我在“mirror.lst”中使用以下内容
deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-proposed main restricted universe multiverse
deb [arch=amd64] http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
使用“sudo apt-mirror”时出现以下错误
Downloading 380 index files using 40 threads...
Begin time: Tue May 22 12:09:11 2018
[40]... [39]... [38]... [37]... [36]... [35]... [34]... [33]... [32]... [31]... [30]... [29]... [28]... [27]... [26]... [25]... [24]... [23]... [22]... [21]... [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Tue May 22 12:09:26 2018
Processing translation indexes: [TTTTTTTTTT]
Downloading 453 translation files using 40 threads...
Begin time: Tue May 22 12:09:26 2018
[40]... [39]... [38]... [37]... [36]... [35]... [34]... [33]... [32]... [31]... [30]... [29]... [28]... [27]... [26]... [25]... [24]... [23]... [22]... [21]... [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Tue May 22 12:10:03 2018
Processing DEP-11 indexes: [DDDDDDDDDD]
Downloading 144 dep11 files using 40 threads...
Begin time: Tue May 22 12:10:03 2018
[40]... [39]... [38]... [37]... [36]... [35]... [34]... [33]... [32]... [31]... [30]... [29]... [28]... [27]... [26]... [25]... [24]... [23]... [22]... [21]... [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Tue May 22 12:13:42 2018
Processing indexes: [P
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
PPPPP
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
PPPP
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
gzip: stdin: not in gzip format
]
26.9 GiB will be downloaded into archive.
Downloading 5640 archive files using 40 threads...
Begin time: Tue May 22 12:13:43 2018
[40]... [39]... [38]... [37]... [36]... [35]... [34]... [33]... [32]... [31]... [30]... [29]... [28]... [27]... [26]... [25]... [24]... [23]... [22]... [21]... [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]...
[0]...
End time: Tue May 22 12:58:01 2018
我反复尝试了很多次,每次都得到同样的错误。
下载也很慢(尽管我的互联网连接很快)。是否有任何选项可以从多个镜像同时下载软件包?也请让我知道克服错误的任何解决方案!
尝试运行
find * -name "*.gz" -exec file {} + | grep -v "gzip compressed data"
我的猜测可能是你有一个旧的非工作回购?该问题与 apt-mirror 无关,而与存储库本身有关。我更改了存储库,它工作正常。
这个答案是使用 Ubuntu 18.04 SERVER 测试的
换另一个镜像似乎可以解决问题。
确保为您的系统使用正确的体系结构,尤其是在您的环境中混合有多种体系结构的情况下。(即
deb-i386
,deb-amd64
,deb
)在我的初始配置中,我指定了
deb-amd64
anddeb-i386
; 尝试时sudo apt upgrade
,但我收到有关丢失文件的错误。切换到
deb
而不是deb-amd64
为我工作。注意:
set defaultarch i386
在您的mirror.list
设置上,纯“deb”的行为,否则它将默认为apt-mirror
正在运行的主机架构。注意:
mirror.list
文件的语法是:在 apt-mirror 的官方页面上找到参考: https ://github.com/apt-mirror/apt-mirror/blob/master/mirror.list