KylinOS v10 aarch64 在执行
sudo apt update --fix-missing
sudo apt upgrade -y
之后,可能会遇到类似下面的问题
在处理时有错误发生:
/tmp/apt-dpkg-install-uNQHYK/024-cmake-data_3.16.3-1kylin1k3_all.deb
/tmp/apt-dpkg-install-uNQHYK/029-code_1.66.1-1649256690_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
可以尝试如下步骤进行修复
1 执行
sudo apt --fix-broken install
可能会遇到类似下面的提示
emacs-remove: can't set umask, aborting. at /usr/lib/emacsen-common/emacs-package-remove line 12.
dpkg: 警告: 旧的 cmake-data 软件包 pre-removal 脚本 子进程返回错误状态 255
dpkg: 现在尝试使用新软件包所带的脚本...
emacs-remove: can't set umask, aborting. at /usr/lib/emacsen-common/emacs-package-remove line 12.
dpkg: 处理归档 /var/cache/apt/archives/cmake-data_3.16.3-1kylin1k3_all.deb (--unpack)时出错:
新的 cmake-data 软件包 pre-removal 脚本 子进程返回错误状态 255
在处理时有错误发生:
/var/cache/apt/archives/cmake-data_3.16.3-1kylin1k3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
W: 操作在完成之前被打断
打开提到的问题文件,并定位到指定的行,对于上面的提示就是
/usr/lib/emacsen-common/emacs-package-remove 的第 12 行
#!/usr/bin/perl -w
use Errno;
use strict;
my $lib_dir = "/usr/lib/emacsen-common";
my $invoked_by_old_pkg;
my $pkg;
require $lib_dir . "/lib.pl";
umask 0022 or die "emacs-remove: can't set umask, aborting.";
sub usage
{
my($file_handle) = @_;
if($invoked_by_old_pkg)
{
print $file_handle "Usage: emacs-package-remove FLAVOR\n";
}
else
{
print $file_handle "Usage: emacs-package-remove --prerm FLAVOR\n";
}
}
第 12 行的内容为
umask 0022 or die "emacs-remove: can't set umask, aborting.";
将该行注释掉,即改为
#umask 0022 or die "emacs-remove: can't set umask, aborting.";
保存。
重新运行
sudo apt --fix-broken install
耐心等待指令完成。
如果没有再报错,则问题解决。