From 5d2741917669df2144f8fe59532152bfec373483 Mon Sep 17 00:00:00 2001 From: watts Date: Thu, 31 Oct 2024 06:21:52 +0100 Subject: [PATCH] Create SneakerNetUpdates --- .gitlab/redirects.yml | 1 + SneakerNetUpdates.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .gitlab/redirects.yml create mode 100644 SneakerNetUpdates.md diff --git a/.gitlab/redirects.yml b/.gitlab/redirects.yml new file mode 100644 index 0000000..2fbf0ff --- /dev/null +++ b/.gitlab/redirects.yml @@ -0,0 +1 @@ +--- {} diff --git a/SneakerNetUpdates.md b/SneakerNetUpdates.md new file mode 100644 index 0000000..a2d479b --- /dev/null +++ b/SneakerNetUpdates.md @@ -0,0 +1,39 @@ +Sometimes you need to install an extra package (or a hundred). If the machine is has access to the internet, then a simple `sudo apt-get install ` is all that is needed. However, it is not so simple when the machine doesn't have internet access. Here is a method for transferring the required package files with a USB drive. + +get initial package list: +`$apt-get --print-uris --yes install | grep ^\' | cut -d\' -f2 >downloads.list` + +Note that it will not append, so do it all in one go. + +Take downloads.list to an internet-accessible computer and run: +`$curl --remote-name-all $(cat downloads.list)` + +This will fill the current directory with downloaded .deb files. +Beware that when a file is not found, it will silently download an "error 404" html page into the *.deb file. You can recognise them by being smaller than 280 bytes. Try downloading them from a different repository. + +Move the *.deb to the target PC and copy to: +`/var/cache/apt/archives/` + +Run on target: +`$sudo apt-get --no-download --fix-missing install ` + +if there are still missing dependencies, then make a list and run them through the above steps to download the extra packages. Continue recursively until it decides to actually do the install. + +If there are errors, some packages might get stuck with complaints about missing dependencies. +Run this to fix what is fixable and to see a list of remaining problems: +`$sudo apt-get --no-download --fix-missing --fix-broken install` + +Run this to make a list of further packages to download: +`$apt-get --print-uris --yes --fix-missing --fix-broken install | grep ^\' | cut -d\' -f2 >downloads.list` + +Problems packages are listed together with the missing deps. Run the following command to try to fix the issue by force-installing the set all at once: +`$sudo dpkg -i ` + +If the above command produces further errors (e.g. a dep having further deps), then just add the further sub-deps to the same command (note that order is not important): +`$sudo dpkg -i ` + +If you can't find the exact .deb file that was asked for, then you can substitute another .deb file for the same package, version and architecture. +e.g. python3-numpy_1.24.2-1_amd64.deb > python3-numpy_1.24.2-1+deb12u1_amd64.deb +Here, the addition of +deb12u1 is indicating that the package is for Debian Linux version 12, update 1. + +