[SOLVED] curl and unzip/delete zip on ubuntu 20.04 server
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Waste of time it is not there, startserver.sh, in any of the directories it could be in in the archive.
Code:
root@buster-raspi:~# mkdir test
root@buster-raspi:~# mv SLOP+2-2.1.0.zip test/
root@buster-raspi:~# cd test
root@buster-raspi:~/test# unzip SLOP+2-2.1.0.zip
Archive: SLOP+2-2.1.0.zip
inflating: manifest.json
inflating: modlist.html
creating: overrides/
creating: overrides/config/
inflating: overrides/config/aiimprovements-common.toml
snip...
root@buster-raspi:~/test# ls -l
total 1924
-rw-r--r-- 1 root root 9443 Feb 7 02:36 manifest.json
-rw-r--r-- 1 root root 11400 Feb 7 02:36 modlist.html
drwxr-xr-x 6 root root 4096 Feb 7 02:36 overrides
-rw-r--r-- 1 502 staff 1941009 Feb 15 22:46 SLOP+2-2.1.0.zip
root@buster-raspi:~/test# find . -name start
./overrides/kubejs/startup_scripts
And for the removal of the zip firstly and the useless directory after that..
Code:
root@buster-raspi:~/test# rm SLOP+2-2.1.0.zip
root@buster-raspi:~/test# ls -l
total 28
-rw-r--r-- 1 root root 9443 Feb 7 02:36 manifest.json
-rw-r--r-- 1 root root 11400 Feb 7 02:36 modlist.html
drwxr-xr-x 6 root root 4096 Feb 7 02:36 overrides
root@buster-raspi:~/test# cd ../
root@buster-raspi:~# ls -l
total 24
drwxr-xr-x 2 root root 4096 Feb 11 16:09 bin
-rw-r--r-- 1 root root 16161 Feb 7 15:05 selections.txt
drwxr-xr-x 3 root root 4096 Feb 15 23:00 test
root@buster-raspi:~# rm -r test
root@buster-raspi:~# ls -l
total 20
drwxr-xr-x 2 root root 4096 Feb 11 16:09 bin
-rw-r--r-- 1 root root 16161 Feb 7 15:05 selections.txt
Edit2: You do not make a directory on /dev/sda2 you make a directory in the file system contained on the /dev/sda2 your / directory of your install. Above I showed the commands with me in /root/ my root users home (~) directory that is shown root@buster-raspi:~#. in the shell prompt. Since you use Ubuntu your root user will be disabled you would use sudo for any command that required root level privileges to run.
Last edited by HappyTux; 02-15-2021 at 09:14 PM.
Reason: additional information
Edit2: You do not make a directory on /dev/sda2 you make a directory in the file system contained on the /dev/sda2 your / directory of your install. Above I showed the commands with me in /root/ my root users home (~) directory that is shown root@buster-raspi:~#. in the shell prompt. Since you use Ubuntu your root user will be disabled you would use sudo for any command that required root level privileges to run.
okay, i did pwd and return was /home/ubuntu.. i'm inferring this is on sda2 because i've used explorer on the sda1 and saw no home directory..
if your code was trying to lead me to water, and i'm just not seeing it, then i apologize-- i don't yet know enough to use critical thinking and am a copy/paste terminal archetype for now.. but i used some of your edit2 to rework the following:
i know part of the whole point is to "try things out" and "see if they work"... but I am just so tired of reinstalling every time i screw something up :C
p.s. my terminal starts with ubuntu@ubuntu:~$
thank you again for your time
edit1: tried the code as written above, but upon unzip it says--
Code:
ubuntu@ubuntu:~/slop$ ls
server.zip
ubuntu@ubuntu:~/slop$ sudo unzip server
Archive: server.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of server or
server.zip, and cannot find server.ZIP, period.
Last edited by jrb0031; 02-15-2021 at 10:11 PM.
Reason: tried some stuffs n junks
okay, i did pwd and return was /home/ubuntu.. i'm inferring this is on sda2 because i've used explorer on the sda1 and saw no home directory..
if your code was trying to lead me to water, and i'm just not seeing it, then i apologize-- i don't yet know enough to use critical thinking and am a copy/paste terminal archetype for now.. but i used some of your edit2 to rework the following:
i know part of the whole point is to "try things out" and "see if they work"... but I am just so tired of reinstalling every time i screw something up :C
p.s. my terminal starts with ubuntu@ubuntu:~$
thank you again for your time
On a Pi and any machine that will boot EFI the /dev/sda1 is usually a tiny fat partition to load the boot files.
Code:
root@buster-raspi:~/test# fdisk -l /dev/sda
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Disk model: ASM105x
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: D8A96088-5191-480A-9498-EE006223808B
Device Start End Sectors Size Type
/dev/sda1 40 409639 409600 200M EFI System
/dev/sda2 409640 234441614 234031975 111.6G Linux filesystem
What is need for you now you know where you are at is to make the directory like I show with the name you want it to be, then move the file from where it is located to that directory. Once done you unzip then remove the server.zip. The file is there in the server.zip so it is just a matter of starting it. If you want it to keep running so you can close the Terminal or even reuse it then install the screen program then use screen for a command in the Terminal. It will start up and give you a virtual Terminal to type commands into. This is where you use the ./startserver.sh to start it up. Once happy it runs correctly then the CTRL key held down then the a and next d keys pressed while it is held down will detach the screen and leave it running for you. A screen -r will get you back into a running single session screen instance if more than one you need to know the process ID number it tells you when detaching to use screen -r 12345 for process 12345 or if you use the naming option when starting it then screen -r Name. The CTRL key held down then the q pressed twice while it is held down will kill off the running screen you are in and the program running in it. Or at the command line knowing the process ID number kill 12345. Good luck with it.
Edit: The startup script seems straight forward but I have no java installed on this thing to test it with, it is just a headless server for me no need for excess packages not required to be installed. Otherwise without that error it appears it would start once you make the file executable.....
Code:
oot@buster-raspi:~/test# ./startserver.sh
bash: ./startserver.sh: Permission denied
root@buster-raspi:~/test# chmod +x startserver.sh
root@buster-raspi:~/test# ./startserver.sh
https://github.com/BloodyMods/ServerStarter/releases/download/v1.2.7/serverstarter-1.2.7.jar
DEBUG: (curl) Downloading https://github.com/BloodyMods/ServerStarter/releases/download/v1.2.7/serverstarter-1.2.7.jar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 631 100 631 0 0 2651 0 --:--:-- --:--:-- --:--:-- 2651
./startserver.sh: line 36: java: command not found
root@buster-raspi:~/test# java --version
bash: java: command not found
Last edited by HappyTux; 02-15-2021 at 10:26 PM.
Reason: more information.
Edit: The startup script seems straight forward but I have no java installed on this thing to test it with, it is just a headless server for me no need for excess packages not required to be installed. Otherwise without that error it appears it would start once you make the file executable.....
Code:
oot@buster-raspi:~/test# ./startserver.sh
bash: ./startserver.sh: Permission denied
root@buster-raspi:~/test# chmod +x startserver.sh
root@buster-raspi:~/test# ./startserver.sh
https://github.com/BloodyMods/ServerStarter/releases/download/v1.2.7/serverstarter-1.2.7.jar
DEBUG: (curl) Downloading https://github.com/BloodyMods/ServerStarter/releases/download/v1.2.7/serverstarter-1.2.7.jar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 631 100 631 0 0 2651 0 --:--:-- --:--:-- --:--:-- 2651
./startserver.sh: line 36: java: command not found
root@buster-raspi:~/test# java --version
bash: java: command not found
with this last piece it is working happily!! i am so happy i could kiss you right now my friend!! thank you thank you!!
p.s. one final note for posterity.. curseforge link was not working, but i found out that if you start the download on a pc you can then right-click to copy the actual, real link which in this case turned out to be https://media.forgecdn.net/files/3195/280/server.zip
with this last piece it is working happily!! i am so happy i could kiss you right now my friend!! thank you thank you!!
p.s. one final note for posterity.. curseforge link was not working, but i found out that if you start the download on a pc you can then right-click to copy the actual, real link which in this case turned out to be https://media.forgecdn.net/files/3195/280/server.zip
You are welcome, good to see you have it working now. It can be a little difficult if not knowing the way around these systems. There were no personal computers when I was young, and when they came along with the TRS80, the first I touched, when in high school all they had were command lines. It is simple once you know it for most things anyways.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.