Solved Apt Mirror

Solved issue


I've followed this one https://unix.stackexchange.com/ques...epository-with-sub-repositories-main-non-free, here's my mirror.sh

Code:
#!/bin/bash

# sourcehost: choose a mirror in your proximity!
HOST=ftp.us.debian.org;

# destination directory
DEST=/srv/dists/bookworm/localmirror

# Debian version(s) to mirror
DIST=bookworm

# architecture, use what is applicable here.
ARCH=amd64

# log timestamp
logger -t mirror[$$] updating Debian mirror

su mirror -c \
"debmirror ${DEST} \
 --nosource \
 --host=${HOST} \
 --root=/localmirror \
 --dist=${DIST} \
 --section=main,non-free \
 --i18n \
 --arch=${ARCH} \
 --passive --cleanup \
 $VERBOSE"

logger -t mirror[$$] finished updating Debian mirror
let's see if it works
 
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 agree:-
When our sources list isn't correct it will cause conflict.
 
It would be wise to get your sources list edited correctly first before proceeding with other tasks.
Those instructions in the Unix & Linux link are good however it's a bit dated.
Your cronjob looks good:-:)

Make sure you add this to your sources list: EDIT (debmirror.example.com with what you need) That's just an example.
Don't forget to update APT.

Code:
deb http://debmirror.example.com/localmirror/ bookworm main contrib non-free

Let us know how it goes--
 
Last edited:
Maybe someone else knows how to create a proper offline mirror :(
It's essential that your sources.list is edited correctly otherwise you are going to have conflict.
Also, your configuration for you mirrors list only has one entry un-commented.
Some of those mirrors in post # 15 may need to be un-commented as well. That is if you need/want additional updates and the like for other architectures.

Our member @osprey is very well versed with Debian.
I suggest you wait for osprey.
 
Last edited:
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
As GatorsFan said: "[arch=amd64]" should not be part of the entry in your sources list coming from the 127.0.0.1 repo's.
 
What comes to mind about the failure to see: http://127.0.0.1 , is that it's a file on the system, and may actually need to be designated: file:///<some-path-to-directory>

And on the forward slash in the sources.list mentioned in post #10, it's not necessary. See the example here:
 
Last edited:
Hmm...

The rest of this is outside of what I've played with. Even a local mirror needs bandwidth to download the updates - and it will download a whole lot more as it downloads software you don't have installed - as far as I know.

But, where there's the debate with the address, I wonder if https://localhost/foo would be more appropriate. That's clearly a DNS entry that's well understood by many systems and will work regardless of https, https, IPv4, or even IPv6. Well, it should, assuming you've not mucked about with /etc/hosts.
 
KGIII wrote:
I wonder if https://localhost/foo would be more appropriate

Here are some results.
In the URL box in the browser, firefox in this case, the following outputs appear:


Code:
Unable to connect

An error occurred during a connection to localhost.

    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer’s network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the web.
                                                                               Try Again

file:///home/tom

Code:
Up to higher level directory

Show hidden objects
              
Name                                Size     Last Modified
.Xauthority                          1 KB    26/12/23  06:59:27 AEDT
.Xdefaults                           2 KB    8/2/24  20:35:31 AEDT
.bash_history                       13 KB    20/4/24 22:46:30 AEST
.bash_history-01397.tmp             13 KB    20/4/24 22:46:30 AEST
<snip>

It's happier with the file designation, which may be the case for the OP. Yet to see.
 
could anyone walk me through this? it seems very complicated. I don't want to make mistakes, since I'd download over 100GB with each try
Yes it is a bit complicated but it can be done.
You must get your sources list correct first and fore most. Tend to that first.

Before you installed deb-mirror did you create a directory to save the files to?

Do not use your own scripts, and do not just use single-pass rsyncs--
Once the mirror is set up, it should be registered with Debian in order to get included in the official mirror list.

 
Yet to see.

My thinking is that it's running DNS and not looking for paths on your drive but looking for paths on a server.

Generally speaking 127.0.0.1 == localhost, which sometimes works better than an IP address.

A better test would be ssh localhost, assuming one has ssh configured on that machine.
 
My thinking is that it's running DNS and not looking for paths on your drive but looking for paths on a server.

Generally speaking 127.0.0.1 == localhost, which sometimes works better than an IP address.

A better test would be ssh localhost, assuming one has ssh configured on that machine.
As I understand it, the OP is creating the mirror on his own machine, and the files at 127.0.0.1 shown in the post #1 are the locations on the machine for the repos.
 
As I understand it, the OP is creating the mirror on his own machine, and the files at 127.0.0.1 shown in the post #1 are the locations on the machine for the repos.
OP created an alias for apache2.
Would this be for a server or his host machine?
 
seems like I am on a kind of blacklist when I tried to download via script above. I can't even upgrade from my main workstation without vpn anymore
 
LOL Maybe you triggered some sort of bot protection as they didn't want you downloading the entire mirror's worth of software.

Bandwidth is fairly cheap these days, but good bandwidth is still pricey. Someone is paying for that bandwidth for every page you visit and whatever you download.
 
I think my post #13 has been overlooked, there is an error message that is very clear but was not addressed.
 
I think my post #13 has been overlooked, there is an error message that is very clear but was not addressed.
I have seen this, but when I asked, how to proper download the mirror, so I get the right folder structure, no one gave me an solution
 
I think my post #13 has been overlooked, there is an error message that is very clear but was not addressed.
I had to use Google Translate.
Fehlschlag beim Holen von means "failed to get from" in post #13.

It looks like there is a missing file, whatever is in that tar/gz is not there.
 

Members online


Top