Skip to content

Instantly share code, notes, and snippets.

@AysadKozanoglu
Created December 9, 2019 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AysadKozanoglu/fe1fa419a1c09e9974acb516473549b8 to your computer and use it in GitHub Desktop.
Save AysadKozanoglu/fe1fa419a1c09e9974acb516473549b8 to your computer and use it in GitHub Desktop.
apt mirror config
#!/bin/sh
# Author: Aysad Kozanoglu
# Dists: debian 9, 10 (stretch buster)
# ubuntu 18 and above
which apt-get && apt-get install -y --yes apt-mirror || apt install apt-mirror -y --yes
apt-mirror
# file: /etc/apt/mirror.list
#
############# config ##################
#
# mkdir -p /mnt/mirror/debian
set base_path /mnt/mirror/debian
#
# 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 ##############
## pardus ondokuz
deb http://depo.pardus.org.tr/guvenlik ondokuz/updates main non-free contrib
deb-src http://depo.pardus.org.tr/guvenlik ondokuz/updates main non-free contrib
## Debian buster
deb-amd64 http://ftp2.de.debian.org/debian/ buster main
deb-amd64 http://security.debian.org/debian-security buster/updates main # contrib non-free
## Debian Stretch
# BASE
deb-amd64 http://ftp2.de.debian.org/debian/ stretch main
deb-amd64 http://security.debian.org/debian-security stretch/updates main # contrib non-free
#deb-amd64 http://ftp2.de.debian.org/debian/ stretch-updates main
## OLD Versions
## Debian Jessie
# BASE
#deb-amd64 http://ftp2.de.debian.org/debian/ jessie main
#deb-amd64 http://security.debian.org/debian-security jessie/updates main
#deb-amd64 http://ftp2.de.debian.org/debian/ jessie-updates main
## Ubuntu 16.04
# BASE
#deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
#deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
#deb http://archive.ubuntu.com/ubuntu/ xenial universe
#deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe
#deb http://archive.ubuntu.com/ubuntu/ xenial multiverse
#deb http://archive.ubuntu.com/ubuntu/ xenial-updates multiverse
#deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
#deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted
#deb http://security.ubuntu.com/ubuntu/ xenial-security universe
#deb http://security.ubuntu.com/ubuntu/ xenial-security multiverse
# Cleanup old packages
#clean http://ftp2.de.debian.org/debian
#clean http://archive.ubuntu.com/ubuntu
#clean http://security.ubuntu.com/ubuntu
#
# vim /etc/nginx/sites-enabled/default
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /mnt/mirror/debian/mirror/ftp2.de.debian.org;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
autoindex on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment