I was using synaptic package manager to completely remove yt-dlp.
I tried most of the ideas on this page. Reboot did not help. Neither did removing lock-frontend.
Is there supposed to be this many copies of youtube-dl?
~$ Find_File.sh youtube-dl
Searching for youtube-dl
/home/andy/Downloads/youtube-dl
/home/andy/.local/bin/youtube-dl
/home/andy/.local/share/pipx/venvs/youtube-dl
/home/andy/.local/share/pipx/venvs/youtube-dl/bin/youtube-dl
What else can I do?
https://askubuntu.com/questions/219545/dpkg-error-dpkg-status-database-is-locked-by-another-process
dpkg: error: dpkg frontend lock was locked by another process with pid 8452
Note: removing the lock file is always wrong, can damage the locked area
and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ#db-lock>.
E: Sub-process dpkg --set-selections returned an error code (2)
E: Couldn't record the approved state changes as dpkg selection states
A package failed to install. Trying to recover:
dpkg: error: dpkg frontend lock was locked by another process with pid 8452
Note: removing the lock file is always wrong, can damage the locked area
and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ#db-lock>.