[Linux] Create .deb package

Enhance your gameplay with these tools. This category is also the right place for tools useful for modders.
Mod databases, calculators, cheatsheets, multiplayer, scripts, libs and other useful stuff that is not strictly in-game mods.
Post Reply
Laurent
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri May 05, 2017 10:59 am
Contact:

[Linux] Create .deb package

Post by Laurent »

Hi all,

TLDR: integrate factorio nicely in your Ubuntu/Debian desktop as follows: download the attached zip. Download factorio_alpha_x64_[version].tar.xz. Put that [version] in the top of the file Makefile. Open a terminal, do "sudo make install", enjoy.

I use Ubuntu and I really like it when software nicely integrates in my desktop. Factorio does not do that by itself, but with a little help it can do that. Here is my approach, which is by the way based on the excellent AUR package.

The main idea is to create a .deb-package that can be installed in the usual way. Factorio is built such that it understands the standard linux file system, so that helps. Here is how you can do this:
  • Download factorio.zip and unzip it
  • Download factorio_alpha_x64_[version].tar.xz from factorio.com in the folder you just unzipped
  • Open that folder in a terminal. In Ubuntu: right click on empty space in the folder and choose "Open in Terminal"
  • Run "make", this will take a while. It will uncompress the factorio[blabla].xz and compress it again using some metadata to factorio_[version]-1.deb
  • Run "sudo make install" or "sudo apt install ./factorio_[version]-1.deb" or "sudo dpkg -i ./factorio_[version]-1.deb" to install factorio.
  • Open Factorio from the Ubuntu menu, just as you would do for any other app.
Biggest disadvantage of this approach is that the auto-updater does not work anymore... Does anybody know a way to download the update files manually and apply it using some sort of patch approach?

Bonus: You can convert your current factorio saves to the new factorio. To do this, copy paste the directories "config", "mods", "saves", and the files "achievements.dat", "blueprint-storage.dat", "crop-cache.dat", and "player-data.json" to "~/.factorio", where ~ stands for your home directory. Do *not* copy the file config-path.cfg. Be wise, make backups of your saves before doing this :)

If you have any questions, please let me know.
Attachments
factorio.zip
(1.57 KiB) Downloaded 232 times

User avatar
wizd3m
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Apr 05, 2017 6:33 am
Contact:

Re: [Linux] Create .deb package

Post by wizd3m »

According to the Makefile you now place the executable in /usr/bin and the data files under /usr/share/factorio. The following should work, although I cannot test it as I am not on an Debian based system now.

To enable updates you could place the files under /opt/factorio and then chmod -R 755 all the files under /opt/factorio.

Under /usr/bin you could create a bash file which changes the working directory to /opt/factorio and then executes factorio. Or just change the Exec line in .desktop to Exec=/opt/factorio/bin/factorio.
Image

vitex
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Aug 11, 2020 10:01 pm
Contact:

Re: [Linux] Create .deb package

Post by vitex »

Hi All,

my unofficial debian package:

https://github.com/Vitexus/factorio-demo-deb

Pull requests accepted ;)

Post Reply

Return to “Tools”