![使用 apt install 安装 deb 包](https://linux22.com/image/225170/%E4%BD%BF%E7%94%A8%20apt%20install%20%E5%AE%89%E8%A3%85%20deb%20%E5%8C%85.png)
如果没有安装之前版本的deb包,那么安装viaapt install
是正确的。但如果系统上安装了以前版本的deb包,就会出现错误
chmod: cannot access '/opt/mplc4_installer/install.sh': No such file or directory
dpkg: error processing package mplc4-oni-plc-w (--configure):
installed mplc4-oni-plc-w package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mplc4-oni-plc-w
我的postinst脚本:
#!/usr/bin/env bash
set -Eeu
chmod u+x opt/mplc4_installer/install.sh
cd opt/mplc4_installer/
./install.sh > /dev/null 2>&1
exit $?