Technology

How to Update Linux Machine and Install Apache Server in an Air-Gapped Network. (Part -1)

As we know In Air-Gapped Network has no internet connectivity, and all the communication takes place between sites and devices using private IP addresses. If we want to update or install any package on a Linux machine it is not a big hurdle for us, if the machine is connected to the Internet. But suppose, one day your boss gives you a task to update and install an Apache server on a Linux machine that is placed in the air-gaped network. You cannot connect to the Internet to that PC, and you do not know how to install and update Linux without the Internet. It is a big nightmare for you. There are several solutions to overcome this nightmare. In this blog, we will use apt-offline to overcome this problem.

Requirements

These are some requirements to achieve this task: –

  • An Internet-connected Linux machine (we call it an online system)
  • A without internet-connected Linux machine (we call it offline-system)
  • A USB drive or external hard disk to carry all update or installation files.

Before discussing the solution, I want to tell you the use of the apt-offline tool. As the name says, apt-offline is an Offline APT Package Manager for APT-based systems. We will use this tool to update our Ubuntu Linux Machine. Apt-offline must be available on both systems. If you want to learn about apt working

Installation

Apt-offline is default available on Debian based systems but if you are using other Linux distributions you can install Apt-offline using this command: –

#sudo apt-get install apt-offline

but suppose your offline system doesn’t have an apt-offline feature so what will you do?

Don’t worry, we are here to tell you the complete solution. Below are the Steps to install apt-offline on an offline system.

Step 1

We create a directory that is apt-offline you can enter anything it is just a name.

#mkdir apt-offline

Step 2

Go into that directory and execute below mention command to collect all dependencies packages  URL of apt-offline in a file apt.txt.

#cd apt-offline

# apt-get – – print-uris  – – yes install  apt-offline | grep ^’ | cut -d’ -f2  > apt.txt

Step 3

Copy the apt-offline folder into a USB drive and connect that USB drive to the online System and download all packages using this command

#sudo wget  – – input-file apt.txt

When the downloading Is completed copy the downloaded files into USB and plug them into the offline system.

Step 4

Copy all the files into an apt-offline folder in the offline system and install the apt-offline tool using this command.

#dpkg -i *.deb (this command is used to install all .deb files in that folder)

And now your apt-offline tool is installed on your offline system, and you can update your Linux machine using apt-offline.

Today we discussed the installation of an apt-offline tool in an offline system. For now, we stop here but will continue the discussion in our next blog.

Zindagi Technologies is an IT Consulting Company in Delhi. It provides IT services like Deployment of Data Centers, Enterprise networks, Cyber Security Solutions and cloud services, and troubleshooting and maintenance. If you want to Implement any solution, Contact Us or you can drop a message or call at +91 9773973971.

Author
Shivang Trivedi
Associate Consultant

Author

Team ZT

Comments (0)

  1. Install Apache in Air-Gapped Network | Zindagi Technologies
    April 28, 2023

    […] we discussed in our previous blog our boss gave a task to Update the Linux machine and Install Apache Server. The machine was to […]

Leave a comment

Your email address will not be published. Required fields are marked *