This is a simple script to install packages with multiple package managers (winget, choco, scoop, apt) to a file.
You can customize the priority of package managers, the commands to install packages, and so on.
It's designed for use in dotfiles.
Warning
This script is not a package manager. It's just a simple script to install packages with multiple package managers. So, you need to install the package managers before using this script manually.
Caution
Do not run this script with untrusted packages.yml.
Always review the file or run in a sandbox/container.
- Manage packages with multiple package managers with a single file.
- Customize the priority of package managers.
- Customize the commands to install packages.
- Supports Windows and Linux.
- powershell 7 (For running the script)
- bash (For running the script)
- sudo (For running as root)
- wget (For installing yq)
- winget
- scoop
- choco
- apt
- pacman
- Install the package managers you want to use.
- Copy mm2f.sh, mm2f.ps1, or both files to the directory where you want to use it.
- Edit the
packages.ymlfile. (You can use thepackages.example.ymlas an example.) - Run the script.
- Enjoy!
# packages.yml
# options is optional.
options:
windows:
# Priority of package managers to install packages.
priority: [winget, choco, scoop]
# Commands to install packages.
# You can use {id} as a placeholder for the package ID.
commands:
winget: winget install --id {id} -e --accept-package-agreements --accept-source-agreements
choco: choco install {id} -y
scoop: scoop install {id}
# Same as above, but for Linux.
linux:
priority: [apt, pacman]
commands:
apt: sudo apt install -y {id}
pacman: sudo pacman -S --noconfirm {id}
packages:
- name: Package name
winget: Winget package ID (Optional)
choco: Chocolatey package name (Optional)
scoop: Scoop package name (Optional)
apt: Apt package name (Optional)
pacman: Pacman package name (Only for Linux) (Optional)- You can set the package.yml file path with the first argument. (e.g.
mm2f.sh /path/to/packages.yml)
Default:./packages.yml