Solved Apt Mirror

Solved issue

tinfoil-hat

Active Member
Joined
Oct 24, 2021
Messages
347
Reaction score
173
Credits
2,407
Hi there, I downloaded an apt mirror via package
Code:
apt-mirror
. After that, I created an apache2 alias like following:
Code:
Alias /debian /var/spool/apt-mirror/mirror/deb.debian.org/debian
for testing purposes I tryed to do the following in my
Code:
sources.list
:

Code:
deb [arch=amd64] http://127.0.0.1/debian bookworm main contrib non-free non-free-firmware
deb [arch=amd64] http://127.0.0.1/debian bookworm-updates main contrib non-free non-free-firmware
deb [arch=amd64] http://127.0.0.1/debian bookworm-backports main contrib non-free non-free-firmware
/etc/apt/sources.list.d/official-package-repositories.list (END)

when I try an
Code:
sudo apt update
I get the following:

Code:
─$ sudo apt update      
Holen:1 http://127.0.0.1/debian bookworm-updates InRelease [55,4 kB]
Holen:2 http://127.0.0.1/debian bookworm-backports InRelease [56,5 kB]
Holen:3 http://127.0.0.1/debian bookworm InRelease [151 kB]
Ign:4 http://127.0.0.1/debian bookworm-updates/main amd64 Packages                                                           
Ign:5 http://127.0.0.1/debian bookworm-updates/main Translation-en                                                           
Ign:6 http://127.0.0.1/debian bookworm-updates/main all Contents (deb)                                                       
Ign:7 http://127.0.0.1/debian bookworm-updates/main amd64 Contents (deb)                                                     
Ign:8 http://127.0.0.1/debian bookworm-updates/contrib amd64 Packages                                                        
Ign:9 http://127.0.0.1/debian bookworm-updates/contrib Translation-en                                                        
Ign:10 http://127.0.0.1/debian bookworm-updates/contrib amd64 Contents (deb)                                                 
Ign:11 http://127.0.0.1/debian bookworm-updates/non-free amd64 Packages                                                      
Ign:12 http://127.0.0.1/debian bookworm-updates/non-free Translation-en                                                                              
Ign:13 http://127.0.0.1/debian bookworm-updates/non-free amd64 Contents (deb)                                                                        
Ign:14 http://127.0.0.1/debian bookworm-updates/non-free-firmware amd64 Packages                                                                     
Ign:15 http://127.0.0.1/debian bookworm-updates/non-free-firmware Translation-en                                             
Ign:16 http://127.0.0.1/debian bookworm-updates/non-free-firmware amd64 Contents (deb)                                       
Holen:4 http://127.0.0.1/debian bookworm-updates/main amd64 Packages [12,7 kB]                                               
Holen:5 http://127.0.0.1/debian bookworm-updates/main Translation-en [13,8 kB]                                                                                 
Ign:6 http://127.0.0.1/debian bookworm-updates/main all Contents (deb)                                                                                         
Holen:7 http://127.0.0.1/debian bookworm-updates/main amd64 Contents (deb) [258 kB]                                          
Holen:8 http://127.0.0.1/debian bookworm-updates/contrib amd64 Packages [768 B]                                              
Holen:9 http://127.0.0.1/debian bookworm-updates/contrib Translation-en [408 B]                                              
Holen:10 http://127.0.0.1/debian bookworm-updates/contrib amd64 Contents (deb) [222 B]                                       
Holen:11 http://127.0.0.1/debian bookworm-updates/non-free amd64 Packages [12,8 kB]                                          
Holen:12 http://127.0.0.1/debian bookworm-updates/non-free Translation-en [7.744 B]                                          
Holen:13 http://127.0.0.1/debian bookworm-updates/non-free amd64 Contents (deb) [15,6 kB]                                    
Holen:14 http://127.0.0.1/debian bookworm-updates/non-free-firmware amd64 Packages [616 B]                                   
Holen:15 http://127.0.0.1/debian bookworm-updates/non-free-firmware Translation-en [384 B]
Holen:16 http://127.0.0.1/debian bookworm-updates/non-free-firmware amd64 Contents (deb) [243 B]             
Ign:6 http://127.0.0.1/debian bookworm-updates/main all Contents (deb)                                       
Fehl:6 http://127.0.0.1/debian bookworm-updates/main all Contents (deb)                                      
  404  Not Found [IP: 127.0.0.1 80]

Ign:19 http://127.0.0.1/debian bookworm-backports/main amd64 Packages
Ign:20 http://127.0.0.1/debian bookworm-backports/main Translation-en
Ign:21 http://127.0.0.1/debian bookworm-backports/main amd64 Contents (deb)
Ign:22 http://127.0.0.1/debian bookworm-backports/main all Contents (deb)
Ign:23 http://127.0.0.1/debian bookworm-backports/contrib amd64 Packages
Ign:24 http://127.0.0.1/debian bookworm-backports/contrib Translation-en
Ign:25 http://127.0.0.1/debian bookworm-backports/contrib all Contents (deb)
Ign:26 http://127.0.0.1/debian bookworm-backports/contrib amd64 Contents (deb)
Ign:27 http://127.0.0.1/debian bookworm-backports/non-free amd64 Packages
Ign:28 http://127.0.0.1/debian bookworm-backports/non-free Translation-en
Ign:29 http://127.0.0.1/debian bookworm-backports/non-free all Contents (deb)
Holen:19 http://127.0.0.1/debian bookworm-backports/main amd64 Packages [188 kB]
Holen:20 http://127.0.0.1/debian bookworm-backports/main Translation-en [157 kB]
Holen:21 http://127.0.0.1/debian bookworm-backports/main amd64 Contents (deb) [787 kB]
Ign:22 http://127.0.0.1/debian bookworm-backports/main all Contents (deb)
Holen:23 http://127.0.0.1/debian bookworm-backports/contrib amd64 Packages [5.372 B]
Holen:24 http://127.0.0.1/debian bookworm-backports/contrib Translation-en [5.084 B]
Ign:25 http://127.0.0.1/debian bookworm-backports/contrib all Contents (deb)
Holen:26 http://127.0.0.1/debian bookworm-backports/contrib amd64 Contents (deb) [17,6 kB]
Holen:27 http://127.0.0.1/debian bookworm-backports/non-free amd64 Packages [1.288 B]
Holen:28 http://127.0.0.1/debian bookworm-backports/non-free Translation-en [544 B]
Ign:29 http://127.0.0.1/debian bookworm-backports/non-free all Contents (deb)
Ign:22 http://127.0.0.1/debian bookworm-backports/main all Contents (deb)
Ign:25 http://127.0.0.1/debian bookworm-backports/contrib all Contents (deb)
Ign:29 http://127.0.0.1/debian bookworm-backports/non-free all Contents (deb)
Fehl:22 http://127.0.0.1/debian bookworm-backports/main all Contents (deb)
  404  Not Found [IP: 127.0.0.1 80]

Ign:25 http://127.0.0.1/debian bookworm-backports/contrib all Contents (deb)
Ign:29 http://127.0.0.1/debian bookworm-backports/non-free all Contents (deb)
Holen:30 http://127.0.0.1/debian bookworm/main amd64 Packages [8.786 kB]
Holen:31 http://127.0.0.1/debian bookworm/main Translation-en [6.109 kB]
Holen:32 http://127.0.0.1/debian bookworm/main Translation-de_DE [830 B]
Holen:33 http://127.0.0.1/debian bookworm/main Translation-de [1.748 kB]
Holen:34 http://127.0.0.1/debian bookworm/main amd64 DEP-11 Metadata [4.492 kB]
Holen:35 http://127.0.0.1/debian bookworm/main amd64 Contents (deb) [11,6 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Holen:36 http://127.0.0.1/debian bookworm/main all Contents (deb) [33,0 MB]
Ign:36 http://127.0.0.1/debian bookworm/main all Contents (deb)
Ign:49 http://127.0.0.1/debian bookworm/contrib all Contents (deb)
Ign:50 http://127.0.0.1/debian bookworm/non-free all Contents (deb)
Ign:51 http://127.0.0.1/debian bookworm/non-free-firmware all Contents (deb)
Ign:36 http://127.0.0.1/debian bookworm/main all Contents (deb)
Ign:49 http://127.0.0.1/debian bookworm/contrib all Contents (deb)
Ign:50 http://127.0.0.1/debian bookworm/non-free all Contents (deb)
Ign:51 http://127.0.0.1/debian bookworm/non-free-firmware all Contents (deb)
Ign:36 http://127.0.0.1/debian bookworm/main all Contents (deb)
Ign:49 http://127.0.0.1/debian bookworm/contrib all Contents (deb)
Ign:50 http://127.0.0.1/debian bookworm/non-free all Contents (deb)
Ign:51 http://127.0.0.1/debian bookworm/non-free-firmware all Contents (deb)
Fehl:36 http://127.0.0.1/debian bookworm/main all Contents (deb)
  404  Not Found [IP: 127.0.0.1 80]

Ign:49 http://127.0.0.1/debian bookworm/contrib all Contents (deb)
Ign:50 http://127.0.0.1/debian bookworm/non-free all Contents (deb)
Ign:51 http://127.0.0.1/debian bookworm/non-free-firmware all Contents (deb)
Es wurden 1.748 kB in 2 s geholt (1.025 kB/s).
Paketlisten werden gelesen… Fertig
E: Fehlschlag beim Holen von http://127.0.0.1/debian/dists/bookworm-updates/main/Contents-all 404  Not Found [IP: 127.0.0.1 80]
E: Fehlschlag beim Holen von http://127.0.0.1/debian/dists/bookworm-backports/main/Contents-all 404  Not Found [IP: 127.0.0.1 80]
E: Fehlschlag beim Holen von http://127.0.0.1/debian/dists/bookworm/main/Contents-all 404  Not Found [IP: 127.0.0.1 80]
E: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.
the path to Contents-all seems not existing
Bildschirmfoto vom 2024-04-20 03-52-10.png


Instead there was the following created by apt-mirror



Bildschirmfoto vom 2024-04-20 03-53-54.png


If you could help me to get packages installed from this mirror, I´d be very thankful
 


Please post your sources list. Look in /etc/apt/sources.list.

The entries that you added to your sources list are not edited correctly from what I can see.

Some index files could not be downloaded and things failed to be gotten from that url.
Those file were ignored or old ones were used in their place.

The correct 'Debian 12 Bookworm Mirror for Germany' is here:

My Debian 12 sources list is as follows:

Code:
debian-box:~$ cat /etc/apt/sources.list
# See https://wiki.debian.org/SourcesList for more information.
deb http://deb.debian.org/debian bookworm main non-free-firmware
deb-src http://deb.debian.org/debian bookworm main non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main non-free-firmware

deb http://security.debian.org/debian-security/ bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security/ bookworm-security main non-free-firmware

# Backports allow you to install newer versions of software made available for this release
deb http://deb.debian.org/debian bookworm-backports main non-free-firmware
deb-src http://deb.debian.org/debian bookworm-backports main non-free-firmware

I tried going to the url that you posted in the screenshot.
The site could be temporarily unavailable or too busy.
The Debian Team at times have to take mirrors off-line to work on the servers so the repo you are trying to pull from may be down.
 
Last edited:
I do not use apt-mirror myself - never had the need to - but your apt sources list is all wrong
deb [arch=amd64] http://127.0.0.1/debian bookworm main contrib non-free non-free-firmware
deb [arch=amd64] http://127.0.0.1/debian bookworm-updates main contrib non-free non-free-firmware
deb [arch=amd64] http://127.0.0.1/debian bookworm-backports main contrib non-free non-free-firmware
/etc/apt/sources.list.d/official-package-repositories.list (END)
There should be no [arch=amd64] http://127.0.0.1 in your lines
It should look like
deb http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
deb http://deb.debian.org/debian bookworm-backports main contrib non-free
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
That is why your list cannot find anything since what you have does not exist
 
