-
Notifications
You must be signed in to change notification settings - Fork 12
/
install_ncurses.sh
40 lines (40 loc) · 1.1 KB
/
install_ncurses.sh
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
#!/bin/bash
# Detect Linux distribution
if [ -f /etc/os-release ]; then
. /etc/os-release
DISTRO=$ID
else
echo "Unsupported distribution or /etc/os-release not found."
exit 1
fi
# Function to install ncurses based on distro
install_ncurses() {
case "$DISTRO" in
ubuntu|debian)
echo "Detected Debian/Ubuntu-based distribution."
sudo apt update && sudo apt install -y ncurses-bin
;;
fedora)
echo "Detected Fedora-based distribution."
sudo dnf install -y ncurses
;;
centos|rhel)
echo "Detected CentOS/RHEL-based distribution."
sudo yum install -y ncurses
;;
arch)
echo "Detected Arch-based distribution."
sudo pacman -S --noconfirm ncurses
;;
opensuse|suse)
echo "Detected OpenSUSE-based distribution."
sudo zypper install -y ncurses
;;
*)
echo "Unsupported Linux distribution: $DISTRO"
exit 1
;;
esac
}
# Execute the function
install_ncurses