/usr/local/bin/update-mirrorlist
#!/usr/bin/env bash
#This script gets the most updated mirrorlists from archlinux.org
#Then runs rankmirrors, taking the 10 fastest mirrors
#mReschke 2011-03-23
#Backup oroginal mirrorlist
cp /etc/pacman.d/{mirrorlist,mirrorlist.before-update}
#Get the most up-to-date mirrorlists from archlinux.org (USA)
#Go here to do it manually: www.archlinux.org/mirrorlist/
curl "http://www.archlinux.org/mirrorlist/?country=United+States&protocol=ftp&protocol=http&ip_version=4&use_mirror_status=on" > /tmp/mirrorlist
#Remove main mirrorlist
#sed -i s/"#Server = ftp:\/\/ftp.archlinux.org\/\$repo\/os\/\$arch"//g /tmp/mirrorlist
#Remove comments from list
sed -i s/#Server/Server/g /tmp/mirrorlist
#Rankmirror (get top 10 fastest mirrors)
#Actually I think its already ranked by archlinux.org when generated
rankmirrors -n 10 /tmp/mirrorlist > /tmp/mirrorlist.ranked
#Write new mirrorlist
#echo 'Server = ftp://ftp.archlinux.org/$repo/os/$arch' > /etc/pacman.d/mirrorlist
cat /tmp/mirrorlist.ranked | grep -v Score > /etc/pacman.d/mirrorlist
#Cleanup
rm /tmp/{mirrorlist,mirrorlist.ranked}
/etc/pacman.conf
[archlinuxfr]
Server = http://repo.archlinux.fr/$arch
/etc/pacman.conf
SyncFirst = pacman pacman-color yaourt package-query
/etc/pacman.conf
XferCommand = /usr/bin/aria2c --allow-overwrite=true -c --file-allocation=none --log-level=error -m2 --max-connection-per-server=2 --max-file-not-found=5 --min-split-size=5M --no-conf --remote-time=true --summary-interval=60 -t5 -d / -o %o %u
2023-11-24 12:51:30 toor@linstore in /etc/nginx/sites-enabled
ooo $ cat pacman-cache.conf
# Pacman Cache
# mReschke 2020-04-23
server {
listen 80;
server_name pacman-cache.mreschke.net;
root /store/data/cache/pacman;
autoindex on;
# Requests for package db, signature files and files db should redirect upstream without caching
location ~ \.(db|sig|files)$ {
proxy_pass http://pacman_mirrors$request_uri;
}
# Requests for actual packages should be served directly from cache if available.
# If not available, retrieve and save the package from an upstream mirror.
location ~ \.tar\.(xz|zst)$ {
try_files $uri @pkg_mirror;
}
# Retrieve package from upstream mirrors and cache for future requests
location @pkg_mirror {
proxy_store on;
proxy_redirect off;
proxy_store_access user:rw group:rw all:r;
proxy_next_upstream error timeout http_404;
proxy_pass http://pacman_mirrors$request_uri;
}
}
# Upstream Arch Linux Mirrors
# - Configure as many backend mirrors as you want in the blocks below
# - Servers are used in a round-robin fashion by nginx
# - Add "backup" if you want to only use the mirror upon failure of the other mirrors
# - Use separate mirror server blocks to be able to use mirrors that have different paths to the package repos
upstream pacman_mirrors {
server 127.0.0.1:8001;
server 127.0.0.1:8002 backup;
server 127.0.0.1:8003 backup;
}
# If you want to use an official mirror from /etc/pacman.d/mirrorlist like
# http://mirror.domain.example/path/to/repo/$repo/os/$arch
#
# the proxy_pass directive should look like this
# proxy_pass http://mirror.domain.example/path/to/repo$request_uri;
#
# Notice that $request_uri replaces the /$repo/os/$arch part of
# the mirror address. See more examples below.
# To update this list, goto a manjaro machine and run
# pacman-mirrors --geoip and look in /etc/pacman.d/mirrorlist
# Change your /etc/pacman.d/mirrorlist to this
# Server = http://pacman.mreschke.net:8080/manjaro/stable/$repo/$arch
# Edit /etc/pacman-mirrors.conf and set NoUpdate=True to disable autogeneration from systemd
# See https://repo.manjaro.org/ for updated mirrors, pick HTTP, sort by stable, ones with /manjro in path
# You must pick an HTTP mirror. I tried HTTP and it doesn't even use the already cached file let alone save the cache
# Arch Mirror 1
server
{
listen 127.0.0.1:8001;
location / {
proxy_pass http://repo.ialab.dsu.edu$request_uri;
}
}
# Arch Mirror 2
server
{
listen 127.0.0.1:8002;
location / {
#proxy_pass http://mirror.futureweb.be$request_uri;
proxy_pass http://repo.ialab.dsu.edu$request_uri;
}
}
# Arch Mirror 3
server
{
listen 127.0.0.1:8003;
location / {
#proxy_pass https://mirror.math.princeton.edu$request_uri;
proxy_pass http://mirrors.gigenet.com$request_uri;
}
}