webmc icon indicating copy to clipboard operation
webmc copied to clipboard

I made a webmc installer for ubuntu

Open FreddyFeuerstein opened this issue 3 years ago • 7 comments

Hello WebMC community,

I was chatting with some guys on the official discord server who where trying to get this piece of software working. Because the latest node version will not properly install on stock ubuntu and the setup process for webmc is everything but self explanatory, we came to the conclusion that an easy installer for ubuntu desktop and server would be really useful. So I made it.

It does the following:

1: Check if the user actually uses ubuntu and if not, exit with error code 130 (fatal error).

2: Add the needed PPA using echo, lsb_release and tee.

3: Update the package list.

4: Install (or if installed upgrade) nodejs and git.

5: Clone the webmc github repo.

6: Install the node modules needed by webmc.

7: Run the postinstall script to prepare webmc.

8: Launch the now fully configured webmc.

How to install:

1: Download zip file.

2: Extract zip file.

3: Open terminal at the same folder as the .sh file.

4: Run the following as a non-root user that has permission to use sudo:

chmod +x ./install4linux.sh && ./install4linux.sh

5: Follow the setup wizard until its done.

How to run webmc again:

1: Go into the webmc folder.

2: Run the following as a non-root user:

npm start

NOTE:

Run this at your own risk. I tested this on my machine and it worked but that doesn't mean that it will work on any pc without needing modification or preparation. It is very likely that it will work but it might not. If it doesn't, report the error as a comment on this issue.

2nd NOTE:

Due to github issues not allowing the upload of .sh files, i needed to zip the script.

DOWNLOAD LINK:

install4linux

FreddyFeuerstein avatar Jun 05 '21 20:06 FreddyFeuerstein

Hello, it seems you have knowledge on how to install this, so can i ask you, how do you install webmc on manjaro?

ghost avatar Jun 16 '21 06:06 ghost

I mostly use dpkg-based distros but as far as I know, you would have to replace the apt parts (the update, install and repository add parts) with the following code:

sudo pacman -Syu
sudo pacman -S git
sudo pacaur -S nvm
echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
exec $SHELL
nvm install 14
echo 'export PATH=$PATH:~/.yarn/bin' >> ~/.bashrc

I hope this helped you.

FreddyFeuerstein avatar Jun 16 '21 07:06 FreddyFeuerstein

Would this also work for a ubuntu 18.04 based distro?

Edit: I just tried and it says your system is not running ubuntu lol

Edit 2: I deleted the exit command in the script and it installs now. It would be better if you do add something to code for ubuntu based systems (like if it detetcs a ubuntu url in your source list it would decide you use ubuntu).

Edit 3: Also it gave an error, here is the full output;

Adding PPA... Your system is not running Ubuntu. pofdzm@pofdzm:~/Downloads$ nano install4linux.sh pofdzm@pofdzm:~/Downloads$ nano install4linux.sh pofdzm@pofdzm:~/Downloads$ ./install4linux.sh ██╗ ██╗███████╗██████╗ ███╗ ███╗ ██████╗ ██║ ██║██╔════╝██╔══██╗████╗ ████║██╔════╝ ██║ █╗ ██║█████╗ ██████╔╝██╔████╔██║██║
██║███╗██║██╔══╝ ██╔══██╗██║╚██╔╝██║██║
╚███╔███╔╝███████╗██████╔╝██║ ╚═╝ ██║╚██████╗ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝

WebMC Setup Wizard for Ubuntu Please enter your password. i-am-root-now

