epkg User Guide
Introduction
This document describes how to initialize the environment of the EPKG package manager and how to use its basic functions. The examples in this document are based on a non-root user. Note: Currently, only the EPKG package for AArch64 is provided. Other architectures will be supported in the future.
Quick Start
The following example shows how to install different package versions.
# Download EPKG.
wget https://repo.oepkgs.net/openeuler/epkg/epkg-0.1.0-1.aarch64.rpm && sudo yum -y install epkg-0.1.0-1.aarch64.rpm
# After the EPKG package is added to the repository, you can directly run "yum install epkg" to install it.
# Initialize EPKG.
epkg init
bash
# Re-execute .bashrc to make the new PATH effective.
# Create environment 1.
epkg create t1
epkg install tree
tree --version
which tree
# View repositories.
[root@vm-4p64g ~]# epkg repo list
------------------------------------------------------------------------------------------------------------------------------------------------------
channel | repo | url
------------------------------------------------------------------------------------------------------------------------------------------------------
openEuler-22.03-LTS-SP3 | OS | https://repo.oepkgs.net/openeuler/epkg/channel/openEuler-22.03-LTS-SP3/OS/aarch64/
openEuler-24.09 | everything | https://repo.oepkgs.net/openeuler/epkg/channel/openEuler-24.09/everything/aarch64/
openEuler-24.09 | OS | https://repo.oepkgs.net/openeuler/epkg/channel/openEuler-24.09/OS/aarch64/
------------------------------------------------------------------------------------------------------------------------------------------------------
# Create environment 2, specifying the repository.
epkg create t2 --repo openEuler-22.03-LTS-SP3
epkg install tree
tree --version
which tree
# Switch back to environment 1.
epkg activate t1
Installation Tutorial
# Download EPKG.
wget https://repo.oepkgs.net/openeuler/epkg/epkg-0.1.0-1.aarch64.rpm
sudo yum install epkg-0.1.0-1.aarch64.rpm // After adding to the repo, you can directly execute yum install epkg
# Or execute
curl -sSL https://repo.oepkgs.net/openeuler/epkg/rootfs/downloader.sh -o /tmp/
bash /tmp/downloader.sh
# Initialize EPKG.
epkg init
bash // Re-execute .bashrc to obtain the new PATH
# Create an environment.
epkg create $env
epkg install $package
EPKG Package Manager Usage Instructions
Usage:
epkg install PACKAGE
epkg install [--env ENV] PACKAGE (under development)
epkg remove [--env ENV] PACKAGE (under development)
epkg upgrade [PACKAGE] (under development)
epkg search PACKAGE (under development)
epkg list (under development)
epkg env list
epkg create|remove ENV
epkg activate ENV
epkg deactivate ENV
epkg enable|disable ENV (under development)
epkg env history ENV (under development)
epkg env rollback ENV (under development)
Package installation:
epkg create $env // Create an environment.
epkg install $package // Install a package in the environment.
epkg create $env2 --repo $repo // Create environment 2, specifying the repository.
epkg install $package // Install a package in environment 2.
Installing Software
Function ddescription:
Installs software in the current environment (you are advised to confirm the current environment in advance).
Command:
epkg install ${package_name}
Return example:
[root@2d785c36ee2e /]# epkg activate t1
Add common to path
Add t1 to path
Environment 't1' activated.
Environment 't1' activated.
[root@2d785c36ee2e /]# epkg install tree
EPKG_ENV_NAME: t1
Caching repodata for: "OS"
Cache for "OS" already exists. Skipping...
Caching repodata for: "OS"
Cache for "OS" already exists. Skipping...
Caching repodata for: "everything"
Cache for "everything" already exists. Skipping...
start download https://repo.oepkgs.net/openeuler/epkg/channel/openEuler-24.09/everything/aarch64//store/FF/FFCRTKRFGFQ6S2YVLOSUF6PHSMRP7A2N__ncurses-libs__6.4__8.oe2409.epkg
############################################################################################################################################################################################################### 100.0%
...
start install E4KCO6VAAQV5AJGNPW4HIXDHFXMR4EJV__ncurses-base__6.4__8.oe2409
Listing Environments
Function description:
Lists all current EPKG environments (under the $EPKG_ENVS_ROOT directory) and the current active environment.
Command:
epkg env list
Return example:
[small_leek@19e784a5bc38 bin]# epkg env list
Available environments(sort by time):
w1
main
common
You are in [main] now
Creating an Environment
Function description:
Creates an environment (the new environment is activated by default after creation, meaning it is switched to. However, it is not globally enabled).
Command:
epkg create ${env_name}
Return example:
[small_leek@b0e608264355 bin]# epkg create work1
YUM --installroot directory structure created successfully in: /root/.epkg/envs/work1/profile-1
Environment 'work1' added to PATH.
Environment 'work1' activated.
Environment 'work1' created.
re-open shell
Activating an Environment
Function description:
Activates the specified environment, refreshes EPKG_ENV_NAME and RPMDB_DIR (used to point --dbpath when software is installed to the specified environment), refreshes PATH to include the specified environment and the common environment, and sets the specified environment as the highest priority.
Command:
epkg activate ${env_name}
Return example:
[small_leek@9d991d463f89 bin]# epkg activate main
YUM --installroot directory structure created successfully in: /root/.epkg/envs/main/profile-1
Environment 'main' activated.
re-open shell
Deactivating an Environment
Function description:
Deactivates the specified environment, refreshes EPKG_ENV_NAME and RPMDB_DIR, and refreshes PATH to point to the main environment by default.
Command:
epkg deactivate ${env_name}
Return example:
[small_leek@398ec57ce780 bin]# epkg deactivate w1
Environment 'w1' deactivated.
re-open shell
Enabling an Environment
Function description:
Enables the specified environment, persistently refreshes PATH to include all enabled EPKG environments, and sets the specified environment as the highest priority.
Command:
epkg enable ${env_name}
Return example:
[small_leek@5042ae77dd75 bin]# epkg enable lkp
add common to path
add main to path
add xsl to path
add lkp to path
Environment 'lkp' added to PATH.
re-open shell
Disabling an Environment
Function description:
Disables the specified environment and persistently refreshes PATH to include all enabled EPKG environments except the specified one.
Command:
epkg disable ${env_name}
Return example:
[small_leek@69393675945d /]# epkg disable w4
Warning: Don't try to disable current env!
Warning: you are trying to disable current env!
sure to continue? (y: continue, others: exit)
y
Environment 'w4' removed from PATH.
re-open shell




