Error while using apt-mirror for creating local repo

I would like to create a local repo for Ubuntu 18.04 and 16.04. I am interested in downloading only 64-bit packages. I am using "apt-mirror" to download the packages to the hard disk.

I use the following in my "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

I got the following error while using "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

I tried many times repeatedly and getting the same error every time.

The download is also very slow (despite of my fast Internet connection). Is there any option to download the packages simultaneously from multiple mirrors? Also please let me know any solution to overcome the error!

Answers 3


  • try running the find * -name "*.gz" -exec file {} + | grep -v "gzip compressed data" my guess would be maybe you have an old non-working repo?


  • This answer was tested using Ubuntu 18.04 SERVER

    Changing to another mirror seems to solve the problem.

    Make sure you use the correct architecture for your system especially if you have a mix of architectures in your environment. (ie. deb-i386, deb-amd64, deb)

    On my initial configuration I had specified deb-amd64 and deb-i386; When trying sudo apt upgrade, but I was getting errors about missing files.

    Switching to deb instead of deb-amd64 worked for me.

    Note: set defaultarch i386 on your mirror.list sets the behavior of plain "deb", otherwise it will default to the host's architecture, where apt-mirror is running.

    Note: the syntax for the mirror.list file is:

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

    Find the reference on apt-mirror's official page: https://github.com/apt-mirror/apt-mirror/blob/master/mirror.list