I have a rasperry pi zero w with raspbian stretch installed on a 4gb micro sd card. when I log in it goes to the pi@rasperrypi~$ command prompt. When I type in startx it says "unknown command". Is this a problem with the micro sd card? Because I have heard you need more than 4gb to boot the gui, or somthing else?
2 Answers
Raspbian Stretch with Desktop requires an sd card with a minimum size of 8GB. I tend to use 16GB sd cards.
https://www.raspberrypi.org/downloads/raspbian/
The Raspbian with Desktop image contained in the ZIP archive is over 4GB in size, which means that these archives use features which are not supported by older unzip tools on some platforms.
Adding Answer due to lack of ability to add comment to @CoderMike's answer
It is important to note whether you have RASPBIAN STRETCH WITH DESKTOP installed or RASPBIAN STRETCH LITE.
Stretch LITE doesn't have a GUI installed, hence the LITE. If this is the environment you are booting into this could be the issue. The GUI doesn't exist.
Note: I installed Startx on STRETCH LITE, and was unsuccessful (It wouldn't boot into GUI). I had to reinstall RASPBIAN WITH DESKTOP to successfully boot into the GUI
Stretch with Desktop It is recommended to use at least a 8gb SD card if you are using Stretch with Desktop. According to the website it states.
The Raspbian with Desktop image contained in the ZIP archive is over 4GB in size...
Since you have a 4GB SD Card, and the install of the OS is larger then 4GB. You may have a corrupt install of Raspbian on your SD card. Which may be causing your issues. I would recommend getting at least an 8GB SD Card and Install Stretch With Desktop.
sudo apt install raspberrypi-ui-mods
to install the full Pixel desktop you'll be in unsupported territory. You could attemptsudo apt install xorg
if you just want a minimal X desktop. Be sure to watch the available disk space if you run these commands.