From 2d4cd76a7b72b05962e64c97f98a87f78d3d714f Mon Sep 17 00:00:00 2001 From: zorc Date: Tue, 31 Oct 2023 22:10:39 +0100 Subject: [PATCH] moved update-scripts from common repo --- update-scripts/backup-system.sh | 9 +++++++++ update-scripts/update-all.sh | 11 +++++++++++ update-scripts/update-flatpak.sh | 8 ++++++++ update-scripts/update-mamba.sh | 12 ++++++++++++ update-scripts/update-system.sh | 14 ++++++++++++++ 5 files changed, 54 insertions(+) create mode 100755 update-scripts/backup-system.sh create mode 100755 update-scripts/update-all.sh create mode 100755 update-scripts/update-flatpak.sh create mode 100755 update-scripts/update-mamba.sh create mode 100755 update-scripts/update-system.sh diff --git a/update-scripts/backup-system.sh b/update-scripts/backup-system.sh new file mode 100755 index 0000000..d4d3e2e --- /dev/null +++ b/update-scripts/backup-system.sh @@ -0,0 +1,9 @@ +#!/bin/bash + + +set -eEuxo pipefail + + +sudo timeshift --list +sudo timeshift --create --tags D +sudo timeshift --list diff --git a/update-scripts/update-all.sh b/update-scripts/update-all.sh new file mode 100755 index 0000000..bf732ed --- /dev/null +++ b/update-scripts/update-all.sh @@ -0,0 +1,11 @@ +#!/bin/bash + + +set -eEuxo pipefail + + +script_dir="$(realpath -e "$(dirname "${BASH_SOURCE[0]}")")" + +"${script_dir}/update-system.sh" +"${script_dir}/update-flatpak.sh" +"${script_dir}/update-mamba.sh" diff --git a/update-scripts/update-flatpak.sh b/update-scripts/update-flatpak.sh new file mode 100755 index 0000000..cb0e4c6 --- /dev/null +++ b/update-scripts/update-flatpak.sh @@ -0,0 +1,8 @@ +#!/bin/bash + + +set -eEuxo pipefail + + +sudo flatpak update +flatpak uninstall --unused --delete-data diff --git a/update-scripts/update-mamba.sh b/update-scripts/update-mamba.sh new file mode 100755 index 0000000..86fcecc --- /dev/null +++ b/update-scripts/update-mamba.sh @@ -0,0 +1,12 @@ +#!/bin/bash + + +set -eEuxo pipefail + + +for env in $(mamba env list | awk '/^[a-z]/ { print $1 }'); do + mamba update -n "${env}" --all + mamba update -n "${env}" python +done + +mamba clean --all diff --git a/update-scripts/update-system.sh b/update-scripts/update-system.sh new file mode 100755 index 0000000..557ef22 --- /dev/null +++ b/update-scripts/update-system.sh @@ -0,0 +1,14 @@ +#!/bin/bash + + +set -eEuxo pipefail + + +sudo apt clean +sudo apt update +sudo apt full-upgrade +sudo apt autopurge +sudo apt purge $(dpkg -l | awk '/^rc/ { print $2 }') + +sudo fwupdmgr refresh --force +sudo fwupdmgr update