-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathis_removed.sh
More file actions
executable file
·60 lines (44 loc) · 1.7 KB
/
is_removed.sh
File metadata and controls
executable file
·60 lines (44 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
##################################################################################################################
# Author : AKM
# Disribution : ArchLinux only
##################################################################################################################
## Simple but not accurate with full matching pkg names (linux, linux-xanmod)
#paru -R $1
#if [ $? -eq 0 ]; then
# echo "Package $1 has removed!"
#else
# echo "Package $1 has NOT removed!"
#fi
## More Accurate
# Check pkg is installed or not, then remove.
package="$1"
if pacman -Qi $package &> /dev/null ; then
pactree -d 1 "${package}"
echo "============================================================================"
echo "See pactree for the ${package} above :"
echo "Do you want to remove ${package} with its all dependencies?"
tput setaf 1
echo "Proceed with cautions!! (y/n)" ;
tput sgr0
echo "============================================================================"
read -r CHOICE
case $CHOICE in
y )
sudo pacman -Rnsudd "${package}"
;;
n )
sudo pacman -Rdd "${package}"
;;
* )
echo "============================================================================"
echo "Type y/n only."
echo "============================================================================"
;;
esac
else
echo "============================================================================"
echo "${package} is NOT installed."
echo "Please type pkg name correctly or choose installed pkg only."
echo "============================================================================"
fi