如何在 Ubuntu 上安装 .rpm?

How to install .rpm on Ubuntu?

我是 ubuntu 用户,但是我需要安装打印机驱动程序 这是一个 RPM (*.rpm) 文件(抱歉,它是 Linux 制造商网站上唯一可用的驱动程序)。

是否可以在 ubuntu 上安装 RPM 文件?

提前致谢。

来自 https://help.ubuntu.com/community/RPM/AlienHowto ,使用 alien 包:

Alien converts an RPM package file into a Debian package file or Alien can install an RPM file directly. This is not the recommended way to install software packages in Ubuntu. If at all possible, install packages from Ubuntu's repositories using Add/Remove, apt-get, or the Synaptic Package Manager. Package dependency conflicts may occur when attempting to install RPM packages.

这些命令应该可以做到:

sudo apt-get install alien
sudo alien -i package_file.rpm

alien's man page 开始:

WARNING

alien should not be used to replace important system packages, like init, libc, or other things that are essential for the functioning of your system. Many of these packages are set up differently by the different distributions, and packages from the different distributions cannot be used interchangeably. In general, if you can't remove a package without breaking your system, don't try to replace it with an alien version.

关于这个主题的另一个选项:

% mkdir tmp && cd tmp
% rpm2cpio packagefile-1.0.0.rpm | cpio -id

这会像 tar/gzip 一样将 RPM 解压到临时目录中。这应该足以让您访问所需的文件(ppm?)和脚本。