when I try to install the file using the "sudo apt-get install" command I get the error cannot find package
This means exactly what it says; it would have been useful if you had said what package name you used, of course.
APT is not a magical genie that you can ask for anything, unfortunately. You can only ask it for things that are available in the repositories it accesses.
I tried this on an up-to-date 64-bit RaspiOS 12 ("bookworm") system:
apt search minecraft
This will search the repositories for packages with "minecraft" or similiar in their name or brief description. The search is case insensitive. This is what I got:
Sorting... Done
Full Text Search... Done
libstb-dev/stable 0.0~git20220908.8b5f1f3+ds-1 arm64
single-file image and audio processing libraries for C/C++ - development headers
libstb0/stable 0.0~git20220908.8b5f1f3+ds-1 arm64
single-file image and audio processing libraries for C/C++
minetest/stable 5.6.1+dfsg+~1.9.0mt8+dfsg-2 arm64
Multiplayer infinite-world block sandbox
minetest-data/stable,stable 5.6.1+dfsg+~1.9.0mt8+dfsg-2 all
Multiplayer infinite-world block sandbox (data files)
minetest-mod-pycraft/stable,stable 0.22-4 all
Minetest mod - (most of) Raspberry PI Minecraft API
minetest-server/stable 5.6.1+dfsg+~1.9.0mt8+dfsg-2 arm64
Multiplayer infinite-world block sandbox (server)
python-picraft/stable,stable 1.0 all
Alternative API for controlling Minecraft from Python.
python-picraft-docs/stable,stable 1.0 all
Documentation for the alternative Python Minecraft API.
python3-minecraftpi/stable,stable 0.22-4 all
Raspberry PI Minecraft API Python client library
python3-picraft/stable,stable 1.0 all
Alternative API for controlling Minecraft from Python.
I'm not a minecraft user, but I am pretty sure none of these is the actual Minecraft server, and that it is not in fact available from the default repositories.
So doing something like sudo apt-get install minecraft
(again, you did not bother to include the actual package name you tried) comes back with "cannot find package". There is no mistake or malfunction here. It is telling you the package you want is not available to it.
Beware reading generic information online about Raspberry Pis and Minecraft. That stuff probably goes back for close to a decade and much of it will be out of date; I believe at one time minecraft was available straight from the Raspbian repos, but obviously it is not anymore. A quick search for "pi 5 minecraft" does, however imply that there are a number of ways of installing it from third party sources.
I tried installing Minecraft Pi from the official website, and unzipped the tarball using the terminal. I then located the folder using the cd command and tried to run the Linux executable from there with ./minecraft-pi. I get the error cannot find file when the file is clearly in the directory I am trying to run it from. When I use the ls command to try and see if it is getting recognised by the terminal, it shows everything but the executable. (like images needed for the game, etc)
I did this as well.
> tar -xzf minecraft-pi-0.1.1.tar.gz
> cd mcpi
> ls
api/ CONTROLS.txt data/ HOW_TO_RUN.txt LICENSE.txt minecraft-pi* VERSION.txt
The file is there and it is executable. Next:
> ./minecraft-pi
exec: Failed to execute process './minecraft-pi': The file exists and is executable. Check the interpreter or linker?
Press any key to continue...
> file minecraft-pi
minecraft-pi: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.26, BuildID[sha1]=ec7c5a7f459230e837d8551aab60b290e9599e63, stripped
Press any key to continue...
The problem here is that this was compiled for 32-bit and I'm using 64-bit. Fortunately, I had a Pi 3 on hand that's still running 32-bit bullseye.
> ./minecraft-pi
./minecraft-pi: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
There's no GUI installed so that makes sense. I checked what libraries it is linked to:
> ldd minecraft-pi
linux-vdso.so.1 (0x7eff5000)
/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76f83000)
libGLESv2.so => not found
libEGL.so => not found
libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x76f5c000)
libpng12.so.0 => not found
libSDL-1.2.so.0 => not found
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76dd4000)
[...]
That list is abbreviated but you can see there are a few things not found; libSDL is closely related to openGL(ES) and libpng is for .png images.
To check for which package libGLESv2.so is in:
> apt-file search libGLESv2.so
chromium-browser: /usr/lib/chromium-browser/swiftshader/libGLESv2.so
chromium-common: /usr/lib/chromium/libGLESv2.so
code: /usr/share/code/libGLESv2.so
code-exploration: /usr/share/code-exploration/libGLESv2.so
code-insiders: /usr/share/code-insiders/libGLESv2.so
libgles-dev: /usr/lib/arm-linux-gnueabihf/libGLESv2.so
libgles2: /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
libgles2: /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.1.0
minecraft-pi: /opt/minecraft-pi/lib/brcm/libGLESv2.so
minecraft-pi: /opt/minecraft-pi/lib/mesa/libGLESv2.so
scratch3: /usr/lib/scratch3/libGLESv2.so
scratch3: /usr/lib/scratch3/swiftshader/libGLESv2.so
If you had a GUI installed, it would have been there already. The interesting thing here is the second last package from the bottom: minecraft-pi.
Presumably, this is because it is only compiled for 32-bit. As I said before, I'm not a minecraft user and eg., the fact that you were looking for the game itself not the server was a bit lost on me.
There are two things you can do here:
Try and install a 32-bit userland ("userland" = software besides the kernel, which a 64-bit kernel can run 32-bit executables if all the dependencies are met) inside your 64-bit OS: https://wiki.debian.org/Multiarch/HOWTO
You would want --add-architecture armhf
. I cannot promise anything about how easy this is or how well/if it will work for what you want to do, especially since this is something that needs the GUI stack.
Get another SD card and try the 32-bit version of RaspiOS. These are the ones on the download page that aren't marked "64-bit". You could also try the "Legacy" version, which is probably closer to the one that download was built for (on the page it actually says "Raspbian Wheezy", which is nine years old).
I do not know if this means your memory will be limited to 3 GB, although the Pi 5 will still have a lot more going for it than the models that were current 9 years ago.
I'd recommend trying the second one first as it will be much easier than the first -- all you have to do is create the card, turn it on, and sudo apt install minecraft-pi
.
running executables such as Minecraft PI and the official Minecraft Java launcher do not work
- did you install these things? They are not part of the standard Debian installrunning executables such as Minecraft PI and the official Minecraft Java launcher do not work
... why would you try to run an executable that does not install successfully? ... you should be asking about installing, not about running