Add: shell script for reinstalling packages that have missing files with pacman
This commit is contained in:
parent
6385b48feb
commit
6e7385ecf1
2 changed files with 22 additions and 0 deletions
18
README.md
18
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)
|
### [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 `<input folder>` and `<output folder>` with your actual source and backup directories.
|
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 `<input folder>` and `<output folder>` with your actual source and backup directories.
|
||||||
|
|
4
ShellScripts/reinstall-packages-with-missing-files.sh
Executable file
4
ShellScripts/reinstall-packages-with-missing-files.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue