The user GetReadyMan experienced issues with a failed web Discourse upgrade, while the web Docker upgrade was successful. The error message indicated that Docker version 19.03.13 is not supported, and an upgrade to at least 20.10.0 is required.
Canapin provided links to relevant topics on the Discourse forum, which may help resolve the issue. GetReadyMan attempted to update the operating system but encountered a lock file issue, where the process 10528 (apt-get) was holding the lock.
The solution, provided by GetReadyMan, involved force killing the stuck process, removing lock files, reconfiguring the package database, and retrying the update. The steps to fix the issue include checking for running apt processes, waiting for the process to finish or force killing it, removing lock files, reconfiguring the package database, and retrying the update. Additionally, disabling unattended upgrades may be necessary to prevent future conflicts.
The web version of the Docker update worked, The web version of the Discourse update failed.
I reset the failed update, but the web application said the update was in progress.
Went to try to update Discourse manually
cd /var/discourse
./launcher rebuild app
Got the following error.
ERROR: Docker version 19.03.13 not supported,please upgrade to at least 20.10.0, or recommend 24.0.7
and got the following error:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is being held by process 10528 (apt-get)
E: Unable to aquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
My discourse website is down with an Oops-Error 500
Any thoughts?
Here’s the fix from ChatGPT. The key was to force kill the stuck process in step 3.
The error indicates that another apt or package management process is already running and holding the lock file /var/lib/dpkg/lock-frontend. This situation prevents your apt command from proceeding. Here’s how to resolve the issue:
Steps to Fix the Issue
Check for Running apt Processes
Run the following command to check for other apt processes:
ps aux | grep apt
Look for processes like apt-get, apt, or dpkg. If there’s a process running (e.g., apt-get or dpkg), it might be updating or installing something in the background.
Wait for the Process to Finish
If another process is genuinely running, it’s best to wait for it to complete. Sometimes, unattended upgrades or package installations run in the background.
Force Kill the Stuck Process
If the process has been running for an abnormally long time, you can terminate it:
sudo kill -9 <PID>
Replace <PID> with the process ID (e.g., 10528 in your case).
Remove Lock Files
After killing the process, remove the lock files to ensure no stale locks exist:
Reconfigure the Package Database
Run this command to fix any potential issues with the package manager:
sudo dpkg --configure -a
Retry the Update
Now, retry your update command:
sudo apt update && sudo apt upgrade -y
Notes
If this issue occurs frequently, check if unattended upgrades or automated updates are running in the background. These can cause conflicts when manually managing packages.