Skip to content

Instantly share code, notes, and snippets.

@dkgndianko
Created October 5, 2020 16:37
Show Gist options
  • Save dkgndianko/7a30a937ec9347f77e128264f2ee031f to your computer and use it in GitHub Desktop.
Save dkgndianko/7a30a937ec9347f77e128264f2ee031f to your computer and use it in GitHub Desktop.
Build .rpm package from .deb

I recently moved from Debian-basd distributions to RHEEL world. I'm actually using Fedora. At some point, I wanted to install frantz. But I only have two possibilities: .deb and .AppImage and I choosed the .deb. After downloading the .deb file, I use alien to transform it to .rpm.

  1. Install alien (if not)
sudo dnf install alien
  1. transform .deb to .rpm
sudo alien --to-rpm --scripts franz_5.5.0_amd64.deb
  1. Try to nstall the RPM package
sudo dnf install franz-5.5.0-1763.x86_64.rpm

At this moment I have this errors

Error: Transaction test error:
  file / from install of franz-5.5.0-1763.x86_64 conflicts with file from package filesystem-3.14-2.fc32.x86_64
  1. Install rpmrebuild (if not already done)
sudo dnf install rpmrebuild
  1. Rebuild the package
rpmrebuild -pe franz-5.5.0-1763.x86_64.rpm

This will open the current editor (-e option) to modify it. I navigate under %files and identify the path quoted in previous error (for my case it is /). I remove the corresponding line. And after I got this:

result: /home/dkgndianko/rpmbuild/RPMS/x86_64/franz-5.5.0-1763.x86_64.rpm
  1. Install the newly built package.
sudo dnf install /home/dkgndianko/rpmbuild/RPMS/x86_64/franz-5.5.0-1763.x86_64.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment