Skip to main content

Offline Installation of <packages>

# Offline Installation of `<package>`

## Overview
This guide helps package and install `<package>` on anarchie or  any offline machine. It includes copying binaries, dependencies, and setting up installation scripts.

---

## Steps

```bash
#

1. Check Dependencies
#

Find all dependencies for <package>
:

ldd /usr/bin/<package>

#

2. Package Required Files
#

Create a directory to store <package> and its dependencies
dependencies:

mkdir package_offline_package
cp /usr/bin/<package> package_offline_package/
cp /usr/share/man/man1/<package>.1.gz package_offline_package/

# Copy the shared libraries listed by ldd
:

ldd /usr/bin/<package> | awk '{print $3}' | xargs -I '{}' cp -v '{}' package_offline_package/

#

3. Create Installation Script
#

Create an install script in the package_offline_package directory
directory:


cat << 'EOF' > package_offline_package/install_package.sh
#!/bin/bash

# Copy <package> binary
mkdir -p /usr/bin/
cp <package> /usr/bin/

# Copy man page
mkdir -p /usr/share/man/man1/
cp <package>.1.gz /usr/share/man/man1/

# Copy dependencies
cp -v ./* /lib/ 2>/dev/null || cp -v ./* /usr/lib/ 2>/dev/null

# Update shared library cache
ldconfig
echo "<package>EOF installed successfully!"
EOF

chmod +x package_offline_package/install_package.sh

#

4. Compress the Package
#

Create a tarball of the directory
directory:

tar -czvf package_offline_package.tar.gz package_offline_package/

#

5. Transfer to Offlinearchie

Machine
#

Either Userun a USBscp drivetmux_offline_package.tar.gz archie:~/ or othertransfer methodsvia toUSB move package_offline_package.tar.gz to the offline machine.

#

6. Install on OfflineArchie Machine
#

On the offline machine:
#

Extract the tarball
tarball:

tar -xzvf package_offline_package.tar.gz

# Run the installation script
script:


cd package_offline_package
sudo ./install_package.sh

Notes

    • Verify the installation by running the command to check the package version:
<package> --version