diff options
| author | emmett1 <emmett1.2miligrams@protonmail.com> | 2026-02-28 22:53:30 +0800 |
|---|---|---|
| committer | emmett1 <emmett1.2miligrams@protonmail.com> | 2026-02-28 22:53:30 +0800 |
| commit | 9a5c52ca0ef1b2d82f7d87b27bf957b97c6bf711 (patch) | |
| tree | d36e214338ef0d146ceab51ae835dd5cb58bf262 /docs/packagemanager.md | |
| parent | 366a5b947f96acd519bb35fbb7b1b794ded85699 (diff) | |
| download | alicelinux-9a5c52ca0ef1b2d82f7d87b27bf957b97c6bf711.tar.gz alicelinux-9a5c52ca0ef1b2d82f7d87b27bf957b97c6bf711.zip | |
updated website
Diffstat (limited to 'docs/packagemanager.md')
| -rw-r--r-- | docs/packagemanager.md | 160 |
1 files changed, 73 insertions, 87 deletions
diff --git a/docs/packagemanager.md b/docs/packagemanager.md index 12b49334..1bd44909 100644 --- a/docs/packagemanager.md +++ b/docs/packagemanager.md @@ -1,32 +1,29 @@ -PACKAGE MANAGER +Package Manager =============== -In Alice, there are two package managers: [spm](https://codeberg.org/emmett1/spm) and [autils](https://codeberg.org/emmett1/autils): - * `spm` was written for generic package manager for linux distribution. - * `autils` is written specifically for `Alice` and required `spm`. +In Alice, theres two package manager used, [spm](https://codeberg.org/emmett1/spm) and [autils](https://codeberg.org/emmett1/autils). Why two package manager? `spm` was written for generic package manager for linux distribution. And `autils` is written specifically for `Alice` and required `spm`. spm --- -`spm` stands for `simple package manager` and is a simple and minimal POSIX compliant shell script. It only depends on core utils and tar (or busybox's utils and tar). `spm` is only intended for compressing some directory into package, then extract package into the system with files being tracked into the database. There is is no build script, recipe or ports in `spm`. You can write your own tools to use with `spm` either like Arch Linux's `makepkg`, CRUX's `pkgmk` or Slackware's `slackbuild` script. +`spm` stands for `simple package manager`. It does simple and minimal written in POSIX compliance shell script. It only depends on core utils and tar (or busybox's utils and tar). `spm` only intended for compressing some directory into package, then extract package into system with files being tracked into database. Theres is no build script, recipe or ports in `spm`. You can write your own tools to use with `spm` either like Arch Linux's `makepkg`, CRUX's `pkgmk` or Slackware's `slackbuild` script. spm - usage ----------- -The following optiosn are available to `spm`: - +list `spm` usage: ``` - -a print all installed packages - -b <path> build <path> directory into package - -h print this help message - -i <file> install <file> package into system - -l <pkg> list files installed by <pkg> - -o <file> print owner of <file> - -r <name> remove installed <name> from system - -u <pkg> re-install/upgrade <pkg> +-a print all installed packages +-b <path> build <path> directory into package +-h print this help message +-i <file> install <file> package into system +-l <pkg> list files installed by <pkg> +-o <file> print owner of <file> +-r <name> remove installed <name> from system +-u <pkg> re-install/upgrade <pkg> ``` -- list all installed packages with their version: +list all install package with version: ``` $ spm -a ... @@ -41,7 +38,7 @@ nsxiv 32-1 ... ``` -- build a package from directory: +build package from directory: ``` (build package) $ ./configure --prefix=/usr @@ -60,7 +57,7 @@ $ make DESTDIR=$PWD/fakeroot install # spm -i pkgname#pkgversion-pkgrelease.spm ``` -- install a package into system: +install package into system: ``` # spm -i pkgname#pkgversion-pkgrelease.spm [pkgname] Verify package... @@ -69,9 +66,8 @@ $ make DESTDIR=$PWD/fakeroot install [pkgname] Package 'pkgname#pkgversion-pkgrelease' installed. ``` -- list files installed by 'packagename': +list files installed by 'packagename'$ spm -l test: ``` -$ spm -l test usr/ usr/share/ usr/share/aaa @@ -79,7 +75,7 @@ usr/bin/ usr/bin/aaa ``` -- list package owner of a file (can use regex): +list package owner of a file (can use regex): ``` $ spm -o gcc$ ccache usr/lib/ccache/gcc @@ -88,7 +84,7 @@ gcc usr/bin/x86_64-pc-linux-musl-gcc linux lib/modules/6.6.41-Alice/build/scripts/dummy-tools/gcc ``` -- upgrade/reinstall installed package: +upgrade/reinstall installed package: ``` # spm -u pkgname#pkgversion-pkgrelease.spm [pkgname] Verify package... @@ -99,13 +95,11 @@ linux lib/modules/6.6.41-Alice/build/scripts/dummy-tools/gcc spm - environment ----------------- - -|env|description| -|-|-| -|SPM_ROOT|use custom root location for package installation| -|SPM_FORCEINSTALL|set any value to ignore conflicted files| - -You can pass these environment to the `spm` command: +``` +SPM_ROOT: use custom root location for package installation +SPM_FORCEINSTALL: set any value to ignore conflicted files +``` +You can pass these environment to `spm` command, example: ``` # SPM_ROOT=/mnt/rootfs spm -i pkgname#pkgversion-pkgrelease.spm # SPM_FORCEINSTALL=1 SPM_ROOT=/mnt/rootfs spm -i pkgname#pkgversion-pkgrelease.spm @@ -119,10 +113,9 @@ autils apkg ---- -`apkg` is a main package manager that can solve dependencies, batch install/upgrade/remove packages, perform system upgrades, trigger necessary caches, etc. `apkg` can be run inside or outside the package template. - -When running outside the package template, `apkg` will need 'package names' as arguments, and those 'package names' will search through the `APKG_REPO` environment: +`apkg` is a main package manager that can solve dependencies, batch install/upgrade/remove packages, system upgrades, trigger necessary caches, and etc. `apkg` can be run inside or outside package template. +When running outside package template, `apkg` will need 'package names' as arguments, and those 'package names' will search through `APKG_REPO` environment. Example: ``` # apkg testpkg testpkg2 (build testpkg and testpkg2) # apkg testpkg testpkg2 -i (build and install testpkg and testpkg2) @@ -130,39 +123,36 @@ When running outside the package template, `apkg` will need 'package names' as a # apkg -f -u testpkg testpkg2 (force rebuild then upgrade/reinstall testpkg and testpkg2) ``` -When running inside package template, `apkg` will perform the operation within the current directory package. Example: - +When running inside package template, `apkg` will do operation for current directory package. Example: ``` # cd /path/to/local/testpkg # apkg (build testpkg) # apkg -i (build and install testpkg) # apkg -u (upgrade/reinstall testpkg) # apkg -u -f (force rebuild then upgrade/reinstall testpkg) - ``` apkg - usage ------------ - ``` - -i <pkg(s)> install package(s) - -I <pkg(s)> install packages(s) with dependencies - -d <pkg> list <pkg> dependencies - -D <pkg(s)> list all dependencies - -j <pkg> list all dependents - -u <pkg(s)> upgrade package(s) - -t [pkg(s)] trigger system cache/db updates - -U update system - -f force rebuild - -o <pkg(s)> download source - -p <pkg> print package path - -s <pattern> search packages - -h print this help message +-i <pkg(s)> install package(s) +-I <pkg(s)> install packages(s) with dependencies +-d <pkg> list <pkg> dependencies +-D <pkg(s)> list all dependencies +-j <pkg> list all dependents +-u <pkg(s)> upgrade package(s) +-t [pkg(s)] trigger system cache/db updates +-U update system +-f force rebuild +-o <pkg(s)> download source +-p <pkg> print package path +-s <pattern> search packages +-h print this help message ``` -Here are some quick tips/tricks to using `apkg`: +I won't explain details on every each options here, but I will give quick tips/tricks to use `apkg` -- installing package and its dependencies (mind the uppercase `i`) +installing package and its dependencies (mind the uppercase `i`): ``` # apkg -I sway [...] Solving dependencies... @@ -171,7 +161,7 @@ Here are some quick tips/tricks to using `apkg`: [...] Press Ctrl + C to abort. ``` -- search available packages +search available packages: ``` $ apkg -s sway swaybg @@ -181,7 +171,7 @@ swayidle swayfx ``` -- install all package with 'sway' name and its dependencies +install all package with 'sway' name and its dependencies: ``` # apkg -I $(apkg -s sway) ... @@ -196,14 +186,14 @@ swayfx [...] Press Ctrl + C to abort. ``` -- install package without solving dependencies (note the lowercase `i` and theres no prompt for this option) +install package without solving dependencies (mind the lowercase `i` and theres no prompt for this option): ``` # apkg -i wlroots mesa [...] Package 'wlroots' already installed. [...] Package 'mesa' already installed. ``` -- list all installed packages +list all installed packages: ``` $ apkg -a ... @@ -217,7 +207,7 @@ rust ... ``` -- list all installed packages with filter (will only print installed package containing the word filter) +list all installed packages with filter (will only print installed package contains word filter): ``` $ apkg -a sway swaybg @@ -226,7 +216,7 @@ swayidle swaylock ``` -- list dependencies of a package +list dependencies of a package: ``` $ apkg -d sway wlroots @@ -234,7 +224,7 @@ json-c pango ``` -- list all dependencies tree of package(s) +list all dependencies tree of package(s): ``` $ apkg -D sway dwm ... @@ -247,7 +237,7 @@ util-macros ... ``` -- upgrade/reinstall packages +upgrade/reinstall package(s): ``` # apkg -u wlroots cwm pango [wlroots] Verify package... @@ -264,7 +254,7 @@ util-macros [pango] Package 'pango#1.54.0-1' upgraded. ``` -- full system upgrades (note the uppercase `u` and will prompt first if there is a package update available) +full system upgrades (mind uppercase `u` and will prompt first if theres package updates): ``` # apkg -U [...] Checking for outdated packages... @@ -274,24 +264,23 @@ util-macros [...] Press Ctrl + C to abort. ``` -- make full system rebuild in dependencies order (`-f`: force rebuild, `-u`: upgrade/reinstall, `-D`: solve dependency order, `-a`: list all installed package) +make full system rebuild in dependencies order (`-f`: force rebuild, `-u`: upgrade/reinstall, `-D`: solve dependency order, `-a`: list all installed package(s)): ``` # apkg -f -u $(apkg -D $(apkg -a)) ... -(start rebuilding package here) +(start rebuilding package in dependencies order here) ... ``` -- remove installed packages +remove installed packages: ``` # apkg -r wlroots pango sway [...] Package 'wlroots' removed. [...] Package 'pango' removed. [...] Package 'sway' removed. - ``` -- print package path +print package path: ``` $ apkg -p sway /home/emmett/codeberg/alicelinux/repos/wayland/sway @@ -301,28 +290,25 @@ apkg - environment ------------------ You can pass environment to `apkg` to override defaults and in `/etc/apkg.conf`. Available environment and its default value as follows: - ---- -|env|default value|description| -|-|-|-| -|APKG_ROOT|/|root for package installation| -|APKG_CONF|/etc/apkg.conf|apkg's config file| -|APKG_REPO| |defaults is empty, template repo path, space separated variable| -|APKG_PACKAGE_DIR|$PWD|prebuilt package directory path| -|APKG_SOURCE_DIR|$PWD|package source directory path| -|APKG_WORK_DIR|$PWD|package working directory path| -|APKG_NOPROMPT| |skip prompt, use any value| - +``` + env default value description +APKG_ROOT / root for package installation +APKG_CONF /etc/apkg.conf apkg's config file +APKG_REPO defaults is empty, template repo path, space separated variable +APKG_PACKAGE_DIR $PWD prebuilt package directory path +APKG_SOURCE_DIR $PWD package source directory path +APKG_WORK_DIR $PWD package working directory path +APKG_NOPROMPT defaults is empty, skip prompt, use any value +``` You can add these environment into `apkg` config file. -apkg - config file +/etc/apkg.conf ------------------ -`apkg` can work without its config file by using all default values. Default config path for `apkg` is `/etc/apkg.conf`. You can change config path by appending `APKG_CONF` to `apkg`: +`apkg` can work without its config file by using all default value. Default config path for `apkg` is `/etc/apkg.conf`. You can override config path by append `APKG_CONF` to `apkg`, example: ``` # APKG_CONF=/etc/apkg-local.conf apkg <args> ``` - revdep ------ @@ -337,10 +323,11 @@ $ revdep $ revdep -v ``` -You can combine with `apkg` to rebuild broken packages: +You can combine with `apkg` to rebuild broken packages, example; ``` # apkg -f -u $(revdep) ``` + > NOTE: `revdep` does not solve dependencies, so you might need manually rebuild broken packages instead combine with `apkg`. updateconf @@ -351,7 +338,6 @@ updateconf apkg-chroot ----------- Script to entering chroot environment of custom root location. - ``` # apkg-chroot <customroot path> # apkg-chroot <customroot path> <command> @@ -363,8 +349,8 @@ Print out old package and source caches. Options: ``` - -s print sources only - -p print packages only +-s print sources only +-p print packages only ``` Usage: @@ -382,7 +368,7 @@ Usage: apkg-deps --------- -Script to find runtime linked dependencies of installed package. It is recommended to use this when writing a package template. +Script to find runtime linked dependencies of installed package. Its good to figure out dependenciess when writing package template. Usage: ``` @@ -416,9 +402,9 @@ $ apkg-orphan apkg-redundantdeps ------------------ -Script to print package's redundant dependencies. It is recommended to use this when writing package template for minimizing dependencies and speed up `apkg` dependencies solving. +Script to print package's redundant dependencies. Its good to use when writing package template for minimizing dependencies and speed up `apkg` dependencies solving. -Usage: +usage: ``` (print package contains redundant dependencies) $ apkg-redundantdeps |