Upgrade a package installation with the package manager of your operating system (apt, dnf, or yum).
Do not replace the jenkins.war file with a downloaded copy.
The Jenkins package installs jenkins.war as /usr/share/java/jenkins.war, and that file belongs to the package.
If you replace it, the package manager still reports the old version, and the next package upgrade overwrites your copy.
The package also installs the files that start Jenkins, such as the jenkins systemd service, and upgrades them together with jenkins.war.
When the package is upgraded, the package manager restarts Jenkins if it is running.