Score:0

Operation not permitted dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) - Multiple packages

cn flag

When i try to install a new package i get the The following packages have unmet dependencies: message, so when i try apt -f install , i get the following output:

Reading database ... 119095 files and directories currently installed.)
Preparing to unpack .../x11-xkb-utils_7.7+3ubuntu0.18.04.1_amd64.deb ...
Unpacking x11-xkb-utils (7.7+3ubuntu0.18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/x11-xkb-utils_7.7+3ubuntu0.18.04.1_amd64.deb (--unpack):
 unable to create '/usr/bin/setxkbmap.dpkg-new' (while processing './usr/bin/setxkbmap'): Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../x11-common_1%3a7.7+19ubuntu7.1_all.deb ...
dpkg-query: no packages found matching nux-tools
Unpacking x11-common (1:7.7+19ubuntu7.1) ...
dpkg: error processing archive /var/cache/apt/archives/x11-common_1%3a7.7+19ubuntu7.1_all.deb (--unpack):
 error creating symbolic link './usr/bin/X11': Operation not permitted
Preparing to unpack .../gtk-update-icon-cache_3.22.30-1ubuntu4_amd64.deb ...
No diversion 'diversion of /usr/sbin/update-icon-caches to /usr/sbin/update-icon-caches.gtk2 by libgtk-3-bin', none removed.
No diversion 'diversion of /usr/share/man/man8/update-icon-caches.8.gz to /usr/share/man/man8/update-icon-caches.gtk2.8.gz by libgtk-3-bin', none removed.
Unpacking gtk-update-icon-cache (3.22.30-1ubuntu4) ...
dpkg: error processing archive /var/cache/apt/archives/gtk-update-icon-cache_3.22.30-1ubuntu4_amd64.deb (--unpack):
 unable to create '/usr/bin/gtk-update-icon-cache.dpkg-new' (while processing './usr/bin/gtk-update-icon-cache'): Operation not permitted
Preparing to unpack .../xfonts-utils_1%3a7.7+6_amd64.deb ...
Unpacking xfonts-utils (1:7.7+6) ...
dpkg: error processing archive /var/cache/apt/archives/xfonts-utils_1%3a7.7+6_amd64.deb (--unpack):
 unable to create '/usr/bin/bdftopcf.dpkg-new' (while processing './usr/bin/bdftopcf'): Operation not permitted
No apport report written because MaxReports is reached already
                                                              dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/x11-xkb-utils_7.7+3ubuntu0.18.04.1_amd64.deb
 /var/cache/apt/archives/x11-common_1%3a7.7+19ubuntu7.1_all.deb
 /var/cache/apt/archives/gtk-update-icon-cache_3.22.30-1ubuntu4_amd64.deb
 /var/cache/apt/archives/xfonts-utils_1%3a7.7+6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

When I then try to force-overwrite, for instance, the first error package, i get:

(Reading database ... 119095 files and directories currently installed.)
Preparing to unpack .../x11-xkb-utils_7.7+3ubuntu0.18.04.1_amd64.deb ...
Unpacking x11-xkb-utils (7.7+3ubuntu0.18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/x11-xkb-utils_7.7+3ubuntu0.18.04.1_amd64.deb (--install):
 unable to create '/usr/bin/setxkbmap.dpkg-new' (while processing './usr/bin/setxkbmap'): Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/x11-xkb-utils_7.7+3ubuntu0.18.04.1_amd64.deb

No matter what I do, I seem to get the same error about not permitted operations! Does anyone have any idea what I can do?

hr flag
Are there any extended file attributes on your `/usr/bin/` directory (check with `lsattr -ld /usr/bin`)? Are you running any kind of antivirus software that may place restrictions on the directory?
Boris avatar
cn flag
@steeldriver lsattr-ld /usr/bin returns a lot of lines such as `/usr/bin/dpkg-deb Secure_Deletion, Immutable, Append_Only, Extents`, not sure what I should be looking for! As far as I know, there is not any antivirus installed, coincidentally, i was trying to install a package for that (ClamAV). The server in question is a Digital Ocean Droplet, so not sure which restrictions are in place...
hr flag
Hmm... `lsattr -ld /usr/bin` should only return a single line (that's what the `-d` flag is for - don't descend into the directory) however if the directory also has non-default attribute `Immutable` that is indeed likely what is causing the `Operation not permitted` error.
Boris avatar
cn flag
@steeldriver apologies, it does return one line now /usr/bin Secure_Deletion, Immutable, Append_Only, Indexed_directory, Extents
hr flag
OK so you will need to figure out what is setting the attributes (did you run some `chattr` commands recently?) and relax them so that `dpkg` can add the files it wants to.
Boris avatar
cn flag
@steeldriver If im being totally honest, I have no idea if those commands are ran. I was called to help because the server in question was used in a brute-force SSH attack. Following the tutorial of Digital Ocean, I was prompted to install the clamav and clamav daemon packages, which gave me the errors, so I assume the entire packages structure is a little messed up?
hr flag
So some previous administrator has apparently made `/usr/bin` immutable, either manually (using the `chattr` command) or by installing some kind of "security" software that has taken control of system directories - I don't want to second guess that, you will need to work with the system's owner / administrator to decide how to proceed - if there is reason to believe that the system has been compromised then you should probably not try to save it but re-install and restore data from backups. FWIW I don't see any evidence so far that *"the entire packages structure is a little messed up"*.
Boris avatar
cn flag
@steeldriver gotcha, thanks for the help!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.