libalpm_trans(3)
π libalpm_trans β Transaction π
ok bestie so you've stumbled into the libalpm_trans corner of the Library Functions Manual for libalpm, and honestly? it's giving main character energy. this is literally where all the actual doing stuff happens.
β¨ NAME β¨
libalpm_trans β Transaction
- Functions to manipulate libalpm transactions
πΈ SYNOPSIS πΈ
π Enumerations
enum alpm_transflag_t {
ALPM_TRANS_FLAG_NODEPS = 1,
ALPM_TRANS_FLAG_NOSAVE = (1 << 2),
ALPM_TRANS_FLAG_NODEPVERSION = (1 << 3),
ALPM_TRANS_FLAG_CASCADE = (1 << 4),
ALPM_TRANS_FLAG_RECURSE = (1 << 5),
ALPM_TRANS_FLAG_DBONLY = (1 << 6),
ALPM_TRANS_FLAG_NOHOOKS = (1 << 7),
ALPM_TRANS_FLAG_ALLDEPS = (1 << 8),
ALPM_TRANS_FLAG_DOWNLOADONLY = (1 << 9),
ALPM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
ALPM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
ALPM_TRANS_FLAG_NEEDED = (1 << 13),
ALPM_TRANS_FLAG_ALLEXPLICIT = (1 << 14),
ALPM_TRANS_FLAG_UNNEEDED = (1 << 15),
ALPM_TRANS_FLAG_RECURSEALL = (1 << 16),
ALPM_TRANS_FLAG_NOLOCK = (1 << 17)
}
Transaction flags. yes queen, all sixteen of them π
π¦ Functions
int alpm_trans_get_flags (alpm_handle_t *handle)β hands you the bitfield of flags for the current transactionalpm_list_t * alpm_trans_get_add (alpm_handle_t *handle)β gives you back a list of packages added by the transactionalpm_list_t * alpm_trans_get_remove (alpm_handle_t *handle)β gives you back the list of packages removed by the transactionint alpm_trans_init (alpm_handle_t *handle, int flags)β initializes the transactionint alpm_trans_prepare (alpm_handle_t *handle, alpm_list_t **data)β prepares a transactionint alpm_trans_commit (alpm_handle_t *handle, alpm_list_t **data)β commits a transactionint alpm_trans_interrupt (alpm_handle_t *handle)β interrupts a transactionint alpm_trans_release (alpm_handle_t *handle)β releases a transaction
π Add/Remove packages
These functions remove/add packages to the transactions (that's literally the whole job description π )
int alpm_sync_sysupgrade (alpm_handle_t *handle, int enable_downgrade)β hunts down packages to upgrade and adds them to the transactionint alpm_add_pkg (alpm_handle_t *handle, alpm_pkg_t *pkg)β adds a package to the transactionint alpm_remove_pkg (alpm_handle_t *handle, alpm_pkg_t *pkg)β adds a package removal to the transaction
π Detailed Description π
Functions to manipulate libalpm transactions.
Transactions are the way to add/remove packages to/from the system. and bestie, listen β only one transaction can exist at a time. no cap. one. π
The basic workflow of a transaction is to:
- Initialize with
alpm_trans_init - Choose which packages to add with
alpm_add_pkgandalpm_remove_pkg - Prepare the transaction with
alpm_trans_prepare - Commit the transaction with
alpm_trans_commit - Release the transaction with
alpm_trans_release
A transaction can be released at any time. A transaction does not have to be committed. (so you can literally just... walk away. iconic.) π§
β Enumeration Type Documentation β
π enum alpm_transflag_t
Transaction flags.
Enumerator
ALPM_TRANS_FLAG_NODEPSβ Ignore dependency checks.ALPM_TRANS_FLAG_NOSAVEβ Delete files even if they are tagged as backup.ALPM_TRANS_FLAG_NODEPVERSIONβ Ignore version numbers when checking dependencies.ALPM_TRANS_FLAG_CASCADEβ Remove also any packages depending on a package being removed.ALPM_TRANS_FLAG_RECURSEβ Remove packages and their unneeded deps (not explicitly installed).ALPM_TRANS_FLAG_DBONLYβ Modify database but do not commit changes to the filesystem.ALPM_TRANS_FLAG_NOHOOKSβ Do not run hooks during a transaction.ALPM_TRANS_FLAG_ALLDEPSβ UseALPM_PKG_REASON_DEPENDwhen installing packages.ALPM_TRANS_FLAG_DOWNLOADONLYβ Only download packages and do not actually install.ALPM_TRANS_FLAG_NOSCRIPTLETβ Do not execute install scriptlets after installing.ALPM_TRANS_FLAG_NOCONFLICTSβ Ignore dependency conflicts.ALPM_TRANS_FLAG_NEEDEDβ Do not install a package if it is already installed and up to date.ALPM_TRANS_FLAG_ALLEXPLICITβ UseALPM_PKG_REASON_EXPLICITwhen installing packages.ALPM_TRANS_FLAG_UNNEEDEDβ Do not remove a package if it is needed by another one.ALPM_TRANS_FLAG_RECURSEALLβ Remove also explicitly installed unneeded deps (use withALPM_TRANS_FLAG_RECURSE).ALPM_TRANS_FLAG_NOLOCKβ Do not lock the database during the operation.
π₯ Function Documentation π₯
π int alpm_add_pkg (alpm_handle_t * handle, alpm_pkg_t * pkg)
Add a package to the transaction. If the package was loaded by alpm_pkg_load(), it will be freed upon alpm_trans_release invocation. (so don't go freeing it yourself, bestie, that's a double-free waiting to happen π)
Parameters
- handle the context handle
- pkg the package to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π int alpm_remove_pkg (alpm_handle_t * handle, alpm_pkg_t * pkg)
Add a package removal to the transaction.
Parameters
- handle the context handle
- pkg the package to uninstall
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π int alpm_sync_sysupgrade (alpm_handle_t * handle, int enable_downgrade)
Search for packages to upgrade and add them to the transaction.
Parameters
- handle the context handle
- enable_downgrade allow downgrading of packages if the remote version is lower
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π int alpm_trans_commit (alpm_handle_t * handle, alpm_list_t ** data)
Commit a transaction.
Parameters
- handle the context handle
- data the address of an
alpm_listwhere detailed description of an error can be dumped (i.e. list of conflicting files)
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π alpm_list_t * alpm_trans_get_add (alpm_handle_t * handle)
Returns a list of packages added by the transaction.
Parameters
- handle the context handle
Returns
a list of alpm_pkg_t structures
π int alpm_trans_get_flags (alpm_handle_t * handle)
Returns the bitfield of flags for the current transaction.
Parameters
- handle the context handle
Returns
the bitfield of transaction flags
π alpm_list_t * alpm_trans_get_remove (alpm_handle_t * handle)
Returns the list of packages removed by the transaction.
Parameters
- handle the context handle
Returns
a list of alpm_pkg_t structures
π int alpm_trans_init (alpm_handle_t * handle, int flags)
Initialize the transaction.
Parameters
- handle the context handle
- flags flags of the transaction (like nodeps, etc; see
alpm_transflag_t)
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π int alpm_trans_interrupt (alpm_handle_t * handle)
Interrupt a transaction.
Parameters
- handle the context handle
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π int alpm_trans_prepare (alpm_handle_t * handle, alpm_list_t ** data)
Prepare a transaction.
Parameters
- handle the context handle
- data the address of an
alpm_listwhere a list ofalpm_depmissing_tobjects is dumped (conflicting packages)
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π int alpm_trans_release (alpm_handle_t * handle)
Release a transaction.
Parameters
- handle the context handle
Returns
0 on success, -1 on error (pm_errno is set accordingly)
π Author π
Generated automatically by Doxygen for libalpm from the source code. (it literally wrote itself, we just did the makeup π)
and that's the whole page, bestie β every flag, every function, every "0 on success, -1 on error (pm_errno is set accordingly)" accounted for. nothing skipped, nothing invented. ate and left no crumbs. π β¨
ok love u, bye!! this was the libalpm_trans(3) page from the libalpm docs, auto-generated by Doxygen for libalpm straight from the source code. go commit something (a transaction, specifically). π«ΆπΈ
π¦ where this page comes from
- arch rolling: pacman 7.1.0.r9.g54d9411-2
- epel 10: libalpm-devel 7.0.0-5.el10_2 Β· GPL-2.0-or-later
- fedora 43: libalpm-devel 7.0.0-5.fc43 Β· GPL-2.0-or-later
- fedora 43: libalpm-devel 7.0.0-5.fc43 Β· GPL-2.0-or-later
- fedora 44: libalpm-devel 7.0.0-6.fc44 Β· GPL-2.0-or-later
- fedora 44: libalpm-devel 7.0.0-6.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms