preint 和 postrm 脚本未运行,显示访问被拒绝

preint 和 postrm 脚本未运行,显示访问被拒绝
root@XXXXXXXXXX:/home/user# apt install /var/cache/apt/archives/perl_5.36.0-7                                                                                     ubuntu0.23.04.2_amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'perl' instead of '/var/cache/apt/archives/perl_5.36.0-7ubuntu0.23.                                                                                     04.2_amd64.deb'
The following additional packages will be installed:
  perl-base
Suggested packages:
  perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl
  libtap-harness-archive-perl
The following packages will be upgraded:
  perl perl-base
2 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2,020 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 116068 files and directories currently installed.)
Preparing to unpack .../perl_5.36.0-7ubuntu0.23.04.2_amd64.deb ...
dpkg (subprocess): unable to execute new perl package pre-installation script (/var                                                                                     /lib/dpkg/tmp.ci/preinst): Permission denied
dpkg: error processing archive /var/cache/apt/archives/perl_5.36.0-7ubuntu0.23.04.2                                                                                     _amd64.deb (--unpack):
 new perl package pre-installation script subprocess returned error exit status 2
dpkg (subprocess): unable to execute new perl package post-removal script (/var/lib                                                                                     /dpkg/tmp.ci/postrm): Permission denied
dpkg: error while cleaning up:
 new perl package post-removal script subprocess returned error exit status 2
Preparing to unpack .../perl-base_5.36.0-7ubuntu0.23.04.2_amd64.deb ...
dpkg (subprocess): unable to execute new perl-base package pre-installation script                                                                                      (/var/lib/dpkg/tmp.ci/preinst): Permission denied
dpkg: error processing archive /var/cache/apt/archives/perl-base_5.36.0-7ubuntu0.23                                                                                     .04.2_amd64.deb (--unpack):
 new perl-base package pre-installation script subprocess returned error exit statu                                                                                     s 2
dpkg (subprocess): unable to execute new perl-base package post-removal script (/va                                                                                     r/lib/dpkg/tmp.ci/postrm): Permission denied
dpkg: error while cleaning up:
 new perl-base package post-removal script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/perl_5.36.0-7ubuntu0.23.04.2_amd64.deb
 /var/cache/apt/archives/perl-base_5.36.0-7ubuntu0.23.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

安装或升级 ubuntu 服务器时出现上述错误。

答案1

通过从 /etc/fstab 中删除“nosuid、noexec、nodev”挂载选项,问题得到解决。当我们在挂载中添加这些 noexec 选项时,提到的脚本被拒绝权限。删除这些选项并重新启动服务器后,我可以安装任何软件包或执行 apt 升级。感谢您的支持。

相关内容