When dnf/yum update stuck on cleaning up…
Sometimes when you are doing dnf/yum update, the progress may stop on the last step – cleaning up packages for hours, if you have a super large data drive. This may be caused by an installing script falsely attempts to scan through multi-million files on your data drive that is not mounted in a regular location. If this is the case, you can do the following:
Open another terminal, use “top” to find out which process is keeping working, like texlua etc will show up on top.
Then you can do “lsof | grep <process_name> to find out which drive this process is scanning through.
When you find it, for example, if it is “/data/home”, you can do “umount -l <volume_name>”, (here it is “umount -l /data/home”), wait 10 seconds, then “mount /data/home” to remount it. Then the process that scanning the drive will think there is no more files, and quit it.
This will allow the dnf/yum finish without any error.