不同种类的linux系统使用不同类型的程序包,比如 rpm 包、 slp 包、lsb包、tgz包、solaris pkg包等。有些软件安装时可能遇到系统库中没有相应的包,也找不到源码编译,找到的包可能不是需要的格式,比如使用的是 mint 系统,在pkg.org上找到的却是 rpm 包,于是要么手拆包手工安装,要么将 rpm 转变为 deb 包后安装。

alien --- Linux不同格式程序包的转换程序-LMLPHP

用法:

sudo alien -d xxxxxx.rpm 生成 xxxxxx.deb

sudo alien -d xxxxxx.tar.gz 生成 xxxxxx.deb

sudo alien -r xxxxxx.tar.gz 生成 xxxxxx.rpm

功能比较多,下表是选择项。

Usage: alien [options] file [...]
  file [...]                Package file or files to convert.
  -d, --to-deb              Generate a Debian deb package (default).
     Enables these options:
       --patch=<patch>      Specify patch file to use instead of automatically
                            looking for patch in /var/lib/alien.
       --nopatch	    Do not use patches.
       --anypatch           Use even old version os patches.
       -s, --single         Like --generate, but do not create .orig
                            directory.
       --fixperms           Munge/fix permissions and owners.
       --test               Test generated packages with lintian.
  -r, --to-rpm              Generate a Red Hat rpm package.
      --to-slp              Generate a Stampede slp package.
  -l, --to-lsb              Generate a LSB package.
  -t, --to-tgz              Generate a Slackware tgz package.
     Enables these options:
       --description=<desc> Specify package description.
       --version=<version>  Specify package version.
  -p, --to-pkg              Generate a Solaris pkg package.
  -i, --install             Install generated package.
  -g, --generate            Generate build tree, but do not build package.
  -c, --scripts             Include scripts in package.
      --target=<arch>       Set architecture of the generated package.
  -v, --verbose             Display each command alien runs.
      --veryverbose         Be verbose, and also display output of run commands.
  -k, --keep-version        Do not change version of generated package.
      --bump=number         Increment package version by this number.
  -h, --help                Display this help message.
  -V, --version		    Display alien's version number.

安装(mint 21.2系统):

sudo apt install alien

02-25 02:04