-
-
Save neubian/09794819c51e3474d6d86e184f61d0ad to your computer and use it in GitHub Desktop.
Install byobu from source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Forked from Original work by Kerren Ortlepp | |
| # as explained at https://blog.entrostat.com/install-byobu-on-any-linux-distro/ | |
| set -e | |
| # Colors for output | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| BLUE='\033[0;34m' | |
| NC='\033[0m' # No Color | |
| # Parse command line arguments | |
| RELEASE="" | |
| while [[ $# -gt 0 ]]; do | |
| case $1 in | |
| --release=*) | |
| RELEASE="${1#*=}" | |
| shift | |
| ;; | |
| --release|-r) | |
| RELEASE="$2" | |
| shift 2 | |
| ;; | |
| -h|--help) | |
| echo "Usage: $0 [--release|-r VERSION]" | |
| echo " --release, -r VERSION Install specific byobu release version" | |
| echo " -h, --help Show this help message" | |
| exit 0 | |
| ;; | |
| *) | |
| echo -e "${RED}Unknown option: $1${NC}" | |
| echo "Use -h or --help for usage information" | |
| exit 1 | |
| ;; | |
| esac | |
| done | |
| # Function to check if command exists | |
| check_dependency() { | |
| local cmd=$1 | |
| if command -v "$cmd" >/dev/null 2>&1; then | |
| echo -e " ${GREEN}[✓]${NC} $cmd" | |
| return 0 | |
| else | |
| echo -e " ${RED}[✗]${NC} $cmd ${RED}(missing)${NC}" | |
| return 1 | |
| fi | |
| } | |
| # Check all dependencies with colorful output | |
| echo -e "${BLUE}Checking dependencies...${NC}" | |
| failed_deps=0 | |
| check_dependency "tar" || ((failed_deps++)) | |
| check_dependency "screen" || ((failed_deps++)) | |
| check_dependency "tmux" || ((failed_deps++)) | |
| check_dependency "make" || ((failed_deps++)) | |
| check_dependency "git" || ((failed_deps++)) | |
| check_dependency "curl" || ((failed_deps++)) | |
| if [[ $failed_deps -gt 0 ]]; then | |
| echo -e "${RED}Error: $failed_deps dependencies are missing. Please install them before continuing.${NC}" | |
| echo -e "${GREEN}Suggestion: try runnining: sudo dnf -y install tmux tar screen make git curl ${NC}" | |
| exit 1 | |
| fi | |
| echo -e "${GREEN}All dependencies are available!${NC}" | |
| # Validate release version if specified | |
| if [[ -n $RELEASE ]]; then | |
| echo -e "${BLUE}Validating release version $RELEASE...${NC}" | |
| # Check if the release exists on GitHub | |
| if curl -s --head "https://github.com/dustinkirkland/byobu/releases/tag/$RELEASE" | head -n 1 | grep -q "200 OK"; then | |
| echo -e "${GREEN}Release $RELEASE is valid!${NC}" | |
| echo "Cloning byobu release $RELEASE" | |
| git clone --branch "$RELEASE" --single-branch https://github.com/dustinkirkland/byobu.git | |
| else | |
| echo -e "${RED}Error: Release $RELEASE not found. Please double-check the release number.${NC}" | |
| echo -e "${YELLOW}You can find available releases at: https://github.com/dustinkirkland/byobu/releases${NC}" | |
| exit 1 | |
| fi | |
| else | |
| echo -e "${BLUE}Cloning byobu latest${NC}" | |
| git clone https://github.com/dustinkirkland/byobu.git | |
| fi | |
| cd byobu | |
| echo "Configuring and building" | |
| ./autogen.sh | |
| ./configure | |
| sudo make install | |
| byobu-select-backend tmux | |
| echo "" | |
| echo "" | |
| echo "" | |
| echo "" | |
| echo "You're ready to go! Just type:" | |
| echo "" | |
| echo "" | |
| echo "byobu" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment