ElementaryOS 0.4: Avoid “Could not get lock /var/lib/dpkg/lock” on boot

Table of Contents

1 Could not get lock /var/lib/dpkg/lock

This error will be caused because other process running dpkg operation like apt command.

$ sudo apt install -y <package><snip>E: Could not get lock /var/lib/dpkg/lock – open (11: Resourcetemporarily unavailable)

2 Avoid “Could not get lock /var/lib/dpkg/lock”

So stop apt-daily and apt-daily-upgrades will avoid “Could not get lock /var/lib/dpkg/lock”.

$ sudo systemctl mask apt-daily.service$ sudo systemctl mask apt-daily.timer$ sudo systemctl mask apt-daily-upgrade.service$ sudo systemctl mask apt-daily-upgrade.timer$ # NOTE: AppCenter needs packagekit.$ # If you need AppCenter, please unmask packagekit.$ sudo systemctl mask packagekit$ sudo sed -e ‘s;^;//;g’ -i /etc/apt/apt.conf.d/20packagekit

Android | Linux | SDL - Narrow Escape