APT Without Internet

by TheOuterLinux (https://theouterlinux.gitlab.io)

Last updated: 2024/07/07

[ Click to visit TheOuterLinux's 'Support Me' page ] [ QRCode ] [ RSS ]

Table of Contents

  1. APT Without Internet
  2. Grab APT download links
  3. apt-offline Method
    1. Step 01: Install 'apt-offline' package
    2. Step 02: Create "my.sig" on non-Internet computer
    3. Step 03: Copy "my.sig" to USB hard drive
    4. Step 04: Download DEB's

APT Without Internet

Use some of the following tips to help you get packages installed onto a system without working Internet.

Grab APT download links

To get a list of the links for DEB files to install all that you will need (hopefully) to get a package running, do something similar to the following in a terminal:

    
        sudo apt update
        sudo apt -qq --print-uris install wine | cut -d\' -f 2 > urls.txt
    

This will create a file called "urls.txt" in the current directory with all of the links of DEB files needed to install WINE. The contents of this file will look something like this:

    
        http://deb.debian.org/debian/pool/main/libs/libstb/libstb0_0.0%7egit20200713.b42009b%2bds-1_amd64.deb
        http://deb.debian.org/debian/pool/main/f/faudio/libfaudio0_21.02-1_amd64.deb
        http://deb.debian.org/debian/pool/main/v/vkd3d/libvkd3d1_1.1-5_amd64.deb
        http://deb.debian.org/debian/pool/main/w/wine/libwine_5.0.3-3_amd64.deb
        http://deb.debian.org/debian/pool/main/w/wine/wine64_5.0.3-3_amd64.deb
        http://deb.debian.org/debian/pool/main/w/wine/wine_5.0.3-3_all.deb
    

This way, you can easily download these packages on another computer if the current one does not have Internet access but was able to run 'sudo apt update' at least once. WGET can be ran from a list of URLs like so:

    
        wget -i urls.txt
    

You would then 'cd' into the directory with these packages and run:

    
        dpkg -i *.deb
    

...to install all of the packages.

apt-offline Method

You can also grab EVERYTHING from your APT-friendly distribution's repositories so that you never need to use the Internet to install software ever again, like so... Though, you will need a large hard drive for this.

Step 01: Install 'apt-offline' package

You will need to download the 'apt-offline' package on the computer with working Internet and install it to both computers. For example, if you are using a Debian-based (Bullseye) distro, you would look here: https://packages.debian.org/bullseye/apt-offline

Step 02: Create "my.sig" on non-Internet computer

On the computer without Internet, run the following in a terminal:

    
        sudo apt-offline set ~/my.sig
    

Step 03: Copy ~/my.sig to USB hard drive

Copy the "~/my.sig" file to a USB hard drive and mount that hard drive to the computer with working Internet.

Step 04: Download DEB's

On the computer with working Internet, run the following in a terminal:

    
        sudo apt-offline install "/path/to/downloaded/packages/folder"
    

...the "/path/to/..." part is where all of the DEBs are going to go.





Disclaimer