Olf0 / sfos-upgrade

Upgrading SailfishOS fail-safe and semi-automated at the command line
https://openrepos.net/content/olf/sfos-upgrade
GNU Lesser General Public License v2.1
8 stars 4 forks source link

[Suggestion] Consider removing SSU's caches before / after upgrading #82

Open Olf0 opened 1 year ago

Olf0 commented 1 year ago

DESCRIPTION

Consider performing rm -r /var/cache/ssu/ ssu ur

But when? Likely both, before and after updating (on SFOS < 4.4.0), because users may start on any affected release and end on one, but never use sfos-upgrade before or after that, again.

ADDITIONAL INFORMATION

Olf0 commented 1 year ago

See also https://docs.sailfishos.org/Support/Help_Articles/Updating_Sailfish_OS/#if-it-keeps-failing

pkill  store-client
rm -rf /home/.pk-zypp-dist-upgrade-cache/*
rm ~/.cache/sailfish-osupdateservice/os-info

Better, also applicable to SailfishOS < 2.2.1 and suitable for root:

pkill -x store-client
rm -rf /home/.pk-zypp-dist-upgrade-cache/*
primuser="$(loginctl list-sessions | fgrep seat0 | tr -s ' ' | cut -d ' ' -f 4)"
rm -f "/home/${primuser}/.cache/sailfish-osupdateservice/os-info" "/home/${primuser}/.cache/store-client/os-info"

For references, see post_sfos-upgrade.

Olf0 commented 11 months ago

The original idea should rather be implemented as (see ssu commit 5bd8a09):

killall -q ssud 2> /dev/null || { sleep 1; killall -KILL -q ssud 2> /dev/null; } || true
# or `pkill -x ssud 2> /dev/null || { sleep 1; pkill -KILL -x ssud 2> /dev/null; } || true`

rm -rf /var/cache/ssu/*
ssu updaterepos

One may make this dependent on installed_version >= 4.4.0, but this does nor rally make a difference.