Better generate such a list with aptitude itself which allows to exclude automatically installed packages
aptitude -F "%p" '~i!~M' > list_of_packages_manually_installed That will preserve which packages are installed automatically. Then on another machine command aptitude install $(cat list_of_packages_manually_installed) This will give some warnings about already installed packages which can be ignored. Or remove these package names from the list. Regards, jvp.