How to play Minecraft in Fedora

Introduction

9 years ago was released an article on the same subject (How to play Minecraft in Fedora - Fedora Magazine)
To quote it : """
Few games are as notorious as the block-breaking sandbox game, Minecraft. Listed as the second best-selling video game of all-time with over 107.8 million copies sold to date, Minecraft is as popular with children as it is adults. It supports many platforms, including Windows, macOS, Android, iOS, and of course, Linux. Playing Minecraft on Linux and Fedora requires a few extra steps to get working. It is possible to set it up as a desktop app to integrate with your desktop environment of choice. Whether you’re setting it up for a friend, a child, or yourself, it’s easy to get started playing Minecraft in Fedora.
"""

According to the same wikipedia article, it is now first with 350 millions sales.

This article told to use the “other distributions” official download of the game. However, there is a quicker and easier way using the official Debian package.

Tutorial

You just have to run these commands on your machine, from the Downloads folder for example (don’t forget to replace things between the angle brackets) :

sudo dnf install alien rpmrebuild # make sure alien and rpmrebuild are installed
wget https://launcher.mojang.com/download/Minecraft.deb # get the official Debian package online. If the link has changed, find the file on their website : https://minecraft.net
sudo alien -r Minecraft.deb # use alien to convert the Debian package to a rpm package usable on fedora
rpmrebuild -ep minecraft-launcher-<version>.<architecture>.rpm # modify the rpm package. if you get an error like `/usr/bin/nano: No such file or directory`, run `export EDITOR=<your favourite text editor>` beforewise

Then delete every line starting with %dir from the file that opens

%dir %attr(0755, root, root) "/usr"
%dir %attr(0755, root, root) "/usr/bin"
%attr(0755, root, root) "/usr/bin/minecraft-launcher"
%dir %attr(0755, root, root) "/usr/share"
%dir %attr(0755, root, root) "/usr/share/applications"
%attr(0644, root, root) "/usr/share/applications/minecraft-launcher.desktop"
%dir %attr(0755, root, root) "/usr/share/icons"
%dir %attr(0755, root, root) "/usr/share/icons/hicolor"
%dir %attr(0755, root, root) "/usr/share/icons/hicolor/symbolic"
%dir %attr(0755, root, root) "/usr/share/icons/hicolor/symbolic/apps"
%attr(0644, root, root) "/usr/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg"

If these directories didn’t exist, create them yourself as root.

Then save and quit and type y<Enter> to confirm.

Go to the directory the programs tell you (should be ~/rpmbuild/RPMS/<architecture>/)

And finally, run

dnf install minecraft-launcher-<version>.<architecture>.rpm

Congratulations ! You now have Minecraft on your machine ! Run it with minecraft-launcher or from its icon in your app menu.

You may have to install Java OpenJDK if the dependencies resolution doesn’t work.

Free alternatives to Minecraft

This part also quotes How to play Minecraft in Fedora - Fedora Magazine.

Unfortunately, Minecraft is neither free or open source. To gain an account to use the game, you have to pay for an account. The game source code is not available publicly. If you are looking for a free and open source version of the game and don’t mind using alternate software, Minetest is an excellent option. The Minetest client (and its official server software) are already packaged in Fedora. If you’d like to give Minetest a spin, run the following command from a terminal window.

sudo dnf install minetest

You can find other versions of Minetest for Windows, macOS, countless Linux distributions, Android, and FreeBSD on their website.

I think it would be better if you redirected the installation to a path under /opt like the old FM article suggested. It shouldn’t be a problem to install it under /usr since you are converting the package to a rpm, but I’m not sure how much I would trust alien not to corrupt things.

Is there a flatpak version of this? It seems like this software would be well-suited to that sort of packaging.

Also, I’m surprised this got through to Fedora Magazine since it is non-FOSS.

1 Like

Hello !
I don’t know exactly how rpm packages work, do you mean I should just try to replace /usr to /opt in rpmrebuild and it will work ?

There is an unofficial Flatpak wrapper, but it is outdated, and being unverified, one may trust it less. I wanted to propose the alternative that I’m using myself.

Finally, do you mean I should post this outside of Fedora Magazine ?

I think there should be a parameter (or maybe an environment variable) of some sort that you can pass to the alien command to tell it to relocate the rpm contents. You shouldn’t have to edit the spec file. I’ve never used alien though, so I’m not sure.

I would be against publishing this on Fedora Magazine, but since it is already there in an older version, it might be better to give updated instructions rather than to leave people finding the outdated content. I think I’ll leave that decision to one of the other editors.


Edit: I just did a bit of searching about relocating a rpm.[1] It looks like it might not be as trivial as I had hoped. Still, if you could get it to work, I would be more inclined to accept this proposal.


  1. ↩︎

I don’t know what the odds of success are. I’ve never attempted anything like this, but if I’m reading the documentation correctly, you would need to add a Prefix: /usr line (don’t modify any other lines) and then use the rpm command instead of the dnf command to install the package. When you use the rpm command, you should be able to override the prefix at install time with rpm --install --prefix=/opt <rpm-file>.

Okay, thank you ! I’ll try on the live environment whenever i find the time.