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:
- Verify the package is installed and not required by other packages.
- Run pre-removal hooks if defined in the package manifest.
- Remove installed files from the VFS (preserving config files).
- Update the package database to mark the package as removed.
- Detect and optionally clean up orphaned dependencies.
- Run post-removal hooks if defined.
§Arguments
name- Name of the installed package to remove.
§Returns
Ok(())on successful removal of the package.
§Errors
SyscallError::NotFound- The package is not currently installed.SyscallError::PermissionDenied- The caller lacks the package management capability.SyscallError::InvalidArgument- The package name is empty or contains invalid characters.SyscallError::NotSupported- The package is a critical system package that cannot be removed, or other installed packages depend on it and--forcewas not specified.SyscallError::IoError- A disk I/O error occurred during file removal.
§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");