Adding PPA... Your system is not running Ubuntu. Upgrading node.js to latest version... Hit:1 http://ppa.launchpad.net/cybermax-dexter/sdl2-backport/ubuntu bionic InRelease Hit:2 http://tr.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://tr.archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]
Get:4 http://tr.archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]
Hit:5 http://ppa.launchpad.net/elementary-os/stable/ubuntu bionic InRelease
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]
Hit:7 http://ppa.launchpad.net/gezakovacs/ppa/ubuntu bionic InRelease
Hit:8 https://repo.steampowered.com/steam stable InRelease
Hit:9 http://packages.microsoft.com/repos/code stable InRelease
Hit:10 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Get:11 http://packages.elementary.io/appcenter bionic InRelease [5.909 B]
Hit:12 http://ppa.launchpad.net/lutris-team/lutris/ubuntu bionic InRelease
Get:13 http://tr.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1.310 kB]
Hit:14 http://ppa.launchpad.net/elementary-os/os-patches/ubuntu bionic InRelease
Get:15 http://tr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2.128 kB] Get:16 http://packages.elementary.io/appcenter bionic/main amd64 DEP-11 Metadata [301 kB] Get:17 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [48,5 kB]
Get:18 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [60,6 kB]
Get:19 http://tr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB] Get:20 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2.464 B]
Get:21 http://tr.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [290 kB]
Get:22 http://tr.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 128x128 Icons [1.070 kB] Get:23 http://tr.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2.468 B] Get:24 http://tr.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [9.268 B] Fetched 5.773 kB in 3s (1.653 kB/s)
Reading package lists... Done Building dependency tree
Reading state information... Done 2 packages can be upgraded. Run 'apt list --upgradable' to see them. Reading package lists... Done Building dependency tree
Reading state information... Done 0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 2 not upgraded. Need to get 4.796 kB/8.712 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http://tr.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 nodejs amd64 8.10.0~dfsg-2ubuntu0.4 [4.796 kB] Fetched 4.796 kB in 3s (1.721 kB/s) (Reading database ... 290613 files and directories currently installed.) Preparing to unpack .../git_1%3a2.17.1-1ubuntu0.8_amd64.deb ... Unpacking git (1:2.17.1-1ubuntu0.8) over (1:2.17.1-1ubuntu0.8) ... Preparing to unpack .../nodejs_8.10.0~dfsg-2ubuntu0.4_amd64.deb ... Unpacking nodejs (8.10.0~dfsg-2ubuntu0.4) over (8.10.0~dfsg-2ubuntu0.4) ... Setting up nodejs (8.10.0~dfsg-2ubuntu0.4) ... Setting up git (1:2.17.1-1ubuntu0.8) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Cloning the repo... Cloning into 'webmc'... remote: Enumerating objects: 19473, done. remote: Counting objects: 100% (372/372), done. remote: Compressing objects: 100% (162/162), done. remote: Total 19473 (delta 206), reused 355 (delta 192), pack-reused 19101 Receiving objects: 100% (19473/19473), 69.81 MiB | 1.25 MiB/s, done. Resolving deltas: 100% (6753/6753), done. Installing needed node packages... loadDep:worker-loader → r ▐ ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ loadDep:worker-loader → a ▐ ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ loadDep:worker-loader → g ▄ ╢████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟ WARN engine [email protected]: wanted: {"node":">= 10.13.0"} (current: {"node":"8.10.0","npm":"3.5.2"}) npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1 npm WARN deprecated [email protected]: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in. npm ERR! Linux 5.4.0-77-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1 npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3) npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22) npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12) npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7 npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12 npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5) npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7) npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20) npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror This is an error with npm itself. Please report this error at: npm ERR! typeerror http://github.com/npm/npm/issues npm ERR! Linux 5.4.0-77-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1 npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3) npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22) npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12) npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7 npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12 npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5) npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7) npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20) npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror This is an error with npm itself. Please report this error at: npm ERR! typeerror http://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /home/pofdzm/Downloads/webmc/npm-debug.log

[email protected] postinstall /home/pofdzm/Downloads/webmc node lib/postinstall.js

module.js:549 throw err; ^

Error: Cannot find module 'decompress' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (/home/pofdzm/Downloads/webmc/lib/postinstall.js:1:82) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

npm ERR! Linux 5.4.0-77-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "postinstall" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! [email protected] postinstall: node lib/postinstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script 'node lib/postinstall.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the webmc package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node lib/postinstall.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs webmc npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls webmc npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pofdzm/Downloads/webmc/npm-debug.log Starting webmc...

[email protected] start /home/pofdzm/Downloads/webmc npm run prebuild && node index.js

[email protected] prebuild /home/pofdzm/Downloads/webmc node lib/prebuild.js

module.js:549 throw err; ^

Error: Cannot find module 'prismarine-block' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (/home/pofdzm/Downloads/webmc/lib/prebuild.js:4:16) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

npm ERR! Linux 5.4.0-77-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "prebuild" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! [email protected] prebuild: node lib/prebuild.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] prebuild script 'node lib/prebuild.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the webmc package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node lib/prebuild.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs webmc npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls webmc npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pofdzm/Downloads/webmc/npm-debug.log

npm ERR! Linux 5.4.0-77-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! [email protected] start: npm run prebuild && node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'npm run prebuild && node index.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the webmc package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run prebuild && node index.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs webmc npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls webmc npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pofdzm/Downloads/webmc/npm-debug.log

Edit 4: I also realized it didn't asked for my password.

pofdzm avatar Jun 29 '21 18:06 pofdzm

Edit 4: I also realized it didn't asked for my password.

That is because you used sudo before or have the sudo password disabled.

Edit: I just tried and it says your system is not running ubuntu lol

That is because it checks the release file for the string ubuntu. if you run a ubuntu-based distro like mint for example, it cannot find it and errors out. I guess ill add a --force option for people using such a distro.

npm ERR! If you do, this is most likely a problem with the webmc package or node itself

It seems that that is actually the problem. You can send the log file in at the nodejs github and ask for a bug fix.

FreddyFeuerstein avatar Jun 30 '21 05:06 FreddyFeuerstein

accidentaly hit the close button

FreddyFeuerstein avatar Jun 30 '21 16:06 FreddyFeuerstein

I mostly use dpkg-based distros but as far as I know, you would have to replace the apt parts (the update, install and repository add parts) with the following code:

sudo pacman -Syu
sudo pacman -S git
sudo pacaur -S nvm
echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
exec $SHELL
nvm install 14
echo 'export PATH=$PATH:~/.yarn/bin' >> ~/.bashrc

I hope this helped you.

Thanks, i got it working by looking at the script and manually doing the commands in it replaced with the ones you gave and it seems to be working. im going to test it with my own minecraft server soon. Thank you.

ghost avatar Jul 01 '21 20:07 ghost

Thanks, i got it working by looking at the script and manually doing the commands in it replaced with the ones you gave and it seems to be working. im going to test it with my own minecraft server soon. Thank you.

np

FreddyFeuerstein avatar Jul 03 '21 09:07 FreddyFeuerstein