apt-mirror
Download neccessary packages
apt install apt-mirror dpkg-dev apache2
Edit your /etc/apt/mirror.list
############# 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 amd64 set nthreads 20 set _tilde 0
#
############# end config ##############
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main
clean http://deb.debian.org/debian
run apt-mirror
apt-mirror
Symlink to webroot
ln -s /var/spool/apt-mirror/mirror/deb.debian.org/debian/ /var/www/html/debian
ln -s /var/spool/apt-mirror/mirror/security.debian.org/debian-security /var/www/html/debian-security
Check the contents of /var/www/html/debian
root@mirror:~# ls -l /var/www/html/
total 16
lrwxrwxrwx 1 root root 51 Jan 15 20:17 debian -> /var/spool/apt-mirror/mirror/deb.debian.org/debian/
lrwxrwxrwx 1 root root 65 Jan 15 20:32 debian-security -> /var/spool/apt-mirror/mirror/security.debian.org/debian-security/
Create the Repository Metadata
cd /var/www/html/debian && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
Create a Release File
dpkg-scanpackages . /dev/null > Release
Configure your clients /etc/apt/sources.list
make sure you edit your ip address
deb http://192.168.178.101/debian bookworm main contrib non-free non-free-firmware
deb http://192.168.178.101/debian bookworm-updates main contrib non-free non-free-firmware
deb http://192.168.178.101/debian-security bookworm-security main
apt update
root@apt-mirror-client:~# tmux
-bash: tmux: command not found
root@apt-mirror-client:~# apt update
Hit:1 http://192.168.178.101/debian bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@apt-mirror-client:~# apt install tmux
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libevent-core-2.1-7 libutempter0
The following NEW packages will be installed:
libevent-core-2.1-7 libutempter0 tmux
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 595 kB of archives.
After this operation, 1493 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://192.168.178.101/debian bookworm/main amd64 libevent-core-2.1-7 amd64 2.1.12-stable-8 [131 kB]
Get:2 http://192.168.178.101/debian bookworm/main amd64 libutempter0 amd64 1.2.1-3 [8960 B]
Get:3 http://192.168.178.101/debian bookworm/main amd64 tmux amd64 3.3a-3 [455 kB]
Fetched 595 kB in 0s (15.1 MB/s)
Selecting previously unselected package libevent-core-2.1-7:amd64.
(Reading database ... 21363 files and directories currently installed.)
Preparing to unpack .../libevent-core-2.1-7_2.1.12-stable-8_amd64.deb ...
Unpacking libevent-core-2.1-7:amd64 (2.1.12-stable-8) ...
Selecting previously unselected package libutempter0:amd64.
Preparing to unpack .../libutempter0_1.2.1-3_amd64.deb ...
Unpacking libutempter0:amd64 (1.2.1-3) ...
Selecting previously unselected package tmux.
Preparing to unpack .../archives/tmux_3.3a-3_amd64.deb ...
Unpacking tmux (3.3a-3) ...
Setting up libevent-core-2.1-7:amd64 (2.1.12-stable-8) ...
Setting up libutempter0:amd64 (1.2.1-3) ...
Setting up tmux (3.3a-3) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u9) ...
root@apt-mirror-client:~#
No Comments