Tum (TheUnixManager) is a universal package management and initialization system library created by Archetypum, designed to simplify interaction with various UNIX-like systems and streamline the creation of system-related scripts.
This is the Bash implementation of tum
.
Because interacting with countless package managers and init systems across UNIX-like platforms is painful — tum
fixes that.
tum
requires only one dependency - GNU Bash. You can install it on practically any UNIX-like operating system.
You can use tum-bash
modules separately
git clone https://github.com/Archetypum/tum-bash.git
cd tum-bash
mv lib/unix.sh your_desired_location/
mv lib/package_manager/apt.sh your_desired_location/
mv lib/init_system/systemd.sh your_desired_location/
Or use the whole tum-bash
in a single file:
git clone https://github.com/Archetypum/tum-bash.git
cd tum-bash
mv tum your_desired_location/ # For convenience, Archetypum recommends '/usr/bin/tum' path.
You can find tum-bash
documentation inside the doc/
directory.
You can find automatic tests inside the t/
directory.
If you want test your installation manually:
./autotests.sh
- apt, apt-get, apt-cache, apt-cdrom, apt-config, apt-extracttemplates, apt-listchanges, apt-mark, apt-sortpkgs, aptitude, aptitude-create-state-bundle, aptitude-run-state-bundle, dpkg
- pacman, yay, trizen, pamac
- portage (open for pull requests)
- slackpkg
- apk
- xbps-install, xbps-remove, xbps-query
- guix
- qi
- pkg_add, pkg_delete, pkg_create, pkg_info
- pkg
- pkgin
- yum, dnf
- zypper, zypper-log
- homebrew
-
systemd
-
sysvinit
-
openrc
-
runit
-
s6
-
dinit
-
launchd
#!/bin/bash
source unix.sh
DISTRO=$(get_user_distro)
echo -e "${GREEN}Detected distribution: ${DISTRO}${RESET}"
if macos_based "$DISTRO" "$MACOS_BASED"; then
echo -e "${GREEN}This is a macOS-based system.${RESET}"
else
echo -e "${GREEN}This is NOT a macOS-based system.${RESET}"
fi
INIT_SYSTEM=$(get_init_system)
echo -e "${GREEN}Detected init system: ${INIT_SYSTEM}${RESET}"
#!/bin/bash
source sysvinit.sh
SERVICE_NAME="ssh"
echo -e "${GREEN}Starting service '$SERVICE_NAME'...${RESET}"
start_service "$SERVICE_NAME"
echo -e "${GREEN}Checking status of service '$SERVICE_NAME'...${RESET}"
status_service "$SERVICE_NAME"
echo -e "${GREEN}Restarting service '$SERVICE_NAME' using execute_service function...${RESET}"
execute_service restart "$SERVICE_NAME"
echo -e "${GREEN}Stopping service '$SERVICE_NAME'...${RESET}"
stop_service "$SERVICE_NAME"
echo -e "${GREEN}Trying unknown command with execute_service...${RESET}"
execute_service foobar "$SERVICE_NAME"
#!/bin/bash
source apk.sh
echo "=== Display apk version ==="
apk_version
echo -e "\n=== Show apk help ==="
apk_help
echo -e "\n=== Update package index ==="
apk_update
echo -e "\n=== Search for package 'bash' ==="
apk_search bash
echo -e "\n=== Show info about package 'bash' ==="
apk_info bash
echo -e "\n=== List installed packages ==="
apk_list
echo -e "\n=== Add package 'curl' (dry-run) ==="
apk_add --simulate curl
echo -e "\n=== Remove package 'curl' (dry-run) ==="
apk_del --simulate curl
tum-bash is free software, released under the GNU Lesser General Public License v3.
See: