Score:0

How to list all packages and repositories for re-installation

cn flag

I am configuring a new machine that will be an environment clone of the old machine, both X86-64 processors but different hardware (thus a direct copy of the "old" SSD would not work as the Ubuntu installer evidently scans the hardware for the "correct" drivers, etc). I have already copied /home from the old machine to the new machine -- everything "works" except that most applications are missing. Rather than manually installing each one from the name appearing on the desktop, etc, is there a means to generate from the old machine (also 22.04.2 current) a list of the installed repositories and applications such that this would be acceptable as input to, say, apt? As I removed the SSD from the old machine and using a SSD to USB adapter mounted the old SSD onto the new machine (hence using sudo cp -pra with renaming and then sudo mv did the above full copy of home) are there directories, files, etc, on the old SSD that would contain the needed information to "automate" the apt install procedure? The Ask Ubuntu robot produced some answers from the year 2014, but I fear that enough has changed that I need to address this topic for the current 22.04.2 . Is there is an apt configuration directory/directory tree that contains the information and then a specific apt "directive/s" that would force a re-reading of that configuration to make the current set of installed repositories and applications the same as on the old machine, both being 22.04.2 LTS current?

hr flag
`dpkg --get-selections` / `dpkg --set-selections` may be what you are looking for - see for example [How to list all installed packages](https://askubuntu.com/questions/17823/how-to-list-all-installed-packages)
Mahler avatar
in flag
dpkg --get-selections | grep -v deinstall > backup.txt This command saves package names in the backup.txt file.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.