I do not use apt-mirror myself - never had the need to - but your apt sources list is all wrong

There should be no [arch=amd64] http://127.0.0.1 in your lines
It should look like

That is why your list cannot find anything since what you have does not exist
I think you don't understand. I want to be able to install packages from my very own apt-mirror. not the official ones. I want to be able to install packages when my network is offline
 
/etc/apt/sources.list.d/official-package-repositories.list (END)
This line should not be present in your sources.list file, the contents of /etc/apt/sources.list.d are automatically included, just remove the line.

Please show output and contents of:
Bash:
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/official-package-repositories.list
 
This line should not be present in your sources.list file, the contents of /etc/apt/sources.list.d are automatically included, just remove the line.

Please show output and contents of:
Bash:
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/official-package-repositories.list
Code:
└─$ ls /etc/apt/sources.list.d/
brave-browser-release.list  official-package-repositories.list  spotify.list

Code:
└─$ cat /etc/apt/sources.list.d/official-package-repositories.list
# deb http://packages.linuxmint.com faye main upstream import backport 

# deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
# deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
# deb http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware
# 
# deb https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

deb [arch=amd64] http://127.0.0.1/debian bookworm main contrib non-free non-free-firmware
deb [arch=amd64] http://127.0.0.1/debian bookworm-updates main contrib non-free non-free-firmware
deb [arch=amd64] http://127.0.0.1/debian bookworm-backports main contrib non-free non-free-firmware
 
I think with your current setup the /etc/apt/sources.list.d/official-package-repositories.list should look like this:

Bash:
deb [arch=amd64] http://127.0.0.1/debian bookworm main

Test with that (remove other lines) but also make sure to remove the line:
/etc/apt/sources.list.d/official-package-repositories.list (END) from your sources.list because it's not needed and may only confuse apt
 
I think with your current setup the /etc/apt/sources.list.d/official-package-repositories.list should look like this:

Bash:
deb [arch=amd64] http://127.0.0.1/debian bookworm main

Test with that (remove other lines) but also make sure to remove the line:
/etc/apt/sources.list.d/official-package-repositories.list (END) from your sources.list because it's not needed and may only confuse apt
that doesn't work for me:

Code:
└─$ sudo apt update                                                    
Holen:1 http://127.0.0.1/debian bookworm InRelease [151 kB]
OK:2 http://repository.spotify.com stable InRelease
OK:3 https://brave-browser-apt-release.s3.brave.com stable InRelease
Holen:4 http://127.0.0.1/debian bookworm/main amd64 Packages [8.786 kB]
Holen:5 http://127.0.0.1/debian bookworm/main Translation-en [6.109 kB]
Holen:6 http://127.0.0.1/debian bookworm/main Translation-de_DE [830 B]
Holen:7 http://127.0.0.1/debian bookworm/main Translation-de [1.748 kB]
Holen:8 http://127.0.0.1/debian bookworm/main amd64 DEP-11 Metadata [4.492 kB]
Holen:9 http://127.0.0.1/debian bookworm/main amd64 Contents (deb) [11,6 MB]
Ign:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
Fehl:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
  404  Not Found [IP: 127.0.0.1 80]
Ign:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
Fehl:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
  404  Not Found [IP: 127.0.0.1 80]
Es wurden 151 kB in 1 s geholt (110 kB/s).
Paketlisten werden gelesen… Fertig
E: Fehlschlag beim Holen von http://127.0.0.1/debian/dists/bookworm/main/Contents-all 404  Not Found [IP: 127.0.0.1 80]
E: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.
 
@tinfoil-hat
I think I spotted something,

It should be deb [arch=amd64] http://127.0.0.1/debian/ bookworm main

Instead of: deb [arch=amd64] http://127.0.0.1/debian bookworm main

You're missing /
 
I think your apt-miror is not correctly configured.

Are there any *.deb packages in your binary-amd64 directory?

