dpkg フロントエンドロック (/var/lib/dpkg/lock-frontend) を取得できません。ルートですか?

dpkg フロントエンドロック (/var/lib/dpkg/lock-frontend) を取得できません。ルートですか?
(base) rusiru@rusiru-X556UV:~$ sudo apt-get upgrade
Reading packages lists... Done
Building dependency tree
Reading state information... Done
E: The package packettracer needs to be installed, but I can't find an archive for it.
(base) rusiru@rusiru-X556UV:~$ sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://lk.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://lk.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://lk.archive.ubuntu.com focal-backports InRelease
Reading package lists... Done
(base) rusiru@rusiru-X556UV:~$ sudo apt-get upgrade
Reading packages lists... Done
Building dependency tree
Reading state information... Done
E: The package packettracer needs to be installed, but I can't find an archive for it.
(base) rusiru@rusiru-X556UV:~$ sudo apt-get update && apt-get install --reinstall packettracer
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://lk.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://lk.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://lk.archive.ubuntu.com focal-backports InRelease
Reading package lists... Done
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?
(base) rusiru@rusiru-X556UV:~$ sudo dpkg -l packettracer
Desired-Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/half-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
pHR packettracer   7.3.0        amd64        (no description available)
(base) rusiru@rusiru-X556UV:~$ sudo apt-get upgrade
Reading packages lists... Done
Building dependency tree
Reading state information... Done
E: The package packettracer needs to be installed, but I can't find an archive for it.
(base) rusiru@rusiru-X556UV:~$ 

私はこれを試しましたが、成功しませんでした。この問題をどのように解決できますか?

ベストアンサー1

コマンドapt-get install --reinstallの前にsudoはありません。

次のコマンドsudo x && y ただx次のコマンドを実行します。sudoこのyコマンドは通常のユーザー権限で実行されます。

したがって、その構文を使用するにはそうする必要がありますsudo x && sudo y

おすすめ記事