我需要安装 ksh,因为我们有许多脚本 /bin/ksh 必须在 crontab 上运行。
VM(运行 Ubuntu 20.04.2 LTS)中没有互联网,因此我上传了这个包并将其复制到/tmp
。当我尝试安装它时出现此错误:
# apt install ksh_2020.0.0-5_arm64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ksh_2020.0.0-5_arm64.deb
我尝试了以下命令:
apt install ./ksh_2020.0.0-5_arm64.deb
但它不起作用,因为缺少一些包:
# apt install ./ksh_2020.0.0-5_arm64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
grafana : Depends: libfontconfig1 but it is not installed
ksh : Depends: binfmt-support but it is not installable
libfontconfig1-dev : Depends: libfontconfig-dev (= 2.13.1-4.2)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
由于虚拟机无法连接到互联网,我无法添加缺失的包。
还有其他方法来安装 ksh,或者执行 ksh 脚本吗?
答案1
您的系统在升级软件包方面落后(它应该报告为20.04.3如果已完全更新)
尝试提供一条路径,即。
apt install ./ksh_2020.0.0-5_arm64.deb
它是使其被识别为本地包的路径;您已告诉它下载并安装具有您提供的名称的包(即下载并安装ksh_2020.0.0-5_arm64.deb
),当然它不存在)