Peppermint OS Community Forum

Support => Advanced Topics => Topic started by: globetrotterdk on April 15, 2017, 04:53:08 pm

Title: Transfering software info to a new install.
Post by: globetrotterdk on April 15, 2017, 04:53:08 pm
I have been given some advice as to how to transfer software info to a new install, however I can see after having looked at man pages and googled, that this topic is a bit over my head. I s there someone that can confirm that the following suggestions will work as advertised?

1)  Save sources.
Code: [Select]
find /etc/apt/sources.list* -type f -name '*.list' -exec bash -c 'echo -e "\n## $1 ";grep "^[[:space:]]*[^#[:space:]]" ${1}' _ {} \; > sources.list.save

2) Save installed packages.
Code: [Select]
dpkg --get-selections  | awk '!/deinstall|purge|hold/ {print $1}' > packages.list.save

The others seem to be straight forward:
Code: [Select]
apt-mark showauto > package-states-auto
apt-mark showmanual > package-states-manual
Target system:
Code: [Select]
sudo apt-key add trusted-keys.gpg #copy folder if needed too!!!
sudo cp sources.list.save /etc/apt/sources.list
sudo apt update
xargs -a "packages.list.save" sudo apt-get install
xargs -a "package-states-auto" sudo apt-mark auto
xargs -a "package-states-manual" sudo apt-mark manual
Title: Re: Transfering software info to a new install.
Post by: PCNetSpec on April 15, 2017, 05:28:20 pm
On first cursory glance that **looks** like it would **probably** work (for apps that came from the repos/ppa's), but it's also going to come with its own set of problems.

PPA's will be added to your sources.list instead of in their own files in the sources.list.d directory.

For example:-  Let's say you have google-chrome installed, that will automatically add it's own entry back to the sources.list.d  directory after the next update, you'll then have two duplicate entries spread across two files in the sources tree which will break updates.
Title: Re: Transfering software info to a new install.
Post by: globetrotterdk on April 15, 2017, 06:02:32 pm
Thanks for the quick reply. OK, I understand what you are talking about. What are the alternatives? (I am trying to learn something here)
Title: Re: Transfering software info to a new install.
Post by: PCNetSpec on April 15, 2017, 06:31:14 pm
Now how did I know my response was going to rope me into something more...

First let me explain I'm not guaranteeing ANY of this .. I haven't tested it, and I'm not going to .. I only mentioned the first issue that I spotted and there may be others.

To overcome JUST the issue I spotted, and assuming you're reinstalling the same distro/version, instead of generating a "sources.list.save" and copying it over the existing sources.list, why not copy the original sources.list and the entire sources.list.d directory.
(in fact why not try copying the entire /etc/apt directory .. renaming the original rather than deleting just in case)
Title: Re: Transfering software info to a new install.
Post by: globetrotterdk on April 15, 2017, 08:02:08 pm
Many thanks for the replies and the info. I didn\t mean to put you on the spot  :)
Title: Re: Transfering software info to a new install.
Post by: PCNetSpec on April 16, 2017, 08:08:45 am
Sorry globetrotterdk, I didn't mean to come off as being unwilling but I generally try to steer clear of posting potential solutions I haven't tested and/or might cause people unforeseen problems, and whilst we're working towards the Peppermint 8 release I can't risk any of my PC's at the moment testing this ;)
Title: Re: Transfering software info to a new install.
Post by: globetrotterdk on April 16, 2017, 11:11:59 am
No, no problem at all. I understand completely :)