update DB and package states