This script automates the process of adding the CachyOS repositories to any Arch Linux-based distribution. CachyOS provides heavily optimized kernels and packages tailored for modern CPUs.
The script automatically detects your CPU's supported architecture (such as x86-64-v3, x86-64-v4, or znver4/5) and configures pacman to use the most optimal repositories for your specific hardware.
- Automatically detects CPU instruction set capabilities (x86-64-v3, x86-64-v4, znver4/5).
- Installs CachyOS keyring and mirrorlist.
- Backs up your current
/etc/pacman.confbefore making any modifications. - Configures
/etc/pacman.confwith the appropriate CachyOS repositories. - Refreshes pacman databases automatically.
- Provides an easy removal option to revert changes.
- An Arch Linux-based distribution (Arch Linux, EndeavourOS, Manjaro, Garuda, etc.)
sudoor root privilegesgit(to clone this repository)
First, download the script to your local machine:
git clone https://github.com/your-username/cachyos-repo.git(Note: Replace the URL with your actual GitHub repository URL once uploaded)
cd cachyos-repochmod +x cachyos-repo.shExecute the script with root privileges to install the repositories:
sudo ./cachyos-repo.shAlternatively, you can explicitly use the install flag:
sudo ./cachyos-repo.sh --installOnce the script finishes successfully, the repositories are added. You can now install CachyOS kernels or other optimized packages. For example:
sudo pacman -S linux-cachyos linux-cachyos-headersImportant: After installing the new kernel, you must update your bootloader and reboot your system to apply the changes.
If you are using GRUB, you can update it with:
sudo grub-mkconfig -o /boot/grub/grub.cfgFinally, reboot your computer and make sure to select the linux-cachyos kernel in the GRUB boot menu.
If you want to remove the CachyOS repositories and revert your pacman.conf to its original state, run the script with the --remove flag:
sudo ./cachyos-repo.sh --removeThis will restore the backup of your pacman.conf, remove the CachyOS mirrorlist and keyring, and perform a system update to sync repositories.
This project is licensed under the GNU General Public License v2.0 or later.