
Your {page-component-title} repository is defined in the `/etc/apt/sources.list` directory.
ifeval::["{page-component-title}" == "Horizon"]
The file may be named `opennms-repo-stable-<OSversion>.repo`, but it is not guaranteed to be.
endif::[]

. Log in as the root user or elevate your permissions to be the root user.
. Enable auto updates:
+
[source, console]
----
sudo apt-mark unhold libopennms-java \
              libopennmsdeps-java \
              opennms-common \
              opennms-db
----

. Purge any cached data:
+
[source, console]
----
apt clean
----

. Make a backup copy of your config:
+
[source, console]
----
rsync -Ppav ${OPENNMS_HOME}/etc /tmp/etc.orig
rsync -Ppav ${OPENNMS_HOME}/jetty-webapps/opennms/WEB-INF /tmp/opennms-web-inf
----

. Update the apt packages index:
+
[source, console]
----
apt update -y
----

. Upgrade {page-component-title} packages to the newest version:
+
[source, console]
----
apt upgrade opennms
----

. Disable auto updates:
+
[source, console]
----
sudo apt-mark hold libopennms-java \
              libopennmsdeps-java \
              opennms-common \
              opennms-db
----

. Upgrade Java 17 to the latest release:
+
[source, console]
----
apt install openjdk-21-jdk-headless openjdk-21-jre-headless
----

. Use the `runjava` command to set the JVM that {page-component-title} will use:
+
[source, console]
----
${OPENNMS_HOME}/bin/runjava -s
----

. Check for configuration file changes and update accordingly using the files you backed up in xref:deployment:upgrade/diff.adoc#run_diff[identify changed configuration files].
+
NOTE: Debian prompts you to keep or overwrite your files during the `apt upgrade` process.
Inspect these files manually and reconcile any differences.
Use `diff -Bbw` and `diff -y` to look for changes.

. Run the {page-component-title} installer:
+
[source, console]
----
${OPENNMS_HOME}/bin/install -dis
----
+
The upgrade may take some time.
An "Upgrade completed successfully!" message confirms that the upgrade has finished.
If you do not get this message, check the output of the install command for any errors.

. Clear the Karaf cache:
+
[source, console]
----
yes | ${OPENNMS_HOME}/bin/fix-karaf-setup.sh
----

. Start {page-component-title}:
+
[source, console]
----
systemctl start opennms.service
----
+
TIP: `tail -F $\{OPENNMS_HOME}/logs/manager.log` shows the {page-component-title} startup progress.

. The upgrade is completed and operation resumes.

IMPORTANT: Make sure that you clear your browser's cache before using the {page-component-title} web UI against the upgraded version.
This is especially important for pages that use JavaScript heavily (for example, the Requisitions UI).
