> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opus-host.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Keep Your Opus Host VPS Updated and Patched Safely

> Install security patches, update installed packages, and enable unattended upgrades on your Opus Host VPS running Debian or Ubuntu.

An unpatched server is the easiest kind of server to compromise. Ubuntu and Debian make patching straightforward: one command refreshes the package index, another installs the updates. Automating it takes a few minutes and pays off forever.

## Update the package index

Refresh the list of available packages from Ubuntu or Debian's repositories.

```bash theme={null}
sudo apt update
```

## Install available upgrades

```bash theme={null}
# Upgrade all installed packages
sudo apt upgrade -y

# Upgrade and remove/add packages as needed to satisfy dependencies
sudo apt full-upgrade -y
```

## Remove packages you no longer need

```bash theme={null}
sudo apt autoremove -y
sudo apt autoclean
```

## Check if a reboot is required

Some updates (especially kernel updates) do not take effect until you reboot.

```bash theme={null}
[ -f /var/run/reboot-required ] && echo "Reboot required" || echo "No reboot needed"
```

If a reboot is needed, see [Power Controls](/vps/start-stop-restart).

## Enable automatic security updates

<Steps>
  <Step title="Install unattended-upgrades">
    ```bash theme={null}
    sudo apt install unattended-upgrades -y
    ```
  </Step>

  <Step title="Enable it">
    ```bash theme={null}
    sudo dpkg-reconfigure --priority=low unattended-upgrades
    ```

    Select **Yes** when prompted.
  </Step>

  <Step title="Verify it is running">
    ```bash theme={null}
    sudo systemctl status unattended-upgrades
    ```
  </Step>
</Steps>

<Tip>
  Automatic updates handle **security patches** only by default. You should still run `sudo apt upgrade` periodically to keep everything else current.
</Tip>

## Search for a package

```bash theme={null}
apt search nginx
apt show nginx
```

## Fix broken packages

If an update is interrupted or a package fails to install:

```bash theme={null}
sudo apt --fix-broken install
sudo dpkg --configure -a
```
