-
Notifications
You must be signed in to change notification settings - Fork 0
/
updater
68 lines (55 loc) · 1.98 KB
/
updater
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
#####
# Delete old snapshots
#sudo snapper cleanup timeline
sudo snapper cleanup number
sudo snapper cleanup empty-pre-post
# backup, using the SpiderOak ONE backup tool …
# don't use --headless, it won't do the job (for me, at least)
# don't use as root user
# https://spideroak.support/hc/en-us/articles/115004794506
#SpiderOakONE --batchmode --verbose;
# https://spideroak.support/hc/en-us/articles/115001893323
#SpiderOakONE --purge-historical-versions h3,d7,y100 --verbose;
# stop f*cking PackageKit from interfering the process
sudo systemctl stop packagekit
#sudo systemctl mask packagekit
# zypper should auto-refresh anyway, but hey …
sudo zypper refresh
# create an overview over all possible updates
sudo zypper lu
# best possible update command, I think
sudo zypper --non-interactive update
# re-installs default packages
#sudo zypper install-new-recommends
# Flatpak has its own update mechanism, of course …
sudo flatpak update --force-remove --assumeyes
sudo flatpak uninstall --unused --assumeyes
sudo flatpak repair
# now might be a good time to remove temporary files
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
sudo rm -rf ~/.cache/evolution/tmp/*
sudo rm -rf ~/.cache/gnome-builder/tags/share/flatpak/repo/tmp/*
# makes the database behind 'locate'
sudo updatedb
# BTRFS balancer
echo -e "/ default subvolume:"
sudo btrfs subvolume get-default /
echo -e "\n"
sudo systemctl restart btrfsmaintenance-refresh
sudo /usr/share/btrfsmaintenance/btrfs-balance.sh
# show the remaining BTRFS snapshots
sudo snapper list
# show how much disk space the BTRFS partition really occupies
echo -e "\n"
sudo btrfs fi df /
# show orphaned packages (do after upgrade)
# see https://doc.opensuse.org/documentation/leap/reference/html/book-reference/cha-sw-cl.html#sec-zypper-softup-orphaned
#sudo zypper packages --orphaned
#sudo zypper packages --unneeded
# show if some processes are running that were update right now (→ restart)
sudo zypper ps -s
# leave the super-user shell …
sudo -k
exit 0