本文介绍将OpenSSH 源码打包成 .deb 包以便在其他设备上直接安装
下载源码
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz
tar -xzf openssh-9.8p1.tar.gz
cd openssh-9.8p1
安装编译环境
sudo apt update
sudo apt install checkinstall //checkinstall 工具可以将编译后的软件自动打包为 .deb 包
sudo apt install gcc g++ clang make-guile build-essential
编译打包
./configure
make
sudo checkinstall
中间会提示:
neardi@LPA3588:~/openssh-9.8p1$ sudo checkinstall
checkinstall 1.6.3, Copyright 2010 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.
The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: y
Preparing package documentation...OK
Please write a description for the package.
End your description with an empty line or EOF.
可以输入以下内容:
OpenSSH 9.8p1 custom build for Neardi LPA3588. This package includes the latest OpenSSH server and client, compiled from source.
然后按两次 Enter
键,checkinstall
将继续生成.deb
包。若没有特别的描述需求,也可以直接按两次 Enter
键跳过描述。
分发和安装 .deb 包
将生成的 .deb 文件分发到其他设备上,通过 dpkg 命令安装:
sudo dpkg -i openssh-9.8p1.deb