Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Moderators: Site Moderators, FAHC Science Team

Post Reply
Etendue
Posts: 2
Joined: Tue Dec 08, 2020 12:13 pm
Location: Norway

Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Post by Etendue »

Just a heads up regarding a previously "ignorable" error during install of the fah-client v8.4.9 on older Ubuntu releases, which now has become a major pain on Ubuntu 25.04...

The install command (from the Linux manual install documentation):

Code: Select all

sudo dpkg -i --force-depends fah-client_8.4.9_amd64.deb
forces the packaging system to ignore errors during install regarding dependencies which earlier had (seemingly) no effect.
Now, this has the effect that installs and updates to Ubuntu fail, and one have to uninstall the fah-client to be able to maintain the installation, and then reinstall the fah-client.

Me, and a friend of mine ( GPTo4 ;-) ), made a simple bash script to remedy this by unpacking the .deb file and stripping the invalid dependencies, for then to proceed to rebuild the .deb file.

The script can, and will be improved over time, as it now has hard coded URL for download and version of the fah-client among other things, but I post it here in the hope that this can help overcome some initial problems with fah installation.

Code: Select all

#!/bin/bash
set -e

FAH_VERSION="8.4.9"
FAH_DEB="fah-client_${FAH_VERSION}_amd64.deb"
FAH_URL="https://download.foldingathome.org/releases/public/fah-client/debian-10-64bit/release/${FAH_DEB}"
TMP_DIR="fah-deb-temp"
FIXED_DEB="fixed-${FAH_DEB}"

echo "Folding@home Client Installer (v${FAH_VERSION}) for Ubuntu 25.04+"

# Optional user configuration
read -p "🔑 FAH passkey (leave empty to skip): " USER_PASSKEY
read -p "👤 Machine name (leave empty to skip): " USER_NAME
read -p "🧑‍🤝‍🧑 Team number (leave empty to skip): " USER_TEAM

# Clean up prior attempts
echo "Cleaning up previous install attempts..."
sudo apt-mark unhold fah-client 2>/dev/null || true
sudo apt --fix-broken install -y || true
sudo apt purge -y fah-client || true
rm -rf "$TMP_DIR" "$FAH_DEB" "$FIXED_DEB"

# Download if missing
if [ ! -f "$FAH_DEB" ]; then
    echo "Downloading FAH client .deb..."
    wget -q --show-progress "$FAH_URL"
else
    echo "Using existing ${FAH_DEB}"
fi

# Repack .deb
echo "Unpacking .deb to remove broken dependencies..."
dpkg-deb -R "$FAH_DEB" "$TMP_DIR"

echo "Stripping invalid PolicyKit dependency..."
sed -i '/^Depends:/s/polkitd-pkla[^,]*,\?//g' "$TMP_DIR/DEBIAN/control"
sed -i '/^Depends:/s/policykit-1([^)]*)//g' "$TMP_DIR/DEBIAN/control"
sed -i '/^Depends:/s/,,/,/g' "$TMP_DIR/DEBIAN/control"
sed -i '/^Depends:/s/: ,/: /g' "$TMP_DIR/DEBIAN/control"

echo "Rebuilding clean .deb..."
dpkg-deb -b "$TMP_DIR" "$FIXED_DEB"

# Install
echo "Installing clean FAH client .deb..."
sudo apt install -y "./$FIXED_DEB"

# Hold it to prevent upgrade breakage
sudo apt-mark hold fah-client

# Optional configuration
if [ -n "$USER_PASSKEY" ] || [ -n "$USER_NAME" ] || [ -n "$USER_TEAM" ]; then
    echo "Configuring /etc/fah-client/config.xml..."
    CONFIG_FILE="/etc/fah-client/config.xml"
    sudo cp "$CONFIG_FILE" "${CONFIG_FILE}.bak"

    sudo xmlstarlet ed -L \
        -u "/config/user" -v "${USER_NAME:-Anonymous}" \
        -u "/config/team" -v "${USER_TEAM:-0}" \
        -u "/config/passkey" -v "${USER_PASSKEY}" \
        "$CONFIG_FILE" || echo "⚠️ Could not auto-edit config.xml (install xmlstarlet?)"
fi

# Restart client
sudo systemctl restart fah-client
echo "FAH client installed and running!"
echo "Open browser to https://v8-4.foldingathome.org/ to view web UI"

Last edited by Etendue on Tue Jun 03, 2025 11:34 pm, edited 1 time in total.
calxalot
Site Moderator
Posts: 1544
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Post by calxalot »

You should generate config.xml before the install, which will start the client service.

User, team, passkey, cause and anything else exposed in web control is only a first-run default when in config.xml. After first-run, those settings are stored in client.db
calxalot
Site Moderator
Posts: 1544
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Post by calxalot »

If you don’t do a purge, the install is able get some values from the v7 config.xml by copying it to the new location.
calxalot
Site Moderator
Posts: 1544
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Post by calxalot »

The polkit depends is fixed in the next release.
Etendue
Posts: 2
Joined: Tue Dec 08, 2020 12:13 pm
Location: Norway

Re: Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Post by Etendue »

Ah, OK. Great news :-)

I guess I'll refine this script ASAP, and maybe even go for a headless install script too...
Got a dozen servers that need installs / upgrades to the client.
calxalot
Site Moderator
Posts: 1544
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Problems on Ubuntu 25.04 with subequent installs, updates etc after fah-client v8.4.9 install + simple fix.

Post by calxalot »

The most important thing for a headless install to put in config.xml is probably account-token. Nothing else is needed if the account is configured as desired.
Post Reply