YaST2 Package Manager

Package-Manager Builtins

SUSE Linux AG

YaST2 Team

SUSE Linux AG

Table of Contents

1. Package Manager
1.1. Using the package manager
1.1.1. Introduction
1.1.2. Implementation
1.1.3. Querying the package manager
1.1.3.1. Checking an installed package
1.1.3.2. Checking the installation sources
1.1.3.3. Deleting a package
1.1.3.4. Installing a package
1.1.3.5. Solving dependencies
1.1.3.6. Committing the changes
1.1.4. Example code
I. Functions for registering YCP callbacks from Yast
Pkg::CallbackAcceptFileWithoutChecksum — Register callback function
Pkg::CallbackAcceptUnknownDigest — Register callback function
Pkg::CallbackAcceptUnknownGpgKey — Register callback function
Pkg::CallbackAcceptUnsignedFile — Register callback function
Pkg::CallbackAcceptVerificationFailed — Register callback function
Pkg::CallbackAcceptWrongDigest — Register callback function
Pkg::CallbackAuthentication — Register callback function
Pkg::CallbackDoneRefresh — Register a callback function
Pkg::CallbackDoneScanDb — Register callback function
Pkg::CallbackErrorScanDb — Register callback function
Pkg::CallbackFinishDeltaApply — Register callback function
Pkg::CallbackFinishDeltaDownload — Register callback function
Pkg::CallbackFinishPatchDownload — Register callback function
Pkg::CallbackImportGpgKey — Register callback function
Pkg::CallbackMediaChange — Register callback function
Pkg::CallbackMessage — Register callback function
Pkg::CallbackProblemDeltaApply — Register callback function
Pkg::CallbackProblemDeltaDownload — Register callback function
Pkg::CallbackProblemPatchDownload — Register callback function
Pkg::CallbackProgressDeltaApply — Register callback function
Pkg::CallbackProgressDeltaDownload — Register callback function
Pkg::CallbackProgressDownload — Register callback function
Pkg::CallbackProgressPatchDownload — Register callback function
Pkg::CallbackProgressReportEnd — Register a callback function
Pkg::CallbackProgressReportProgress — Register a callback function
Pkg::CallbackProgressReportStart — Register a callback function
Pkg::CallbackProgressScanDb — Register callback function
Pkg::CallbackScriptFinish — Register callback function
Pkg::CallbackScriptProblem — Register callback function
Pkg::CallbackScriptProgress — Register callback function
Pkg::CallbackScriptStart — Register callback function
Pkg::CallbackSourceCreateEnd — Register callback function
Pkg::CallbackSourceCreateError — Register callback function
Pkg::CallbackSourceCreateStart — Register callback function
Pkg::CallbackSourceProbeEnd — Register callback function
Pkg::CallbackSourceProbeError — Register callback function
Pkg::CallbackSourceProbeFailed — Register callback function
Pkg::CallbackSourceProbeProgress — Register callback function
Pkg::CallbackSourceProbeStart — Register callback function
Pkg::CallbackSourceProbeSucceeded — Register callback function
Pkg::CallbackSourceProgressData — Register callback function
Pkg::CallbackSourceReportEnd — Register callback function
Pkg::CallbackSourceReportError — Register callback function
Pkg::CallbackSourceReportProgress — Register callback function
Pkg::CallbackSourceReportStart — Register callback function
Pkg::CallbackStartDeltaApply — Register callback function
Pkg::CallbackStartDeltaDownload — Register callback function
Pkg::CallbackStartPatchDownload — Register callback function
Pkg::CallbackStartRefresh — Register a callback function
Pkg::CallbackStartScanDb — Register callback function
Pkg::CallbackTrustedKeyAdded — Register callback function
Pkg::CallbackTrustedKeyRemoved — Register callback function
II. Access to the Package Manager
Pkg::CheckGPGKeyFile — Check whether the file contains a valid GPG key
Pkg::DeleteGPGKey — Remove the GPG key from the package manager keyring
Pkg::GPGKeys — Read the GPG keys in the package manager keyring
Pkg::ImportGPGKey — Import a GPG key into the keyring
III. PkgFunctions constructor, destructor and call handling
Pkg::GetAdditionalLocales — return list of additional locales
Pkg::GetPackageLocale — get the locale set by Pkg::SetPackageLocale() call
Pkg::GetTextLocale — get the currently preferred locale
Pkg::SetAdditionalLocales — set list of additional locales
Pkg::SetPackageLocale — Select locale for installation
Pkg::SetTextLocale — Set Package Manager Locale
IV. Functions for accessing locks in the package manager
Pkg::AddLock — Add a lock to the package manager
Pkg::GetLocks — Get list of current locks
Pkg::RemoveLock — Remove a lock
V. Access to packagemanager
Pkg::AddUpgradeRepo — Add upgrade repository for distribution upgrade
Pkg::ClearSaveState — Clear the saved state - do not use, does nothing (the saved state cannot be removed, it is part of each resolvable object)
Pkg::Commit — Commit package changes (actually install/delete packages)
Pkg::CreateBackups — whether to create package backups during install or removal
Pkg::DoProvide — Install a list of packages to the system
Pkg::DoRemove — Removes a list of packges from the system
Pkg::FilterPackages — Get list of packages depending on how they were selected
Pkg::GetBackupPath — get current path for update backup of rpm config files
Pkg::GetPackages — Get list of packages (installed, selected, available, to be removed)
Pkg::GetSolverFlags — Get the current solver flags (options)
Pkg::GetUpgradeRepos — Get list of current upgrade repositories
Pkg::IsAvailable — Check if package (tag) is available
Pkg::IsManualSelection — Check Status of Selections and if they have changed
Pkg::IsProvided — returns 'true' if the tag is provided by a package in the installed system
Pkg::IsSelected — returns a 'true' if the tag is selected for installation
Pkg::PkgApplReset — Reset most internal stuff on the package manager.Reset only packages set by the application, not by the user
Pkg::PkgAvailable — Check if package is available
Pkg::PkgCommit — Commit package changes (actually install/delete packages), see also Pkg::Commit()
Pkg::PkgDelete — Select package for deletion (deletes all installed instances of the package)
Pkg::PkgGetFilelist — Get File List of a package
Pkg::PkgGetLicenseToConfirm — Return Licence Text
Pkg::PkgGetLicensesToConfirm — Return Licence Text of several packages
Pkg::PkgGroup — Get rpm group of a package
Pkg::PkgInstall — Select package for installation
Pkg::PkgInstalled — returns 'true' if the package is installed in the system
Pkg::PkgLocation — Get file location of a package in the source
Pkg::PkgMarkLicenseConfirmed — Mark licence of the package confirmed
Pkg::PkgMediaCount — Return number of packages to be installed
Pkg::PkgMediaNames — Return names of sources
Pkg::PkgMediaPackageSizes — Return size of packages to be installed
Pkg::PkgMediaSizes — Return size of packages to be installed
Pkg::PkgNeutral — Set package to neutral (drop install/delete flags) (sets all instances of the package - all versions, from all repositories)
Pkg::PkgPath — Path to a package path in the source
Pkg::PkgProperties — Return information about a package
Pkg::PkgQueryProvides — List all package instances providing 'tag'
Pkg::PkgReset — Reset most internal stuff on the package manager.
Pkg::PkgSize — Get (installed) size of a package
Pkg::PkgSolve — Solve current package dependencies
Pkg::PkgSolveCheckTargetOnly — Solve packages currently installed on target system.
Pkg::PkgSolveErrors — Returns number of fails
Pkg::PkgSrcInstall — Select source of package for installation
Pkg::PkgSummary — Get summary (aka label) of a package
Pkg::PkgTaboo — Set package to taboo (sets all instances of the package - all versions, from all repositories)
Pkg::PkgUpdateAll — Update installed packages
Pkg::PkgVersion — Get version (better: edition) of a package
Pkg::RemoveUpgradeRepo — Remove a repository from upgrade list
Pkg::RestoreState — Restore Saved state - restore the state saved by Pkg::SaveState()
Pkg::RpmChecksig — Check signature of RPM
Pkg::SaveState — Save the current selection state, can be restored later using Pkg::RestoreState()
Pkg::SetBackupPath — set current path for update backup of rpm config files
Pkg::SetSolverFlags — Set solver flags (options)
VI. Install or remove resolvables
Pkg::ResolvableInstall — Install all resolvables with selected name and kind
Pkg::ResolvableInstallArchVersion — Install all resolvables with selected name, architecture and kind. Use it only in a special case, ResolvableInstall() should be prefrerred.
Pkg::ResolvableInstallRepo — Install all resolvables with selected name, from the specified repository
Pkg::ResolvableNeutral — Remove all transactions from all resolvables with selected name and kind
Pkg::ResolvableRemove — Removes all resolvables with selected name and kind
Pkg::ResolvableSetSoftLock — Soft lock - it prevents the solver from re-selecting itemif it's recommended (if it's required it will be selected).
Pkg::ResolvableUpgrade — Install all resolvables with selected name and kind
VII. Patch related functions
Pkg::ResolvableCountPatches — Count patches which will be selected by ResolvablePreselectPatches() function
Pkg::ResolvablePreselectPatches — Preselect patches for auto online update during the installation
VIII. Resolvable properties
Pkg::IsAnyResolvable — Is there any resolvable in the requried state?
Pkg::ResolvableDependencies
Pkg::ResolvableProperties — Return properties of resolvable
IX. Functions related to repository registration
Pkg::RepositoryAdd — Register a new repository
Pkg::RepositoryProbe — Probe type of the repository
Pkg::RepositoryScan — Scan available products in the repository
Pkg::SourceCreate — Create a Source
Pkg::SourceCreateType — Create source of required type
Pkg::SourceScan — Scan a Source Media
X. Functions for downloading files from a repository
Pkg::SourceForceRefreshNow — Unconditionally refresh a Source
Pkg::SourceProvideDigestedFile — Make a digested file available at the local filesystem
Pkg::SourceProvideDirectory — make a directory available at the local filesystem
Pkg::SourceProvideFile — Make a file available at the local filesystem
Pkg::SourceProvideOptionalFile — Make an optional file available at the local filesystem
Pkg::SourceProvideSignedDirectory — make a directory available at the local filesystem
Pkg::SourceProvideSignedFile — Make a signed file available at the local filesystem
Pkg::SourceRefreshNow — Attempt to immediately refresh a Source
XI. Functions for reading repository properties
Pkg::SourceEditGet — Get state of Sources
Pkg::SourceGeneralData — Get general data about the source
Pkg::SourceGetCurrent — Return the list of all InstSrc Ids.
Pkg::SourceMediaData — Return media data about the source
Pkg::SourceProductData — Return Product data about the source
Pkg::SourceURL — Get full source URL, including password
XII. Functions used during system installation
Pkg::SourceCacheCopyTo — Copy cache data of all installation sources to the target
Pkg::SourceMoveDownloadArea — Move download area of CURL-based sources to specified directory
XIII. Functions for initializing the package manager
Pkg::SourceLoad — Load resolvables from the installation sources
Pkg::SourceRestore — Restore the sources from the persistent store
Pkg::SourceStartCache — Make sure the InstSrcManager is up, and return the list of SrcIds.
Pkg::SourceStartManager — Start the source manager - restore the sources and load the resolvables
XIV. Functions for saving repository configuration
Pkg::SourceFinishAll — Release all instalation sources
Pkg::SourceReleaseAll — Release all medias hold by all sourcesWarning: It also deletes the downloaded files!
Pkg::SourceSaveAll — Save all InstSrces.
XV. Functions for changing properties of a repository
Pkg::SourceChangeUrl — Change Source URL
Pkg::SourceDelete — Delete a Source
Pkg::SourceEditSet — Configure properties of installation sources
Pkg::SourceSetAutorefresh — Set whether this source should automaticaly refresh it'smeta data when it gets enabled. (default true, if not CD/DVD)
Pkg::SourceSetEnabled — Set the default activation state of an InsrSrc.
XVI. Functions for accessing services in the package management
Pkg::ServiceAdd — Add a new service
Pkg::ServiceAliases — Returns aliases of all known services.
Pkg::ServiceDelete — Remove a service
Pkg::ServiceGet — Get detailed properties of a service
Pkg::ServiceProbe — Probe service type at a URL
Pkg::ServiceRefresh — Refresh the service, the service must already be saved on the system!
Pkg::ServiceSave — Save a service to .service file All services are saved/updated/removed in Pkg::SourceSaveAll()
Pkg::ServiceSet — Set properties of a service
Pkg::ServiceURL — Get full service URL (including password!)
XVII. Disk usage statistics
Pkg::TargetAvailable — Return free space for non-root user (use Pkg::TargetCapacity(dir) - Pkg::TargetUsed(dir) to get free space including the space reserved for root user).
Pkg::TargetBlockSize — Return block size of partition at directory
Pkg::TargetCapacity — return capacity of partition at directory
Pkg::TargetGetDU — return current DU calculations
Pkg::TargetInitDU — Initialize Disk Usage Calculation
Pkg::TargetUsed — Return usage of partition at directory
XVIII. Functions for initializing the package manager (target system)
Pkg::TargetFinish — finish target usage
Pkg::TargetInit — Initialize Target and load resolvables
Pkg::TargetInitialize — Initialize Target, read the keys.
Pkg::TargetLoad — Load target resolvables into the pool
Pkg::TargetRebuildInit — Similar to TargetInit, but the RPM DB is rebuilt ('rpm --rebuilddb') before reading it
XIX. Access to Installation Target
Pkg::TargetDisableSources — Disable all sources configured on the target. Typicallyused on upgrade.
Pkg::TargetFileHasOwner — returns true if the file is owned by a package
Pkg::TargetInstall — install rpm package by filename
Pkg::TargetRebuildDB — call "rpm --rebuilddb"
Pkg::TargetRemove — Install package by name
Pkg::TargetStoreRemove — remove all resolvables from the DB in the target system (removes only metadata in the package manager!)