LoginSignup
5
6

More than 3 years have passed since last update.

「E: ロック /var/lib/dpkg/lock-frontend が取得できませんでした - open (11: リソースが一時的に利用できません)」というエラーの対処法

Last updated at Posted at 2020-08-04

aptコマンドが以下のようなエラーで停止することがある。

a@ubuntu:~$ sudo apt upgrade
E: ロック /var/lib/dpkg/lock-frontend が取得できませんでした - open (11: リソースが一時的に利用できません)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

他のプロセスが使っていると思われる(another process is using it)。特にパッケージマネージャがバックグラウンドで実行されているものと思う。上記のlock-frontendというファイルを開いているプロセスをlsofコマンドで探す。

a@ubuntu:~$ sudo lsof /var/lib/dpkg/lock-frontend
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
unattende 3056 root    5uW  REG    8,1        0 804581 /var/lib/dpkg/lock-frontend

psコマンドでプロセスを探す。

a@ubuntu:~$ ps aux | grep apt
root       3023  0.0  0.0   4624   780 ?        Ss   21:54   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
root       3027  0.0  0.0   4624  1728 ?        S    21:54   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
root       5732 72.0  2.5 175480 102204 ?       RN   21:55   0:00 /usr/bin/python3 /usr/lib/update-notifier/apt-check --human-readable
a          5740  0.0  0.0  15448  1052 pts/0    S+   21:55   0:00 grep --color=auto -i apt

今回の場合は、3分ほど待ったらこのプロセスが停止して apt コマンドが使えるようになった。
それでも上手くいかない場合は再起動を試し、さらに以下のlinuxuprising.comにある方法をとると良いと思う。

参考ページ

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6