#!/usr/bin/dash
#
# This file is part of OpenMediaVault.
#
# @license   http://www.gnu.org/licenses/gpl.html GPL Version 3
# @author    Volker Theile <volker.theile@openmediavault.org>
# @copyright Copyright (c) 2009-2025 Volker Theile
#
# OpenMediaVault is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# OpenMediaVault is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.

set -e

export LC_ALL=C.UTF-8
export DEBIAN_FRONTEND=noninteractive

# Update package database and update distribution. This is done via
# 'dist-upgrade' because newer version have modified package dependencies
# which can not be resolved by 'upgrade'. Configuration files modified by
# the user will be overwritten, otherwise it is not possible to install
# packages non-interactively.
apt-get update
apt-get --yes --allow-downgrades --allow-change-held-packages --fix-missing \
	--fix-broken --auto-remove --allow-unauthenticated \
	--show-upgraded --option DPkg::Options::="--force-confold" dist-upgrade

exit 0
