Fix upgrade bug in Linux.