diff --git a/README.md b/README.md index 52df8c0..32c8d4f 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,24 @@ This script echoes a bunch of 24-bit color codes to the terminal to demonstrate --- +### [reinstall-packages-with-missing-files.sh](ShellScripts/reinstall-packages-with-missing-files.sh) + +Reinstall all packages with missing files +This script uses the `pacman` package manager to check for packages with +missing files. It then iterates over each package and reinstalls it using +`pacman`. The `--overwrite` flag is used to ensure that any conflicting +files are overwritten. Finally, the `--noconfirm` flag is used to avoid +confirmation prompts for each package. + +> Warning: This script should be run as root. + +Usage: +> Note needs to be run as root. + +```Bash +./ShellScripts/reinstall-packages-with-missing-files.sh +``` + ### [rsync-incremental-backups.sh](ShellScripts/rsync-incremental-backups.sh) This script performs incremental backups of the specified source directory using rsync, and it keeps a symbolic link called 'latest' pointing to the most recent backup for easy reference. The script also logs backup details in a log file with a timestamp. Make sure to replace `` and `` with your actual source and backup directories. diff --git a/ShellScripts/reinstall-packages-with-missing-files.sh b/ShellScripts/reinstall-packages-with-missing-files.sh new file mode 100755 index 0000000..2703d4c --- /dev/null +++ b/ShellScripts/reinstall-packages-with-missing-files.sh @@ -0,0 +1,4 @@ +pacman -Qk 2>/dev/null | grep -v ' 0 missing files' | cut -d: -f1 | + while read -r package; do + pacman -S "$package" --overwrite "*" --noconfirm + done