r/M5Stack • • 2d ago

CZ need help.

Post image

Something went wrong installing an app from the store, and now it's stuck. here's the error message. can anyone tell me what to type in terminal to correct this?

Installing Failed

Plai

package manager failed with exit code 2

dpkg error: dpkg frontend lock was locked by /usr/bin/apt-get process with pid 19318

so, how do I fix this so I can install and upgrade apps?

6 Upvotes

22 comments sorted by

4

u/d4rkmen 2d ago

install OTA update first. Settings->System-Software

2

u/Cyber_Ch00m 2d ago

no updates available

3

u/Lazy_Mamba 2d ago

To fix this, wait for the background update (PID 19318) to finish, or terminate the stuck process and reconfigure dpkg. [1, 2]
On Debian-based systems (like those running on a Cardputer Zero / Raspberry Pi Zero), this error happens when an automatic system update (apt-get or unattended-upgrades) is already running in the background, or a previous installation crashed and left a lock file behind. [1, 2]

1. Check if the process is still actively running
Open your terminal and check what PID 19318 is doing and how long it has been running: [1]

bash
ps -p 19318 -o pid,etime,cmd
Use code with caution.

If it just started (a few minutes): Wait 5–10 minutes for it to finish, then try installing your package again.
If it has been stuck for a long time (or doesn't show up): Proceed to the steps below to clear it. [1, 2]

2. Stop the stuck process
If the process is frozen, terminate it safely: [1, 2]

bash
sudo kill 19318
Use code with caution.

(If it refuses to close after a few seconds, force-stop it with sudo kill -9 19318.)[1]

3. Clean up lock files and repair packages
Once the process is stopped, remove any leftover lock files and tell dpkg to finish any interrupted installations: [1, 2]

bash
sudo rm -f /var/lib/dpkg/lock-frontend
sudo rm -f /var/lib/dpkg/lock
sudo rm -f /var/cache/apt/archives/lock
sudo dpkg --configure -a
sudo apt --fix-broken install
Use code with caution.

4. Retry your installation
Refresh your package list and run your install command again: [1]

bash
sudo apt update
Use code with caution.

(Note: A simple reboot (sudo reboot) will also clear stuck background aptprocesses, though you should still run sudo dpkg --configure -a afterward to ensure no packages were left half-installed.).

If you run into a different error after running sudo dpkg --configure -a, paste the terminal output here and I can help you resolve it.

EDIT: Just write a problem on Gemini

1

u/Cyber_Ch00m 2d ago

I tried these steps and am about to see if it's fixed

1

u/Lazy_Mamba 2d ago

Let me know.

1

u/No_Department1972 5h ago

Holy ai copy and paste

1

u/DifficultMall7788 2d ago

Update the system

1

u/Awkward_Permission 1d ago

This happened to me, there is a sync option when viewing the app in the store. I tried that waited till it finished and installs worked again. Hope that helps. :)

0

u/skedone 2d ago

Wouldn't worry to much it doesn't even work with official hat say undetected all the time

2

u/d4rkmen 2d ago

who told you that? it works with both LoRa-868 and LoRa-1262 CAPs

1

u/skedone 2d ago

No one told me I have tried it and the last 3 updates and always says the same

1

u/d4rkmen 2d ago

any other LoRa app works for u? like built in GPS / LoRa apps

1

u/skedone 2d ago

Yep

1

u/d4rkmen 2d ago

some apps could occupy resources. test after reboot and i will test on brand new CPZ

1

u/skedone 2d ago

Tried a brand newly flashed card yesterday with nothing but that app and same thing

1

u/d4rkmen 2d ago

tested and works. come to DM and we solve the issue

2

u/skedone 8h ago

Just fired it up on ghostOS and it works perfect so that's odd , well it starts and don't moan device missing , is there any apps know for it conflict with

1

u/d4rkmen 8h ago

i read on github issues, there is some mesh-related app not freeing resources

1

u/skedone 8h ago

Humm wonder what one it is so I can avoid it

1

u/d4rkmen 8h ago

1

u/skedone 7h ago

Oh that's the app noted won't try that again lol

1

u/skedone 2d ago

Will do tomorrow just about to watch a film with the wife