I have some package installed on a computer. I want to install similar packages for other computer.
I can list down all recent packages with this command
cat /var/log/dpkg.log | grep "\ install\ "
It will output something like
2015-02-18 19:33:46 install login:amd64 <none> 1:4.1.5.1-1ubuntu9
2015-02-18 19:33:46 install lsb-base:all <none> 4.1+Debian11ubuntu6
2015-02-18 19:33:46 install makedev:all <none> 2.3.1-93ubuntu1
2015-02-18 19:33:46 install module-init-tools:all <none> 15-0ubuntu6
2015-02-18 19:33:46 install mount:amd64 <none> 2.20.1-5.1ubuntu20
2015-02-18 19:33:46 install mountall:amd64 <none> 2.53
This list is quite big.
I want to make it something like
sudo apt-get install login lsb-base module-init-tools mount mountall
cut
that list to get only the name of the packages, and then pass those names into the apt-get install commandcat /var/log/apt/history.log | grep "\ install\ "