LoginSignup
0
0

packagekitd を無効にして バックグラウンドでのダウンロードを停止する

Last updated at Posted at 2023-12-05

起動直後にdpkg を使おうとするとエラー。

$ sudo dpkg -r discord-0.0.35.deb 
dpkg: エラー: dpkg frontend lock was locked by another process with pid 1234
Note: removing the lock file is always wrong, and can end up damaging the
locked area and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ>.

プロセス 1234 は何かな?

$ ps -auxww | grep 1234
root        1234  1.6  0.7 501656 123620 ?       Ssl  17:02   1:20 /usr/libexec/packagekitd
nanbuwks   15314  0.0  0.0  10268  2432 pts/0    S+   18:23   0:00 grep --color=auto 1234

packagekitd とはバックグラウンドで更新などを行うデーモンらしい。

環境

  • Ubuntu 22.04 LTS

停止と削除

そういえば、起動直後に不必要なネットワークアクセスとかしているプロセスがあったなあ・・・これだったのかな?

停止してみました。

$ systemctl stop packagekit

なんかアクセスしていたのが止まったぞ。

image.png

モバイル環境でのこのような動きはデメリットが多いので、デーモンを disable にしました。

$ systemctl disable packagekit

unattended-upgr

(2023/12/10 追記)
上記処置をしたPCで、apt コマンドを使おうとしたら別のプロセスと干渉しました。

unattended-upgr という、こちらも更新などを行うデーモンがもうひとつあるらしいです。

こちらはしばらく待って使えるようになりましたが、また問題が起こったら packagekitd のように 停止や削除を検討します。

(2023/12/16 追記)

同様に、問題が発生したので

$ systemctl stop unattended-upgrades


して

$ sudo systemctl disable unattended-upgrades

で止めました。
最後の s が重要。

0
0
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
0
0