How to package game for Linux on Linux

I would try building in windows if you can.

Seems like there’s enough that can go wrong as is with building UE4 for linux on windows that adding linux to the mix is just exacerbating the issue. Building in windows seems like an easier problem to fix than the limited (for linux especially) build documentation.

I have to build a dedicated server for a game I’m making, and that compiles and runs in linux just fine when packaging with visual studio.

I am trying to package a project and obtain an executable for Linux. I’m running a natively built Unreal Engine 4.17.1 on Ubuntu 16.04.
When I do File → Package Project → Linux, the following page opens in a web browser:

The page includes instructions for cross-compilation toolchain setup on Windows, which seems totally unapplicable for Linux.

I’ve also tried running the following command:
$ Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -nocompile -nop4 -project=“/media/valts/shelf_space/droning/MyProject5/MyProject5.uproject” -cook -compressed

But it fails with an error:
“Stage Failed. Missing receipt 'MyProject5.target”

I’ve read that the solution to the above error is to package the project, which I clearly can’t do, as I explained above.

Is there any guide or instructions for packaging a project for Linux natively on Linux that does not involve cross-compilation from windows?

The packaging should not fail on Linux either (so that issue needs to be reported as bug if it reproes on a clean project), however if you are packaging for redistribution, it is indeed better to use the cross-toolchain. Otherwise your packaged project will only run on systems like yours or newer, since on Linux we use the system compiler, while our Windows cross-toolchain produces binaries that can run on CentOS 7 and up.