Sorry don't know how to set up apt-miror.
I don't know if this is correct
Bildschirmfoto vom 2024-04-20 17-05-52.png
 
@tinfoil-hat
I think I spotted something,

It should be deb [arch=amd64] http://127.0.0.1/debian/ bookworm main

Instead of: deb [arch=amd64] http://127.0.0.1/debian bookworm main

You're missing /
still no luck
Code:
└─$ sudo apt update
Holen:1 http://127.0.0.1/debian bookworm InRelease [151 kB]
OK:2 http://repository.spotify.com stable InRelease                                               
OK:3 https://brave-browser-apt-release.s3.brave.com stable InRelease                              
Holen:4 http://127.0.0.1/debian bookworm/main amd64 Packages [8.786 kB]
Holen:5 http://127.0.0.1/debian bookworm/main Translation-de [1.748 kB]
Holen:6 http://127.0.0.1/debian bookworm/main Translation-en [6.109 kB]
Holen:7 http://127.0.0.1/debian bookworm/main Translation-de_DE [830 B]
Holen:8 http://127.0.0.1/debian bookworm/main amd64 DEP-11 Metadata [4.492 kB]
Holen:9 http://127.0.0.1/debian bookworm/main amd64 Contents (deb) [11,6 MB]
Ign:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
Fehl:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
  404  Not Found [IP: 127.0.0.1 80]
Ign:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
Fehl:10 http://127.0.0.1/debian bookworm/main all Contents (deb)
  404  Not Found [IP: 127.0.0.1 80]
Es wurden 151 kB in 1 s geholt (109 kB/s).
Paketlisten werden gelesen… Fertig
E: Fehlschlag beim Holen von http://127.0.0.1/debian/dists/bookworm/main/Contents-all 404  Not Found [IP: 127.0.0.1 80]
E: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.
                                                                                                                                                                                                
┌──(anon㉿x260)-[~]
└─$ cat /etc/apt/sources.list.d/official-package-repositories.list 
# deb http://packages.linuxmint.com faye main upstream import backport 

# deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
# deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
# deb http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware
# 
# deb https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

# deb [arch=amd64] http://127.0.0.1/debian bookworm main contrib non-free non-free-firmware
# deb [arch=amd64] http://127.0.0.1/debian bookworm-updates main contrib non-free non-free-firmware
# deb [arch=amd64] http://127.0.0.1/debian bookworm-backports main contrib non-free non-free-firmware

deb [arch=amd64] http://127.0.0.1/debian/ bookworm main
 
Your apt-miror does not have this directory Contents-all, that's why apt is complaining with 404, not found.
what should i do different instead running apt-mirror?
 
here's my mirror.list
Code:
############# config ##################
#
# set base_path    /var/spool/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     4
set _tilde 0
#
############# end config ##############

# deb http://ftp.us.debian.org/debian unstable main contrib non-free
# deb-src http://ftp.us.debian.org/debian unstable main contrib non-free

# deb http://packages.linuxmint.com faye main upstream import backport 

deb https://deb.debian.org/debian bookworm main contrib non-free # non-free-firmware
# deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
# deb http://security.debian.org/ bookworm-security main contrib non-free non-free-firmware

# deb https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

# mirror additional architectures
#deb-alpha http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-amd64 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-armel http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-hppa http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-i386 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-ia64 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-m68k http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-mips http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-mipsel http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-powerpc http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-s390 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-sparc http://ftp.us.debian.org/debian unstable main contrib non-free

clean http://ftp.us.debian.org/debian
 
I'm not sure how apt-miror config should look like but if you take a loo at official debian's repo you see a file called Contents-all.gz should exist in 127.0.0.1/debian/dists/bookworm/main/ but it doesn't exist in your case, that's what the error is about.

This is a compressed text file containing paths to packages.
 
Maybe someone else knows how to create a proper offline mirror :(
 
See this docs, it might help with some clues:
 
See this docs, it might help with some clues:
I already looked over this, I couldn't discover anything useful in my case
 

Staff online

Members online


Top