Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Installation and troubleshooting on Ubuntu 18.04-19.10 and Fedora 31.

Discussion in 'Linux' started by Ermiq, Jan 13, 2020.

  1. Ermiq

    Ermiq

    Joined:
    May 1, 2018
    Posts:
    11
    I've tried Unity Linux editor on a various Linux distros (Ubuntu 18.04, 19.10, Fedora 31). Yeah, I should rethink the way I'm spending my life time. However, all Unity setups were performed on fresh OS installations, so the following guide should be enough to fix the majority of the problems related to missing libraries (unless you haven't deleted some pre-installed libraries from your system).
    Doing the following was enough to get fully working Unity+VSCode setup with IntelliSense, autocompletion, etc, etc.

    First of all, install the Unity Hub: for now it's available here: https://forum.unity.com/threads/unity-hub-v-1-3-2-is-now-available.594139/

    UnityHub possible problems:

    1. It just won't start:
    Make sure it has execution permission:
    - via terminal:
    Code (Boo):
    1. cd /path/to/UnityHub.AppImage //e.g., cd ~/Downloads)
    2. sudo chmod +x ./UnityHub.AppImage
    -via GUI:
    right click on the file->Properties->Permissions->Allow executing file as program should be checked.

    If still not started, run the file in terminal:
    Code (Boo):
    1. /path/to/UnityHub.AppImage //e.g., ~/Downloads/UnityHub.AppImage
    and you'll see error messages in terminal (if any). On Ubuntu 19.10 I had the following:
    error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    In this case you'll need to install the libgtk2.0-0 package:
    Code (Boo):
    1. sudo apt install libgtk2.0-0
    On fresh installs of Ubuntu 18.04 and Fedora 31 I haven't get the errors, so, UnityHub should start right away on these distros (sometimes it requires two clicks though (not a double-click, but two separate clicks).​

    2. UnityHub cannot recognize your existing projects:

    Create a new project (if you can't, see the next issue), open the project, close the editor and the Hub, and run the Hub again. Now it will let you to add your existing projects.​

    3. On Fedora UnityHub will probably be unable to create a new project folder on disk and the editor won't start.

    In my case on Fedora 31 it was due to Unity being unable to find the libGLU.so.1 library, the error in UnityHub logs (~/.config/UnityHub/logs/info-log.json) was:
    error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or directory
    If you've got the same, install mesa-libGLU:
    Code (Boo):
    1. sudo dnf install mesa-libGLU
    4. The two empty red error messages in the editor (even in a new empty project):
    Occurs on Ubuntu 19.xx, Unity needs the libssl1.0.0 package which is not presented in 19.04 and 19.10 repositories, but it could be downloaded from 18.04 here: https://packages.ubuntu.com/bionic/libssl1.0.0.​

    5. The pending error messages in editor console:
    Curl error 77: Error reading ca cert file from /etc/ssl/certs/ca-certificates.crt
    .
    Occured on Fedora 31. You can't download assets from the Asset Store due to this error. Found the solution here: https://forum.unity.com/threads/issues-with-unity-hub-on-fedora-30.767687/

    Setting up VSCode:

    1. Install .NET SDK (current latest version is 3.1):
    Official Microsoft instructions on installing .NET SDK:
    for Fedora https://docs.microsoft.com/ru-ru/dotnet/core/install/linux-package-manager-fedora30
    for Ubuntu https://docs.microsoft.com/ru-ru/dotnet/core/install/linux-package-manager-ubuntu-1904


    FEDORA 31:
    Add the Microsoft key and repository first:
    Code (Boo):
    1. sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    2. sudo wget -q -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/30/prod.repo
    3. sudo dnf install dotnet-sdk-3.1
    UBUNTU 18.04-19.10:
    Add the Microsoft key and repository first:
    Code (Boo):
    1. wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    2. sudo dpkg -i packages-microsoft-prod.deb
    3. sudo apt update
    4. rm packages-microsoft-prod.deb
    5. sudo apt install dotnet-sdk-3.1

    2. Install Mono:
    Official Mono-Project instructions: https://www.mono-project.com/download/stable/#download-lin-ubuntu.

    FEDORA 31:
    Need to add Mono's repository for CentOS_8 to get the current up-to-date Mono (ver. 6.8.0 stable), otherwise you could get the error "Framework 4.7.1 not found":
    Code (Boo):
    1. sudo rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
    2. sudo curl -o /etc/yum.repos.d/mono-centos8-stable.repo https://download.mono-project.com/repo/centos8-stable.repo
    3. dnf update
    4. sudo dnf install mono-devel
    UBUNTU 19.10:
    Code (Boo):
    1. sudo apt install mono-devel
    On UBUNTU 18.04 you'll need to add Mono repositories first:
    Code (Boo):
    1. sudo apt install gnupg ca-certificates
    2. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    3. echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
    4. sudo apt update
    5. sudo apt install mono-devel
    As an option you can install the complete version of mono to be sure that you won't need anything else:
    UBUNTU:
    Code (Boo):
    1. sudo apt install mono-complete
    FEDORA:
    Code (Boo):
    1. sudo dnf install mono-complete

    3. Install VSCode.
    In VSCode install C# extension and wait for the Omnisharp installation complete (the progress could be seen in VSCode console).​

    4. Set VSCode as a default script editor in Unity:
    In editor Edit->Preferences->External tools->External source editor expand the dropdown menu, choose Browse... and search for VSCode executable. The path depends on the version of the VSCode you've installed:
    - the *.deb/*.rpm/apt/dnf/yum version (usually installed with terminal commands from VSCode site) will be at
    /usr/bin/code

    - the snap version (installed from Ubuntu Software Center or SnapStore or via terminal with
    sudo snap install --classic code
    ) will be at
    /snap/bin/code
    5. Open any C# script with right click->Edit script->have fun.
     
    Last edited: Feb 18, 2020
  2. BarryFiskerman

    BarryFiskerman

    Joined:
    Feb 6, 2020
    Posts:
    1
    Thank you so much for this, I just installed Fedora today, and this was by far the easiest tutorial I've looked at all day. (there were many).
     
  3. Gone2Plaid

    Gone2Plaid

    Joined:
    Jan 18, 2020
    Posts:
    3
    I'm running the AppImage in Ubuntu 19.04. I launch the Hub and connect to my existing projects, select the editor version, and try to launch the project. Unity starts launching the project, gets a few steps in, and then crashes. I tried creating a new project with the same results. Thanks in advance for any suggestions you can provide! Log reports the following:

    {"moduleName":"WindowManager","level":"info","message":"[ 'New Project Window is called for editor 2019.3.10f1' ]","timestamp":"2020-04-21T23:17:05.326Z"}
    {"moduleName":"Templates","level":"warn","message":"[ 'No package.json found for the template',\n { [Error: ENOENT: no such file or directory, open '/home/adam/Unity/Hub/Editor/2019.3.10f1/Editor/Data/Resources/PackageManager/ProjectTemplates/libcache/package.json']\n errno: -2,\n code: 'ENOENT',\n syscall: 'open',\n path:\n '/home/adam/Unity/Hub/Editor/2019.3.10f1/Editor/Data/Resources/PackageManager/ProjectTemplates/libcache/package.json' } ]","timestamp":"2020-04-21T23:17:09.055Z"}
    {"moduleName":"LocalProject","level":"info","message":"[ 'createProject projectPath: /home/adam/Documents/Unity3d/TestProj, current editor: ',\n undefined ]","timestamp":"2020-04-21T23:17:37.532Z"}
    {"moduleName":"RestEvent:project","level":"info","message":"[ 'onProjectCreate data: ',\n { projectName: 'TestProj',\n projectDirectory: '/home/adam/Documents/Unity3d',\n projectType:\n '/home/adam/Unity/Hub/Editor/2019.3.10f1/Editor/Data/Resources/PackageManager/ProjectTemplates/com.unity.template.3d-4.2.8.tgz',\n selectedPackages: [],\n defaultScene: '',\n organizationId: undefined } ]","timestamp":"2020-04-21T23:17:37.532Z"}
    {"moduleName":"UnityIPCServer","level":"info","message":"[ 'client process has connected to /tmp/Unity-hubIPCService.sock!' ]","timestamp":"2020-04-21T23:17:47.894Z"}
    {"moduleName":"LaunchProcess","level":"info","message":"[ 'child process exited with code null' ]","timestamp":"2020-04-21T23:18:28.631Z"}
    {"moduleName":"HubIPCService","level":"info","message":"[ 'socket has disconnected: [object Object] , false!' ]","timestamp":"2020-04-21T23:18:28.918Z"}
     
  4. Gone2Plaid

    Gone2Plaid

    Joined:
    Jan 18, 2020
    Posts:
    3
    I've kept trying different things, but haven't made forward progress. I tried deleting the project directory and then reconnecting to the project. The folders are pulled down and most have files in them, but the Assets folder is empty. I think it's just not getting that far.