[build-in-chroot.sh] Fix issue where an old package may take precedence when building the local repo database