Create a list of every installed package on your system (and where to get them)

Just in case something crashes on my system, I decided to create a list of all installed packages and where to get them.

First, install Synaptic:
sudo apt install synaptic

After it's installed, start it up. Its shortcut should be in Zorin menu > System Tools.

Enter your password, then click the  Status  button at bottom-left.

Click the "Installed" menu item at top-left. (Nearly) all of your installed packages will be listed in the sub-window at upper-right.

Select all of the packages, right-click and select "Mark for Reinstallation" (don't worry... we're not actually reinstalling anything).

Once all the installed packages listed have a checkmark next to them, at upper-left go to "File" > "Generate package download script".

Save the file to /home. I named it PACKAGELIST.

Now things get a bit weird... remember that you typed in your password when Synaptic started up? Yeah, it's running with sudo privileges... so you're not going to find that file under your /home directory... you're going to find it under the sudo /home directory.

No problem... open Terminal and enter sudo nautilus, then surf to /home and find the PACKAGELIST file.

Things are still a bit weird... it won't let you just copy that file over to your desktop because you don't have the privileges to do that.

No problem... open the PACKAGELIST file, select all the text ( Ctrl + A ), hit  Ctrl + C  to copy all the text.

Go to Zorin menu > Accessories > Text Editor to open gedit, then paste ( Ctrl + V ) the text into a new document and save that to your own desktop.

Now you can delete the PACKAGELIST file under the sudo /home directory from within the sudo nautilus you'd started earlier, then close that sudo nautilus window.

Now, back in Synaptic, click Edit > Unmark All. That ensures no packages are actually reinstalled. You're fine as long as you do not press the  Apply  button while you have those packages marked for reinstallation.

You're still not quite done... there could be packages that are listed as manually installed. For instance, I have the SRWare Iron browser and PDFsam (PDF Split-and-Merge) listed as manually installed, because I had to download the .deb file and install from there for those applications.

For manually installed packages, you'll find them in Synaptic under the "Installed (manual)" menu item at upper-left.

You'll have to find the URLs for those .deb packages and add them to the PACKAGELIST file manually.

Now you can close Synaptic. End of weirdness.

So my PACKAGELIST file has 1605 packages listed, but here's what it looks like:

wget -c https://www.srware.net/downloads/iron64.deb
wget -c https://github.com/torakiki/pdfsam/releases/download/v5.1.1/pdfsam_5.1.1-1_amd64.deb
wget -c http://ppa.launchpad.net/zorinos/patches/ubuntu/pool/main/b/base-files/base-files_11ubuntu5.6+zorin1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/b/bash/bash_5.0-6ubuntu1.2_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/b/bsdmainutils/bsdmainutils_11.1.2ubuntu3_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/u/util-linux/bsdutils_2.34-0.1ubuntu9.3_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/c/coreutils/coreutils_8.30-3ubuntu2_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/d/dash/dash_0.5.10.2-6_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/d/debianutils/debianutils_4.9.1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/d/diffutils/diffutils_3.7-3_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.19.7ubuntu3.2_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/f/findutils/findutils_4.7.0-1ubuntu1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/grep/grep_3.4-1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gzip/gzip_1.10-0ubuntu4.1_amd64.deb
... etc., etc., etc...

The first two entries were the manually installed packages I referred to above, which I manually entered into the PACKAGELIST file.

Now if anything goes wrong, I know exactly where to go for each package to install it again. Even if the traditional apt method of installation is somehow borked, I can get the .deb file.

Or, you can follow this guide. :wink: