Created
April 23, 2023 19:28
-
-
Save james-see/a1c1c6fb3dd3a4e670525b58d37f3bf2 to your computer and use it in GitHub Desktop.
download package dependancies and get them ready to deploy offline
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
#!/bin/bash | |
# Convoy downloads the stuff you need per package name for debian/ubuntu | |
# Requirements: dpkg-dev | |
# Example: ./convoy.sh python3-pip | |
get list of dependancies and download | |
sudo apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances "$1" | grep "^\w" | sort -u) | |
# create necessary Packages.gz file | |
sudo dpkg-scanpackages . | gzip -9c > Packages.gz | |
# gzipped all of it and ready | |
tar czvf convoyed.tar.gz . | |
On target machine run the following: | |
# echo "deb [trusted=yes] file:<your folder here> ./ | sudo tee -a /etc/apt/sources.list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated for rhel too: