Last active
December 12, 2024 23:14
-
-
Save linuxluser/3af5fd16dde41b82972a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
## Making a local repository | |
# | |
PKGS_DIR=/home/linuxluser/pkgs/ | |
BASE_DIR=/tmp/repo | |
SUITE=jessie | |
COMPONENT=main | |
mkdir $BASE_DIR | |
cd $BASE_DIR | |
mkdir pool | |
cp $PKGS_DIR/*.deb ./pool/ | |
mkdir -p ./dists/$SUITE/$COMPONENT/binary-amd64 | |
dpkg-scanpackages pool /dev/null | gzip -9c > dists/$SUITE/$COMPONENT/binary-amd64/Packages.gz | |
# prepend line to sources.list so local repo takes precedence against foreign packages of the same name+version | |
sed -i "1i deb file://$BASE_DIR $SUITE $COMPONENT" /etc/apt/sources.list | |
apt-get update |
Doesn't work because as a copy of the USB linux install drive, pkgs/ will not have *deb files on it.
This gist was intended to be used on a live system. If you want the resulting local repo to on the installer image and available during an install, you'll have to do more than what's here.
Probably a better idea than this gist is to use the aptly tool, which is a lot better at making and managing Debian repos. Create a repo using aptly on a separate server and then use a preseed file in your install which sets up this server as another repository. At that point, you can also add custom packages to get install using the preseed, etc. It's a lot easier to do this than to manipulate the installer image by adding files to it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't work because as a copy of the USB linux install drive, pkgs/ will not have *deb files on it.