Skip to content

(MIRROR) Re-install all packages on an APT-managed system, without changing (much) state.

Notifications You must be signed in to change notification settings

brlin-tw/apt-reinstall-all-packages

Repository files navigation

apt-reinstall-all-packages

Re-install all packages on an APT-managed system, without changing (much) state.

https://gitlab.com/brlin/apt-reinstall-all-packages
The GitLab CI pipeline status badge of the project's main branch GitHub Actions workflow status badge pre-commit enabled badge REUSE Specification compliance badge

Features

The following are the notable features of this product:

  • Will not affect the "automatically installed" state of the packages, allow unused packages to be automatically removed when not used.
  • Support fast-forwarding to start from user specified package, allowing the user to resume an interrupted process.
  • Support re-installing user-specified subset of packages instead, useful for retrying the re-installation.

Usage

This section documents the usage of this utility:

  1. Download the product release archive from the Releases page.

  2. Extract the product release archive using your preferred archive manipulation application, or, run the following command in a text terminal application:

    tar_opts=(
        # Extract the specified archive
        --extract
        --file /path/to/apt-reinstall-all-packages-X.Y.Z.tar.gz
    
        # Display files that are extracted
        --verbose
    )
    tar "${tar_opts[@]}"
  3. Launch a text terminal application(if it is not launched already).

  4. Refer the Environment variables that can customize the utility's behaviors and the Internal variables that can customize the utility's behaviors section for ways to customize the utility's behaviors.

  5. Run the utility program by running the following command as root:

    /path/to/apt-reinstall-all-packages-X.Y.Z/apt-reinstall-all-packages _subset packages_...

    The subset packages command-line arguments are only needed if you prefer to only re-install these subset packages, if omitted all non-excluded packages are re-installed.

Environment variables that can customize the utility's behaviors

This section documents the environment variables that can customize the utility's behaviors according to your needs:

START_FROM_PACKAGE

Specify the name of the package to start the re-installation from. This is useful for resuming an interrupted reinstallation session.

Default value: (null): Start from the first installed package.

Internal variables that can customize the utility's behaviors

This section documents the internal variables that can customize the utility's behaviors according to your needs. You need to edit the utility program using a plaintext editor to change the definition of the variables.

EXCLUDED_PACKAGE_NAME_REGEXES

This array variable holds the POSIX extended regular expression patterns to match the name of the packages you don't want to run the re-installation. This may be useful for packages that don't matter much from being corrupted like documentation, etc.

Default value: (null): None is excluded.

Refer the existing program comment for some examples.

Note

This utility will always install the latest version available in the software archive, it WILL NOT preserve the original version installed in the system.

References

The following self/third-party materials are referenced during the development of this project:

Licensing

Unless otherwise noted(individual file's header/REUSE DEP5), this product is licensed under the 4.0 International version of the Creative Commons Attribution-ShareAlike license, or any of its more recent versions of your preference.

This work complies to the REUSE Specification, refer the REUSE - Make licensing easy for everyone website for info regarding the licensing of this product.