Installing OpenFOAM Behind a Proxy: A Complete Guide

2 minute read

Published:

When trying to install OpenFOAM on Ubuntu/Debian systems behind a proxy server (especially institutional proxies), users often encounter SSL connection issues. This guide provides a step-by-step solution to successfully install OpenFOAM in such environments.

Common Issues

When running the standard installation command:

wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash

Users behind proxies might encounter errors like:

Proxy tunneling failed: Moved Temporarily
Unable to establish SSL connection.

Even after setting proxy environment variables:

export http_proxy="http://your.proxy.address:port"
export https_proxy="http://your.proxy.address:port"

The installation might still fail due to SSL verification issues with the proxy server.

Solution: Manual Installation Process

Here’s a reliable workaround that involves downloading the required files from a computer with direct internet access and then transferring them to the target computer.

Step 1: On a Computer with Direct Internet Access

  1. Download the OpenFOAM GPG key:
    wget https://dl.openfoam.com/pubkey.gpg
    
  2. Download the repository script (optional but useful for reference):
    wget https://dl.openfoam.com/add-debian-repo.sh
    
  3. Transfer these files to your target computer using a USB drive, SCP, or any other file transfer method.

Step 2: On the Target Computer (Behind Proxy)

  1. Convert and install the GPG key:
    # Convert the key to the correct format and install it
    cat pubkey.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/openfoam.gpg
    
  2. Add the OpenFOAM repository:
    # Add the repository entry
    echo "deb [arch=$(dpkg --print-architecture)] https://dl.openfoam.com/repos/deb $(lsb_release -cs) main" | \
     sudo tee /etc/apt/sources.list.d/openfoam.list
    
  3. Update the package lists:
    sudo apt-get update
    

Step 3: Verify the Installation

You can verify that the key is properly installed by running:

apt-key list

You should see the OpenFOAM key listed without any “unsupported filetype” warnings.

Step 4: Install OpenFOAM

Now you can proceed with installing OpenFOAM:

sudo apt-get install openfoam

Troubleshooting

  1. If you see “unsupported filetype” warnings after adding the key, ensure you used the gpg --dearmor command to convert the key file.

  2. If apt-get update fails, verify your proxy settings:

export http_proxy="http://your.proxy.address:port"
export https_proxy="http://your.proxy.address:port"

# Try updating again
sudo -E apt-get update
  1. If you’re still having issues, check your proxy configuration in /etc/apt/apt.conf.d/:
# Create or edit proxy configuration
sudo nano /etc/apt/apt.conf.d/proxy.conf

# Add these lines (replace with your proxy details):
Acquire::http::Proxy "http://your.proxy.address:port";
Acquire::https::Proxy "http://your.proxy.address:port";

Notes

  • This method works for most institutional and corporate proxy servers where direct SSL connections might be intercepted or blocked.
  • The solution maintains security by using the official OpenFOAM GPG key.
  • This approach can be adapted for other software packages that face similar proxy-related installation issues.

References

Leave a Comment