⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

sys_pkg_remove

Function sys_pkg_remove 

Source
pub fn sys_pkg_remove(_name: &str) -> SyscallResult<()>
Expand description

Remove an installed package from the system.

Performs a transactional package removal. Configuration files installed by the package are preserved by default (saved with a .veridian-save suffix) so the user does not lose customizations. After removal, the package manager checks for orphaned dependencies (packages that were installed only as dependencies of the removed package and are no longer required) and offers to remove them.

The removal process follows these steps:

  1. Verify the package is installed and not required by other packages.
  2. Run pre-removal hooks if defined in the package manifest.
  3. Remove installed files from the VFS (preserving config files).
  4. Update the package database to mark the package as removed.
  5. Detect and optionally clean up orphaned dependencies.
  6. Run post-removal hooks if defined.

§Arguments

  • name - Name of the installed package to remove.

§Returns

  • Ok(()) on successful removal of the package.

§Errors

§Examples

use veridian_kernel::pkg::sdk::syscall_api::sys_pkg_remove;

// Remove a package (config files are preserved)
sys_pkg_remove("libfoo").expect("remove failed");