• /var/backups, how to restore ?

    From Erwan David@21:1/5 to All on Tue Sep 3 14:10:02 2024
    In /var/backups I find
    alternatives.tar.0
    apt.extended_states.0
    dpkg.arch.0
    dpkg.diversions.0
    dpkg.statoverride.0
    dpkg.status.0

    and older versions (upto .6.gz) of same files.

    I understand it is backup of different dpkg/apt states. But what I do
    not find is how to use those files ?

    I backup them on other disks, but if my PC crashed, how an I use this
    to install a new PC, with same packages ?

    I do following commands before my backups, to be able to reinstall,
    but maybe they are not necessayer (except that I know how to use the
    files)

    - dpkg-query -f '${binary:Package}\n' -W > /var/backups/installed_pkgs.txt
    - apt-mark showmanual > /var/backups/manualpkgs.txt
    - debconf-get-selections > /var/backups/debconf.txt


    --
    Erwan David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Erwan David on Tue Sep 3 14:20:01 2024
    On Tue, Sep 03, 2024 at 14:08:37 +0200, Erwan David wrote:
    I backup them on other disks, but if my PC crashed, how an I use this
    to install a new PC, with same packages ?

    If all you want is the list of packages, your best bet would be to ignore
    *all* of those files, and create a new backup of:

    dpkg --get-selections

    Just redirect that to a file, and save that file along with your other
    backup files. You don't even need to be root for this step.

    To load that list of packages on a new installation, you use these
    commands:

    dpkg --set-selections < your-file
    apt-get dselect-upgrade

    (You must be root for those.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)