Reduce memory allocation during pkg update while here add debugs