Choose style:

Author Topic: Transfering software info to a new install.  (Read 823 times)

0 Members and 1 Guest are viewing this topic.

Offline globetrotterdk

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint OS 7 64-bit
Transfering software info to a new install.
« 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
« Last Edit: April 15, 2017, 04:56:33 pm by globetrotterdk »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Transfering software info to a new install.
« Reply #1 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.
« Last Edit: April 15, 2017, 05:30:15 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline globetrotterdk

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint OS 7 64-bit
Re: Transfering software info to a new install.
« Reply #2 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)

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Transfering software info to a new install.
« Reply #3 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)
« Last Edit: April 16, 2017, 08:09:33 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline globetrotterdk

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint OS 7 64-bit
Re: Transfering software info to a new install.
« Reply #4 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  :)

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26276
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Transfering software info to a new install.
« Reply #5 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 ;)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline globetrotterdk

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint OS 7 64-bit
Re: Transfering software info to a new install.
« Reply #6 on: April 16, 2017, 11:11:59 am »
No, no problem at all. I understand completely :)