Skip to main content

Offline Installation of <packages>

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

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:

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:


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
EOF

chmod +x package_offline_package/install_package.sh
    

4. Compress the Package

Create a tarball of the directory:

tar -czvf package_offline_package.tar.gz package_offline_package/

5. Transfer to archie

Either run a scp tmux_offline_package.tar.gz archie:~/ or transfer via USB 

6. Install on Archie 

On the offline machine:

Extract the tarball:

tar -xzvf package_offline_package.tar.gz

Run the installation script:


cd package_offline_package
sudo ./install_package.sh
        

Notes

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