LoginSignup
4
3

More than 5 years have passed since last update.

Using apt-get at offline environment

Posted at

Prerequisites

  • Prepare a Ubuntu running machine which is online
  • Preferably better to build a online machine exactly the same as offline machine

Procedures at online machine

  • First, install whatever software you want to install to the online machine
  1. Delete all .deb files at /var/cache/apt/archives
    sudo apt-get clean

  2. Confirm .deb files are not present at /var/cache/apt/archives
    ls /var/cache/apt/archives

  3. Install whatever software you want to install
    sudo apt-get install cacti

  4. confirm .deb files are present at /var/cache/apt/archives
    ls /var/cache/apt/archives

  5. Compress /var/chache/apt/archives to archives.tar.gz
    sudo tar -cvzf archives.tar.gz /var/cache/apt/archives

  6. Copy archives.tar.gz from online machine to the offline machine via USB memory or whatever

Procedures at offline machine

  • Copy the .deb files from online machine to offline machine
  1. Uncompress archives.tar.gz
    sudo tar -xvzf archives.tar.gz

  2. Create your own repository and compress it to Packages.gz
    sudo apt-ftparchive packages . | gzip > Packages.gz

  3. Add directory to Packages.gz and comment out all other deb sources.(Or delete all other deb sources)
    sudo vi /etc/apt/sources.list
    + deb file:///home/user/ ./

  4. Update your packages
    sudo apt-get update

  5. Install the software
    sudo apt-get install cacti

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3