Re-installing packages on new Debian Linux programs is an actual ache. It takes time and is tedious to get executed. Consequently, many customers have resorted to writing advanced shell scripts that mechanically set up apps on new programs. Should you’re new to Debian, or simply uninterested in having to listing out the packages you’d like to re-install manually, there’s a higher manner to create an app set up script: utilizing the Debian program installer to generate a script mechanically.

Observe: although this tutorial covers Debian, it will probably additionally work on Debian derivatives. Be happy to comply with together with the knowledge outlined beneath.

Exporting put in packages from Apt

There are a number of methods to generate a listing of packages, and through the years, many alternative strategies have been employed. Nonetheless, all of those outdated strategies contain piping a number of instructions collectively to strip the outline of every app, to make it in order that simply the package deal names seem within the listing. These strategies are hardly sensible so we received’t cowl any of them on this tutorial. As a substitute, we’ll benefit from the brand new Apt package deal supervisor included on Debian 9 and 10, because it comes with the apt-mark characteristic

The apt-mark characteristic is a good facet of the Apt package deal supervisor. With it, customers can use it to present a listing of mechanically put in apps (pre-setup by the system throughout set up,) in addition to a listing of packages that the person put in manually after the very fact.

Please observe that should you plan to use this characteristic on Debian, you want to be utilizing a model of the working system that has help for Apt. Apt-get is not going to work! So, should you’re operating Debian 8, you have to undergo the improve course of earlier than starting this information!

Discover

The apt-mark utility doesn’t simply generate a listing of put in packages of software program put in straight from the Debian software program repositories. It would additionally present packages put in through a downloadable DEB, or stuff from third-party software program repositories. Maintain that in thoughts, when utilizing this instrument.

Generate a listing of manually put in packages

Should you’re simply trying to create a listing of manually put in apps from numerous repositories, slightly than producing a huge listing of each single utility that Debian Linux contains by default, the “showmanual” characteristic in apt-mark is for you.

To generate the listing, open up a terminal by urgent Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, enter the command-line operation beneath to generate a listing within the terminal immediate.

Z

apt-mark showmanual

Look via the terminal immediate, and also you’ll see a listing of each package deal you’ve ever put in on Debian Linux manually. If the listing is just too lengthy to learn at a look, add the “more” choice with the command beneath.

apt-mark showmanual | extra

To avoid wasting this listing for later, pipe it via to a textual content file. For instance, to save all manually put in packages to the “Documents” folder, do:

apt-mark showmanual > ~/Paperwork/debian-packages-manually-installed.txt

Generate a listing of mechanically put in packages

Want to generate a listing of all the packages that had been mechanically put in to your Debian system in the course of the set up? If that’s the case, you’ll want to make use of the “showauto” characteristic in apt-mark.

Open up a terminal window utilizing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, enter the command-line operation beneath to get a listing of mechanically put in packages on Debian.

apt-mark showauto

Check out the generated listing within the terminal window. Or, if the listing of generated packages that apt-mark prints out are an excessive amount of to learn, think about including the “more” command-line argument to make sorting via them simpler.

apt-mark showauto | extra

To avoid wasting mechanically put in Debian packages for later, pipe it via to a textual content file with the command beneath.

apt-mark showauto > ~/Paperwork/debian-packages-auto-installed.txt

Reinstalling packages

To re-install the packages on the listing saved from a textual content file, open up a terminal window. Then, comply with the directions beneath.

Please observe that any packages that may not be re-downloaded (AKA had been put in through a downloadable DEB) is not going to set up with this methodology, and the Apt package deal supervisor will present an error for ones it’s unable to obtain.

Re-install manually put in packages

To re-install all the Debian apps on the listing of manually put in packages, enter the next command right into a terminal window.

sudo apt set up $(cat ~/Paperwork/debian-packages-manually-installed.txt | xargs)

If the packages are already on the system, however you’d like to re-install them anyway, add the “–reinstall” command-line swap.

sudo apt set up $(cat ~/Paperwork/debian-packages-manually-installed.txt | xargs) --reinstall

Re-install mechanically put in packages

To re-install all the Debian apps on the listing of mechanically put in packages, enter the command beneath right into a terminal window.

sudo apt set up $(cat ~/Paperwork/debian-packages-auto-installed.txt | xargs)

Alternatively, should you’d like to re-install stuff that’s already current on the system, add the “–reinstall” command-line swap.

sudo apt set up $(cat ~/Paperwork/debian-packages-auto-installed.txt | xargs) --reinstall



Source link

Share.
Leave A Reply

Exit mobile version