Keep a specific app version even when you run apt update / apt upgrade.
sudo apt-mark hold <package>/etc/apt/preferences.d/<package>.pref with Pin: version <x.y.z>If updating a package (e.g., FortiClient) breaks your workflow, you can freeze that package at a working version while keeping the rest of the system updated.
This works whether you installed the app via:
apt install ./file.deb (local .deb)apt install <package> (from a repo)apt-mark hold# Freeze the package at its current version
sudo apt-mark hold forticlient
# Verify
apt-mark showhold
# (shows: forticlient)
# Later, to allow upgrades again
sudo apt-mark unhold forticlient
After this, sudo apt upgrade will skip forticlient.
Tip – simulate an upgrade to confirm:
apt -s upgrade | grep -i forticlient || echo "forticlient not scheduled for upgrade"
Use this when you want to lock to an exact version.
# Create a pin file for this package/version
sudo tee /etc/apt/preferences.d/forticlient.pref >/dev/null <<'EOF'
Package: forticlient
Pin: version 7.4.0.1636
Pin-Priority: 1001
EOF
# Refresh and inspect policies
sudo apt update
apt policy forticlient
Pin-Priority: 1001 ensures your chosen version wins over newer ones.sudo rm /etc/apt/preferences.d/forticlient.pref
sudo apt update
# Optionally install a specific version when you're ready
sudo apt install forticlient=7.4.3.1736
If a vendor repo keeps pushing newer versions, it will still be ignored by hold/pinning, but you can disable it for cleanliness:
# Check for vendor list files
ls /etc/apt/sources.list.d | grep -i forti
# Example: comment out entries inside that list file
sudo sed -i 's/^\s*deb /# deb /' /etc/apt/sources.list.d/fortinet.list
sudo apt update
If apt list --installed shows:
forticlient/now 7.4.0.1636 amd64 [installed,upgradable to: 7.4.3.1736]
Option A – hold:
sudo apt-mark hold forticlient
apt-mark showhold
Option B – exact version pin:
sudo tee /etc/apt/preferences.d/forticlient.pref >/dev/null <<'EOF'
Package: forticlient
Pin: version 7.4.0.1636
Pin-Priority: 1001
EOF
sudo apt update
apt policy forticlient
apt update only refreshes indexes; upgrades happen on apt upgrade / apt full-upgrade.hold applies to the package name you specify. If the vendor changes the package name, re-apply the hold for the new name.sudo apt-mark hold pkg1 pkg2 pkg3
sudo apt install package=VERSION
When the vendor fixes the issue and you're ready to upgrade:
# If you used hold:
sudo apt-mark unhold forticlient
# If you used pinning:
sudo rm /etc/apt/preferences.d/forticlient.pref
sudo apt update
sudo apt upgrade
That's it—your system stays updated while your problematic app version remains stable.