0

This question is an exact duplicate of:

This is an expansion on my previous question here , but with a lot more context and details

I am constantly getting errors whilst attempting to run sudo apt upgrade, where every time it attempts to install a program, i get an error like this:

dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a6.2.3-0ubuntu0.19.04.1_all.deb (--unpack):
 unable to open '/usr/share/libreoffice/share/config/images_helpimg.zip.dpkg-new': Operation not permitted
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a6.2.3-0ubuntu0.19.04.1_all.deb

and i checked; no file called images_helpimg.zip.dpkg-new exists there, but a file called images_helpimg.zip does exist, and this kind of an error where it wants a existing file but appends .dpkg-new consistenly occurs now.

and then whenever i do anything else with sudo apt, it asks me to run sudo apt --fix-broken install to repair my packages, but the output for that is consistently

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libreoffice-common
The following NEW packages will be installed
  libreoffice-common
0 to upgrade, 1 to newly install, 0 to remove and 10 not to upgrade.
19 not fully installed or removed.
Need to get 0 B/33.2 MB of archives.
After this operation, 86.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 428397 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a6.2.3-0ubuntu0.19.04.1_all.deb ...
Unpacking libreoffice-common (1:6.2.3-0ubuntu0.19.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a6.2.3-0ubuntu0.19.04.1_all.deb (--unpack):
 unable to open '/usr/share/libreoffice/share/config/images_helpimg.zip.dpkg-new': Operation not permitted
rmdir: failed to remove '/var/lib/libreoffice/share/prereg/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/share/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/program/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a6.2.3-0ubuntu0.19.04.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

i have tried a litney of commands so far to fix these issues, including sudo apt autoremove, sudo dpkg --configure -a, sudo dpkg -C, sudo apt --fix-missing install, sudo apt install --reinstall libreoffice-common, sudo apt -f install, sudo apt clean, sudo apt autoclean

the only way to temporarily fix this issue is with sudo dpkg --purge --force-all [problematic package and all its dependancies] && sudo apt autoremove and then don't reinstall the package, as it will be just as broken again, but through this i have so far lost libreoffice, vscode and winehq-staging.

for context, i used to use 18.10 but have recently upgraded to 19.04

marked as duplicate by user535733, karel, Kulfy, Fabby, Eric Carvalho May 18 at 21:26

This question was marked as an exact duplicate of an existing question.