apt_lock

Function apt_lock 

Source
pub fn apt_lock() -> Result<(), AptErrors>
Expand description

Lock the APT lockfile. This should be done before modifying any APT files such as with crate::cache::Cache::update and then apt_unlock should be called after.

This Function Requires root

If apt_lock is called n times, apt_unlock must also be called n times to release all acquired locks.

ยงKnown Error Messages:

  • E:Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
  • E:Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?