Last active
October 23, 2024 17:27
-
-
Save piaverous/35c7900716ba107ecae28017b0896402 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://fr.archive.ubuntu.com/ubuntu/ bionic main restricted | |
# # Major bug fix updates produced after the final release of the | |
# # distribution. | |
deb http://fr.archive.ubuntu.com/ubuntu/ bionic-updates main restricted |
This file contains hidden or 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
# Download Aptly | |
wget https://github.com/aptly-dev/aptly/releases/download/v1.4.0/aptly_1.4.0_linux_amd64.tar.gz | |
tar -xzf aptly_1.4.0_linux_amd64.tar.gz | |
# Move Aptly into your PATH | |
sudo mv aptly_1.4.0_linux_amd64/aptly /usr/bin/aptly |
This file contains hidden or 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
# Create a local Ubuntu mirror | |
aptly mirror -architectures="amd64" create ubuntu-bionic http://fr.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse | |
# Update your local mirror | |
aptly mirror update ubuntu-bionic |
This file contains hidden or 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
aptly snapshot create my-ubuntu-snapshot from mirror ubuntu-bionic |
This file contains hidden or 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
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install docker-ce docker-ce-cli containerd.io |
This file contains hidden or 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
# Generate a GPG key | |
gpg --full-generate-key | |
# You should get an output looking like this | |
----------------------------------- | |
sec rsa3072 2020-06-25 [SC] | |
305D2741842C85E88FAEFE57EDE7437687457710 | |
uid Pierre A <[email protected]> | |
ssb rsa3072 2020-06-25 [E] |
This file contains hidden or 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
aptly publish \ | |
snapshot \ | |
-distribution="bionic" \ | |
-architectures="amd64" \ | |
-gpg-key="305D2741842C85E88FAEFE57EDE7437687457710" \ | |
my-ubuntu-snapshot |
This file contains hidden or 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
public | |
├── dists | |
│ └── bionic | |
└── pool | |
└── main | |
├── 0 | |
├── 2 | |
. | |
. | |
├── v | |
├── w | |
├── x | |
├── y | |
└── z |
This file contains hidden or 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
server { | |
listen 80; | |
server_name my.debian.mirror.domain.name; | |
access_log /var/log/nginx/packages-error.log; | |
error_log /var/log/nginx/packages-error.log; | |
location / { | |
root /home/pierre/.aptly/data/public; | |
index index.html; | |
autoindex on; | |
} | |
} |
This file contains hidden or 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
gpg --armor --output ~/.aptly/data/public/gpg --export 305D2741842C85E78FAEFE57EDE7437687457710 |
This file contains hidden or 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
# Trust your mirror's public key | |
wget -O - -q http://my.debian.mirror.domain.name/gpg | sudo apt-key add - | |
# Add your Debian mirror to source list | |
echo 'deb http://my.debian.mirror.domain.name/ bionic main' | sudo tee -a /etc/apt/sources.list | |
# Update apt cache | |
sudo apt update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment