Cannot install or update since failed system update

Additional information. Reading on the forum another similar post concerning discover app not working.

Tried to install Discover with the following results. Looks like it has to do with the broken system update.

dad@virgil-optiplex9010:~$ sudo apt install plasma-discoverReading package lists... Done
Building dependency tree... Done
Reading state information... Done
plasma-discover is already the newest version (5.27.11-0ubuntu2).
plasma-discover set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cpp-x86-64-linux-gnu : Breaks: cpp (< 4:13.2.0-3) but 4:13.2.0-1ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
dad@virgil-optiplex9010:~$ apt --fix-broken install
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?
dad@virgil-optiplex9010:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  aptdaemon bluedevil gamin gsfonts gsfonts-x11 irqbalance
  kde-cli-tools kde-cli-tools-data libappstream4 libappstreamqt2
  libb2-1 libboost-filesystem1.74.0 libboost-iostreams1.74.0
  libboost-locale1.74.0 libboost-thread1.74.0 libcbor0.8 libdav1d6
  libgamin0 libgcab-1.0-0 libgfapi0 libgfrpc0 libgfxdr0
  libglusterfs0 libicu72 libkf5su-bin libkf5su-data libkf5su5
  libllvm15t64 libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra
  libmagickwand-6.q16-6 libnetplan0 libnfs13 libnsl-dev libperl5.36
  libplacebo292 libplist3 libpoppler-qt6-3t64 libpoppler130
  libpython3.11 libpython3.11-minimal libpython3.11-stdlib
  libqt6concurrent6t64 libqt6core6t64 libqt6dbus6t64 libqt6gui6t64
  libqt6network6t64 libqt6opengl6t64 libqt6printsupport6t64
  libqt6qml6 libqt6qmlmodels6 libqt6quick6 libqt6sql6-sqlite
  libqt6sql6t64 libqt6svg6 libqt6waylandclient6
  libqt6waylandcompositor6 libqt6waylandeglclienthwintegration6
  libqt6waylandeglcompositorhwintegration6 libqt6widgets6t64
  libqt6wlshellintegration6 libsmbios-c2 libsynctex2 libtirpc-dev
  libts0t64 libunistring2 libutf8proc2 libvpx7 libzxing2
  linux-headers-6.5.0-28 linux-headers-6.5.0-28-generic
  linux-image-6.5.0-28-generic linux-modules-6.5.0-28-generic
  linux-modules-extra-6.5.0-28-generic muon p7zip pass-extension-otp
  perl-modules-5.36 pkg-config python3-aptdaemon python3-debconf
  python3-defer python3-lib2to3 python3-requests-toolbelt python3.11
  python3.11-minimal qml-module-org-kde-kio qpdfview
  qpdfview-djvu-plugin qpdfview-pdf-poppler-plugin
  qpdfview-ps-plugin qpdfview-translations qt6-gtk-platformtheme
  qt6-qpa-plugins qt6-translations-l10n qt6-wayland tzdata-icu
  ubuntu-advantage-tools update-notifier-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  cpp
Suggested packages:
  cpp-doc
The following packages will be upgraded:
  cpp
1 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
580 not fully installed or removed.
Need to get 0 B/22.4 kB of archives.
After this operation, 16.4 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 359644 files and directories currently installed.)
Preparing to unpack .../cpp_4%3a13.2.0-7ubuntu1_amd64.deb ...
dpkg-maintscript-helper: error: file '/usr/share/doc/cpp/README.Bugs' not owned by package 'cpp'
dpkg-maintscript-helper: error: directory '/usr/share/doc/cpp' contains files not owned by package cpp, cannot switch to symlink
dpkg: error processing archive /var/cache/apt/archives/cpp_4%3a13.2.0-7ubuntu1_amd64.deb (--unpack):
 new cpp package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/cpp_4%3a13.2.0-7ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)