Re-install all packages on an APT-managed system, without changing (much) state.
https://gitlab.com/brlin/apt-reinstall-all-packages
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.
This section documents the usage of this utility:
-
Download the product release archive from the Releases page.
-
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[@]}"
-
Launch a text terminal application(if it is not launched already).
-
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.
-
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.
This section documents the environment variables that can customize the utility's behaviors according to your needs:
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.
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.
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.
This utility will always install the latest version available in the software archive, it WILL NOT preserve the original version installed in the system.
The following self/third-party materials are referenced during the development of this project:
- brlin-tw/apt-get_reinstall-all: 這是讓 apt-get 強制重新安裝系統目前已經安裝的所有軟體包的程式
Previous implementation. - Reinstalling all Debian packages - Unix & Linux Stack Exchange
Existing solutions to the same problem. - The dpkg(1) manual page
For information about the dpkg package states. - The dpkg-query(1) manual page
For querying all the installed packages in the system. - bash - Redirect all subsequent commands' stderr using exec - Unix & Linux Stack Exchange
Explains how to log script output from with-in the shell script. - The apt-mark(8) manual page
For querying the automatically/manually installed status of a installed package. Source
— List of fields — Control files and their fields — Debian Policy Manual
Explains the character set that composes a Debian source(and binary) package names.- The debconf(7) manual page
Explains how to avoid debconf's prompts to be shown during installation.
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.