Skip to content

Instantly share code, notes, and snippets.

@MahdadGhasemian
Last active March 30, 2026 13:38
Show Gist options
  • Select an option

  • Save MahdadGhasemian/737aae692a2001e687b2340d86bc36d0 to your computer and use it in GitHub Desktop.

Select an option

Save MahdadGhasemian/737aae692a2001e687b2340d86bc36d0 to your computer and use it in GitHub Desktop.
Working in Restricted Networks: Proxies, APT, Docker & Offline Installs

Working in Restricted Networks: Proxies, APT, Docker & Offline Installs


🌐 APT Proxy

⚠️ TODO: Add configuration for HTTP/HTTPS proxy in APT (/etc/apt/apt.conf.d/)


🐳 Docker Proxy

⚠️ TODO: Add systemd-based proxy configuration for Docker daemon


πŸ’» Terminal Proxy

⚠️ TODO: Add environment variable setup (http_proxy, https_proxy, etc.)


πŸ“¦ Offline Package Installation Using apt-rdepends

This guide shows how to download a package with all its dependencies on an online machine and install it later on an offline system.

🧠 Overview

We will:

  1. Use apt-rdepends to list all dependencies
  2. Download all required .deb files
  3. Transfer them to an offline machine
  4. Install everything locally

🌐 Step 1: Prepare on ONLINE machine

  1. Update package index
sudo apt update
  1. Install apt-rdepends
sudo apt install apt-rdepends
  1. Create a working directory
mkdir ~/offline-packages
cd ~/offline-packages
  1. Download package + dependencies

Example for acl:

apt download $(apt-rdepends acl | grep -v "^ ")

πŸ” Explanation:

  • apt-rdepends acl β†’ lists all dependencies recursively
  • grep -v "^ " β†’ removes indented lines (keeps only package names)
  • apt download β†’ downloads .deb files without installing

πŸ’Ύ Step 2: Transfer to OFFLINE machine

Copy the directory:

~/offline-packages

πŸ“΄ Step 3: Install on OFFLINE machine

  1. Navigate to directory
cd ~/offline-packages
  1. Install all packages
sudo dpkg -i *.deb

⚠️ Handling Dependency Issues

If dpkg reports missing dependencies:

sudo apt install -f

Note: This may fail without internet if something was missed. Ensure all dependencies were downloaded.

πŸ§ͺ Tips

  • Verify architecture:
dpkg --print-architecture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment