In the last couple of days, I have gone through some unmet dependencies issues while upgrading. I tried installing those packages separately but couldn't find a solution.
I know one solution that is to remove the antivirus from the system. But I'm not permitted to remove it. I am looking for another solution without removing the anti-virus from the system.
It shows while unpacking the package:
Preparing to unpack .../linux-image-5.11.0-44-generic_5.11.0-44.48~20.04.2_amd64.deb ...
Unpacking linux-image-5.11.0-44-generic (5.11.0-44.48~20.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.11.0-44-generic_5.11.0-44.48~20.04.2_amd64.deb (--unpack):
unable to open '/boot/vmlinuz-5.11.0-44-generic.dpkg-new': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-5.11.0-44-generic_5.11.0-44.48~20.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried auto clean, force install, --fix-broken.. all the possible ways found in the forums. For sudo apt --fix-broken install:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
bnd java-wrappers libbindex-java libcommons-codec-java
libcommons-collections3-java libcommons-compress-java libcommons-lang-java
libdd-plist-java libfelix-framework-java libfelix-gogo-runtime-java
libfelix-osgi-obr-java libfelix-resolver-java libfindbugs-java
libgoogle-gson-java libgradle-core-java libgradle-plugins-java
libhttpclient-java libhttpcore-java libjarjar-java libjatl-java
libjavaewah-java libjcifs-java libjcip-annotations-java
libjformatstring-java libjgit-java libjna-java libjna-jni libjs-jquery
libjsoup-java libkryo-java libminlog-java libnative-platform-java
libnative-platform-jni libnekohtml-java libobjenesis-java
libosgi-annotation-java libosgi-compendium-java libosgi-core-java
libplexus-container-default-java libplexus-container-default1.5-java
libpolyglot-maven-java libreflectasm-java librhino-java libsimple-http-java
libwagon-http-java libxbean-reflect-java libxerces2-java
libxml-commons-external-java
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
linux-image-5.11.0-44-generic
Suggested packages:
fdutils linux-doc | linux-hwe-5.11-source-5.11.0 linux-hwe-5.11-tools
The following NEW packages will be installed:
linux-image-5.11.0-44-generic
0 upgraded, 1 newly installed, 0 to remove and 19 not upgraded.
4 not fully installed or removed.
Need to get 0 B/11.5 MB of archives.
After this operation, 11.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 261995 files and directories currently installed.)
Preparing to unpack .../linux-image-5.11.0-44-generic_5.11.0-44.48~20.04.2_amd64
.deb ...
Unpacking linux-image-5.11.0-44-generic (5.11.0-44.48~20.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.11.0-44-gen
eric_5.11.0-44.48~20.04.2_amd64.deb (--unpack):
unable to open '/boot/vmlinuz-5.11.0-44-generic.dpkg-new': Operation not permit
ted
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-5.11.0-44-generic_5.11.0-44.48~20.04.2_amd6
4.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
It's annoying and I cannot install any other packages. Any suggestions on how can I fix that?
Here is the solution that works for me:
Basically, Antivirus prevents the installation of the packages as my system has already one (McAfee agent).
First of all, I checked the status of the antivirus with the following commands if it is running or not:
# /opt/McAfee/ens/tp/init/mfetpd-control.sh status
# /opt/McAfee/ens/esp/init/mfeespd-control.sh status
If it is running then stop the services with these:
# /opt/McAfee/ens/tp/init/mfetpd-control.sh stop
# /opt/McAfee/ens/esp/init/mfeespd-control.sh stop
Then check the status again if it is stopped or not. If stopped then I started necessary updates and required installations by this:
sudo apt --fix-broken install
Finally, I started the antivirus again by these:
# /opt/McAfee/ens/esp/init/mfeespd-control.sh start
# /opt/McAfee/ens/tp/init/mfetpd-control.sh start
Reference: https://kc.mcafee.com/corporate/index?page=content&id=KB88223