Debian repository mirroring

I’m working on Dark site and would like to install grafana from a local repository which will be asynchronously mirrored from official repo.

Unfortunately it seems apt-mirror is not able to grab full repository by adding source into mirror.list file, only indexes are generated.

What is the right way to sync grafana OSS repository and get a fully working local repo ?

Sorry for digging up dead threads, but I’m also encountering an issue to mirror the repository.
Did you find a solution for that @furydonnico?

The problem is:
The repository according to the documentation is https://apt.grafana.com stable main.
debmirror, unlike the usual browsers, gets a redirect from apt.grafana.com to grafana-packages.storage.googleapis.com which returns a HTTP 403:

Getting meta files ...
[ 0%] Getting: dists/stable/Release... #** GET ``https://apt.grafana.com/./dists/stable/Release`` ==> 302 Found
** GET ``https://grafana-packages.storage.googleapis.com/deb/dists/stable/Release`` ==> 403 Forbidden
Download of dists/stable/Release failed: 403 Forbidden

Hi @sc-alex

The log shows apt.grafana.com redirecting to grafana-packages.storage.googleapis.com, which then returns 403 to debmirror. To find out whether that’s debmirror or your network, run this from the same machine:

curl -sSL -o /dev/null -w "%{http_code} %{url_effective}\n"  https://apt.grafana.com/dists/stable/Release

200: the problem is specific to how debmirror makes the request. Compare its proxy settings with what curl is using.
403: check whether a proxy or firewall is blocking storage.googleapis.com. Both hosts must be reachable from the mirror machine. If nothing is blocking it, the 403 is coming from the server side.

If you only need Grafana installable on the dark site, you can skip the full mirror:

On a connected machine with the Grafana repo configured, run apt-get download grafana.
Copy the .deb across and build a minimal local repo (dpkg-scanpackages is in the dpkg-dev package):

   mkdir repo && cp grafana_*.deb repo/
   cd repo && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

On the client, add deb [trusted=yes] file:/path/to/repo ./ to your apt sources, then run apt update && apt install grafana.

Any Grafana dependencies not already installed on the client will need to come from your distro’s repositories.