I have 2 servers, let's say Server1 and Server2
Server1 is configured long ago by some person which has multiple packages and our application has so many dependencies on those packages. So I want to maintain same set of Packages in new server i.e., Server2 to run our application smoothly.
I used below command to list all the packages from Server1
dpkg --get-selections > ~/Package.list
Which gives all the Package List Like
accountsservice install
acpid install
adduser install
amd64-microcode install
...
...
I make a copy of the above package list in Server2 and tried to install those Packages using a command
sudo dpkg --set-selections < ~/Package.list
but it says like
dpkg: warning: package not in status nor available database at line 2: acpid
dpkg: warning: package not in status nor available database at line 4: amd64-microcode
dpkg: warning: package not in status nor available database at line 12: apt-transport-https
dpkg: warning: package not in status nor available database at line 14: apt-xapian-index
...
...
Is there any other way to maintain same set of packages in both server?
Both are Same OS with different versions (server1 : Ubuntu 14.04 and server2: Ubuntu 20.04) and I want only user installed packages
Update:
apt list --installed
Above Command displays like
accountsservice/trusty-updates,now 0.6.35-0ubuntu7.3 amd64 [installed]
acpid/trusty,now 1:2.0.21-1ubuntu2 amd64 [installed]
adduser/trusty,now 3.113+nmu3ubuntu3 all [installed]
amd64-microcode/trusty-updates,now 3.20180524.1~ubuntu0.14.04.2+really20130710.1ubuntu1 amd64 [installed,automatic]
apache2/trusty-updates,trusty-security,now 2.4.7-1ubuntu4.22 amd64 [installed]
...
It displays package with version, Is it possible that I can save the result of this output and run in server2 so that I can have same Package with same version.