Make Reinstalling Linux Faster With A Package List

When you run into problems installing MX Linux XFCE
Message
Author
User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 12:21 am

Make Reinstalling Linux Faster With A Package List

#1 Post by KoO »

DT have put out a new video on reinstalling your installed programs after a new install.
For Arch & Debian
https://www.youtube.com/watch?v=HGobqJS5L2Y
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

User avatar
manyroads
Posts: 2657
Joined: Sat Jun 30, 2018 6:33 pm

Re: Make Reinstalling Linux Faster With A Package List

#2 Post by manyroads »

I have published and do the same thing. I find that building both my application adds and removals via scripts along with a small assist from Luckybackup allows me to change entire environments in about 4 hours (mostly in the form of data downloads); it is magnificent. It used to take me 4 days... (a slow learner am I). I have built 6 machines this week using the approach including shifts between MX & manjaro. Simply the only way to go.... ;)
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

User avatar
Stevo
Developer
Posts: 14824
Joined: Fri Dec 15, 2006 7:07 pm

Re: Make Reinstalling Linux Faster With A Package List

#3 Post by Stevo »

Maybe a native MX tool would help, since aptik is no longer freely developed. It could also save fonts and scripts in /usr, as well as your third-party repositories and present those for editing before restoring them.

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 12:21 am

Re: Make Reinstalling Linux Faster With A Package List

#4 Post by KoO »

I can have a fresh install of MX-19 i3wm up and running in about two hours with all my programs installed including folders and tweaked. Had plenty of practice :p

@Stevo Thats sounds like and idea.

I keep all my files & folders in home
.bashrc .Xresources .dir_colors .config configs , .script , .fonts , .icons , .themes .calcurse , waterfox .waterfox , walls etc.

Only two or three for system
/etc asound.conf , hddtemp.db
/etc/X11/xorg.conf.d/ 20_nvidia.conf << only use this file to keep my nvidia advanced setting.

All my programs are installed in one go from my install help file. Some are not needed depends on the system.

Code: Select all

 sudo apt-get install ranger caca-utils highlight atool w3m w3m-img mediainfo git picom rofi dunst cups curl wget hddtemp at-spi2-core imagemagick yad xdotool fbset gconf2 catfish xdo zenity xurls -y
Only do one git install i3-gaps which takes more time then the above. The build dependences and install.
git clone https://www.github.com/Airblader/i3 i3-gaps
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

imschmeg
Posts: 533
Joined: Thu Sep 12, 2019 8:32 pm

Re: Make Reinstalling Linux Faster With A Package List

#5 Post by imschmeg »

Note this thread:
viewtopic.php?f=23&t=54914

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 12:21 am

Re: Make Reinstalling Linux Faster With A Package List

#6 Post by KoO »

imschmeg wrote: Fri Feb 14, 2020 8:49 pm Note this thread:
viewtopic.php?f=23&t=54914
Thanks for the link.
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

User avatar
sunrat
Posts: 667
Joined: Mon Mar 28, 2016 9:54 pm

Re: Make Reinstalling Linux Faster With A Package List

#7 Post by sunrat »

Useful for Arch but the bit on Debian-based systems is lacking. apt list --installed won't give a list you can feed back into a package installer without subsequent editing.
Debian wiki has an excellent guide on doing this - https://wiki.debian.org/AptCLI#Restore_ ... d_software

It's this simple:
Restore installed software

On the old system, backup installed packages information:

Code: Select all

dpkg --get-selections >/backup/package-selections
Transfer the file backup/package-selections on the new system and run:

Code: Select all

apt install $(cat /backup/package-selections | awk '{print $1}')

imschmeg
Posts: 533
Joined: Thu Sep 12, 2019 8:32 pm

Re: Make Reinstalling Linux Faster With A Package List

#8 Post by imschmeg »

@sunrat

You might want to filter dpkg --get-selections output a bit more than suggested by that link. Its output includes packages that were removed. For instance, my output has:

Code: Select all

libreoffice-base				deinstall
because I removed libreoffice.

User avatar
sunrat
Posts: 667
Joined: Mon Mar 28, 2016 9:54 pm

Re: Make Reinstalling Linux Faster With A Package List

#9 Post by sunrat »

Hmmm, ok, so the wiki is wrong (again). The old way to do it was:
To backup:
dpkg --get-selections > /tmp/dpkglist.txt

To Restore:
dpkg --set-selections < /tmp/dpkglist.txt
apt-get update
apt-get dselect-upgrade
which will actually remove any packages from the new system which don't exist on the old system.
I'm just trying to work out how to do it using the basics of the wiki method, which should theoretically be better. My attempt so far has found a handful of installed packages which are no longer available, so it stalls at that point. Stand by...
Last edited by sunrat on Sat Feb 15, 2020 8:26 pm, edited 1 time in total.

User avatar
sunrat
Posts: 667
Joined: Mon Mar 28, 2016 9:54 pm

Re: Make Reinstalling Linux Faster With A Package List

#10 Post by sunrat »

Try this to get the package list:

Code: Select all

dpkg --get-selections |awk '!/deinstall/' >package-selections 
Then same as above to install:

Code: Select all

apt install $(cat package-selections | awk '{print $1}')
I simulated install with this and it seems to work. Of course repos need to be the same and updated. Also assuming it's being run from same working directory containing package-selections file.

Post Reply

Return to “Installation”