update and refactor apt/dpkg/aptitude