jdholtz / pacman-venv

Create an isolated virtual environment for Pacman and supported AUR helpers
MIT License
16 stars 1 forks source link

Pacman Virtual Environment

A tool to create isolated virtual environments for Pacman. This tool is inspired by Python's virtualenv and therefore works similarly.

Note: pacman-venv is still in its development and testing phase. Not all changes will be backwards compatible. To stay updated with the latest changes, check out the Changelog. Additionally, each update may require you to reinstall your virtual environment for the changes to be applied.

Table of Contents

Overview

Isolating system packages is beneficial for a few reasons:

How It Works

After sourcing the activation script, pacman-venv configures your current environment to correctly use the isolated environment.

Installation

The recommended way to install pacman-venv is with an AUR helper. Here is an example with Yay:

yay -S pacman-venv

The development version of this package can be installed with the pacman-venv-git package.

From Source

Pacman-venv can also be installed by cloning the PKGBUILD and building with makepkg:

pacman -S --needed git
git clone https://aur.archlinux.org/pacman-venv.git
cd pacman-venv
makepkg -si

Usage

Create a virtual environment in the current directory:

pacman-venv [name]

Note: If name is not specified, the default name will be used (pacman-venv)

To enter the virtual environment, source the {name}/bin/pacman-venv-active file (Add the .fish extension if you are using the Fish shell). Here is an example for Bash:

source pacman-venv/bin/pacman-venv-activate

Exit the virtual environment by either executing deactivate or exit.

For the full usage of the tool, run:

pacman-venv --help

Additional information on how to use pacman-venv can be found in the man page (man pacman-venv)

Supported Software

Below is a list of all shells and AUR helpers that pacman-venv currently supports

Shells

AUR Helpers

Contributing

If you run into any issues, please file it via GitHub Issues. Additionally, if you have any questions or discussion topics, start a GitHub Discussion.

Contributions are always welcome. Please read Contributing.md if you are considering making contributions.