基本上就是處理下面三種需要網路的操作 - online$: 表示在有對外網路的主機操作 - offline$: 表示在無對外網路的主機操作 - 如何把檔案存放到你的 offline 主機,因環境各異,請自行處理 - 會依 offline 主機的 source list 取得更新,與 online 主機的設定無關 ### Install apt-offline ``` online$ sudo apt-get install apt-offline ``` - 到 (https://pkgs.org/download/apt-offline) 取得符合你環境的 deb 檔 - 需要 python 環境,請勿移除。 ``` offline$ sudo dpkg -i apt-offline_1.8.1_all.deb ``` ### apt update ``` offline$ sudo apt-offline set --update update.sig online$ apt-offline get update.sig --threads 5 --bundle update.zip offline$ sudo apt-offline install update.zip ``` - 檔名可自由取名 ### apt upgrade ``` offline$ sudo apt-offline set --upgrade update.sig online$ apt-offline get upgrade.sig --threads 5 --bundle update.zip offline$ sudo apt-offline install upgrade.zip offline$ sudo apt-get upgrade ``` - 檔名可自由取名 - 不能使用 apt,要用 apt-get ### apt install ``` offline$ sudo apt-offline set install.sig --install-packages apache2 libapache2-mod-php online$ apt-offline get install.sig --threads 5 --bundle install.zip offline$ sudo apt-offline install install.zip offline$ sudo apt-get install apache2 libapache2-mod-php ```