Sys-Config is a simple tool designed to automate the installation of packages on popular Linux distributions using a JSON configuration file. It adapts to the system's package manager and configuration requirements, making setup easier and more consistent across distributions.
- Supports Debian-based, Fedora-based, and Arch-based Linux distributions.
- Reads a JSON configuration file to determine the packages to install.
- Automatically detects and uses the appropriate package manager (
apt,dnf,pacman). - Checks if the user is running as
rootand adapts by skippingsudoif already root. - Installs
jqautomatically if not already present. - Displays a detailed list of installed packages after the script completes.
- Linux-based system with one of the following package managers:
apt(Debian/Ubuntu)dnf(Fedora)pacman(Arch)
- Either
wgetorcurlinstalled to fetch the script or configuration file.
The script reads a JSON configuration file to determine the packages to install. You can provide the configuration file in several ways, including interactively, via the --config flag, or through remote execution with curl or wget.
Run the script without arguments, and it will prompt you for the configuration file:
bash sysconfig.shExample prompt:
No config file provided.
Please enter the path or URL to the config file:
You can directly specify the configuration file using the --config flag.
bash sysconfig.sh --config ./Sample-Config.jsonbash sysconfig.sh --config https://raw.githubusercontent.com/animegamer4422/Sys-Config/main/Sample-Config.jsonRun the script remotely and specify the config file:
curl -fSsl https://raw.githubusercontent.com/animegamer4422/Sys-Config/main/sysconfig.sh | bash -s -- --config https://raw.githubusercontent.com/animegamer4422/Sys-Config/main/Sample-Config.jsonRun the script remotely and specify the config file:
wget -qO- https://raw.githubusercontent.com/animegamer4422/Sys-Config/main/sysconfig.sh | bash -s -- --config https://raw.githubusercontent.com/animegamer4422/Sys-Config/main/Sample-Config.jsonThe script uses a JSON file to determine which packages to install based on the system's distribution. You can specify the configuration file as a local path or a remote URL.
You can find the sample configuration file in the repository:
Sample-Config.json
Below is an example of how the configuration file is structured:
{
"fedora": {
"server": ["htop", "curl", "nano"],
"laptop": ["vlc", "curl", "nano"]
},
"debian": {
"server": ["htop", "curl", "nano"],
"laptop": ["vlc", "curl", "nano"]
},
"arch": {
"server": ["htop", "curl", "nano"],
"laptop": ["vlc", "curl", "nano"]
}
}After successful execution, the script lists the packages that were installed:
The following packages were installed:
- curl
- vim
- htop
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m "Feature description"). - Push to your fork (
git push origin feature-name). - Submit a pull request.