you can use adb / fastboot / mix explorer with root… as example
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# fastboot erase cache -> no erase of davlik
# reboot
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# adb shell
# su system
# rm -r /data/dalvik-cache/
# rm -r /cache/
# reboot
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# install magisk...