This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:aptoffline [2023/02/08 01:51] – olaf | linux:aptoffline [2023/02/12 17:16] (current) – olaf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Create a repository to update an offline system | ||
| + | |||
| + | When running a Debian system (Debian, Ubuntu, Cumulus, ...) without internet connection, it cannot receive upgrades with '' | ||
| + | But with any Debian based system that is online, it is possible to download the required packages and dependencies (!). | ||
| + | |||
| + | Maybe the source for the latest required repository changed. Therefore, it might be needed to update / | ||
| + | |||
| + | '' | ||
| + | try on a non-production system first. Using '' | ||
| + | |||
| + | Create the required directory structure on the online and offline system | ||
| + | |||
| + | <code bash> | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | </ | ||
| + | Copy following files from the offline system to / | ||
| + | |||
| + | <code bash> | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | On the **offline** system create the file ''/ | ||
| + | <code bash> | ||
| + | cat > / | ||
| + | APT | ||
| + | { | ||
| + | Get:: | ||
| + | }; | ||
| + | |||
| + | Dir | ||
| + | { | ||
| + | /* point to the file containing the current versions */ | ||
| + | State "/ | ||
| + | State:: | ||
| + | |||
| + | /* set cache location */ | ||
| + | Cache:: | ||
| + | |||
| + | /* point to the configuration directory */ | ||
| + | Etc "/ | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | Close cat with < | ||
| + | |||
| + | On the **online** system create a similar file ''/ | ||
| + | <code bash> | ||
| + | cat > / | ||
| + | APT | ||
| + | { | ||
| + | Get:: | ||
| + | }; | ||
| + | |||
| + | Dir | ||
| + | { | ||
| + | /* point to the file containing the current versions */ | ||
| + | State "/ | ||
| + | State:: | ||
| + | |||
| + | /* set cache location */ | ||
| + | Cache:: | ||
| + | |||
| + | /* point to the configuration directory */ | ||
| + | Etc "/ | ||
| + | }; | ||
| + | |||
| + | </ | ||
| + | Close cat with < | ||
| + | ==== Create the repository on the online system ==== | ||
| + | |||
| + | <code bash> | ||
| + | export APT_CONFIG="</ | ||
| + | apt-get update | ||
| + | apt-get --no-download dist-upgrade | ||
| + | </ | ||
| + | |||
| + | When apt is finished downloading, | ||
| + | ==== Upgrade the offline system ==== | ||
| + | <code bash> | ||
| + | export APT_CONFIG="</ | ||
| + | apt-get check | ||
| + | apt-get dist-upgrade | ||
| + | </ | ||
| + | |||