使用 apt-mirror 创建本地 repo 时出错

使用 apt-mirror 创建本地 repo 时出错

我想为 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

我尝试了多次,但每次都出现同样的错误。

下载也非常慢(尽管我的互联网连接很快)。有没有选项可以同时从多个镜像下载软件包?另外,请告诉我任何解决该错误的方法!

答案1

尝试运行find * -name "*.gz" -exec file {} + | grep -v "gzip compressed data"我的猜测可能是你有一个旧的不工作的仓库?

答案2

问题与 apt-mirror 无关,而是与存储库本身有关。我更改了存储库,它运行正常。

答案3

此答案已使用 Ubuntu 18.04 SERVER 进行了测试

换到另一个镜像似乎可以解决问题。

确保为你的系统使用正确的架构,特别是当你的环境中有混合架构时。(即deb-i386,, )deb-amd64deb

在我的初始配置中,我指定了deb-amd64deb-i386;当尝试时sudo apt upgrade,但我收到有关缺少文件的错误。

对我来说,切换到deb而不是 是deb-amd64有效的。

注意:set defaultarch i386在您的mirror.list设置上,请将行为设置为普通的“deb”,否则它将默认为正在运行的主机的体系结构apt-mirror

注意:该文件的语法mirror.list是:

deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse

在apt-mirror的官方页面上找到参考: https://github.com/apt-mirror/apt-mirror/blob/master/mirror.list

相关内容