A
A
Avgard2019-04-16 19:00:19
ubuntu
Avgard, 2019-04-16 19:00:19

How to fix error with apt-mirror in Ubuntu Server?

Good afternoon.
I'm trying to create a local copy of a repository for Ubuntu Server 18.04 LTS
Here is the mirror.list file:

############# config ##################
#
 set base_path    /var/apt-mirror
#
 set mirror_path  $base_path/mirror
 set skel_path    $base_path/skel
 set var_path     $base_path/var
 set cleanscript $var_path/clean.sh
 set defaultarch  <running host architecture>
 set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############
deb http://archive.ubuntu.com/ubuntu bionic main restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu bionic universe
deb http://archive.ubuntu.com/ubuntu bionic-updates universe
deb http://archive.ubuntu.com/ubuntu bionic multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted
deb http://archive.ubuntu.com/ubuntu bionic-security universe
deb http://archive.ubuntu.com/ubuntu bionic-security multiverse



clean http://archive.ubuntu.com/ubuntu

When running the command sudo -u apt-mirror apt-mirror the following response:
Downloading 152 index files using 20 threads...
Begin time: Tue Apr 16 15:49:39 2019
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Tue Apr 16 15:49:41 2019

Processing translation indexes: [TTTTTTTTTT]

Downloading 570 translation files using 20 threads...
Begin time: Tue Apr 16 15:49:41 2019
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Tue Apr 16 15:49:44 2019

Processing DEP-11 indexes: [DDDDDDDDDD]

Downloading 60 dep11 files using 20 threads...
Begin time: Tue Apr 16 15:49:45 2019
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Tue Apr 16 15:49:45 2019

apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic/main/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic/restricted/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-updates/main/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-updates/restricted/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic/universe/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-updates/universe/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic/multiverse/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-updates/multiverse/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-backports/main/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-backports/restricted/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-backports/universe/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-backports/multiverse/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-security/main/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-security/restricted/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-security/universe/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-security/multiverse/binary-<running/Packages in process_index at /usr/bin/apt-mirror line 800, <STREAM> chunk 19968.
Processing indexes: [PPPPPPPPPP]

0 bytes will be downloaded into archive.
Downloading 0 archive files using 0 threads...
Begin time: Tue Apr 16 15:49:45 2019
[0]... 
End time: Tue Apr 16 15:49:45 2019

0 bytes in 0 files and 0 directories can be freed.
Run /var/apt-mirror/var/clean.sh for this purpose.

Running the Post Mirror script ...
(/var/apt-mirror/var/postmirror.sh)

/bin/sh: 0: Can't open /var/apt-mirror/var/postmirror.sh

Post Mirror script has completed. See above output for any possible errors.

I understand that there is
apt-mirror: can't open index archive.ubuntu.com/ubuntu//dists/bionic-security/multiverse/binary-chunk 19968.
there shouldn't be a double //, but I can't understand where it comes from at all is taken there. I will be grateful for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Avgard, 2019-04-16
@Avgard

Slightly changed the mirror.list file

############# config ##################
#
set base_path    /var/apt-mirror
#
 set mirror_path  $base_path/mirror
 set skel_path    $base_path/skel
 set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

###### Ubuntu Main 
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

###### Ubuntu Update 
deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

After restarting apt-mirror it started working fine, packages are being downloaded. To be honest, I did not delve into the reasons, but in this form the config works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question