Visit https://download.racket-lang.org and choose between the two available distributions:
Racket
is the main distribution, it comes with several additional packages like math/number-theory as well as the DrRacket IDE.Minimal Racket
is far smaller and comes only with the needed packages.The installation is very simple. If you are used to this kind of thing, just follow these four steps. A more detailed step-by-step walkthrough is detailed afterwards, if you prefer.
chmod +x racket-6.6-x86_64-linux.sh
./racket-6.6-x86_64-linux.sh
$PATH
.For a more detailed step-by-step guide, see below.
/home/YOUR_USER_NAME/Downloads
, type the following command:cd /home/YOUR_USER_NAME/Downloads
Be sure to replace YOUR_USER_NAME
by your actual user name and /Downloads
by the actual path to the folder to which you downloaded Racket.
x86_64
to match the file you downloaded).x86_64
to match the file you downloaded).Otherwise, if you are not an administrator on the computer, simply type ./racket-6.6-x86_64-linux.sh to install it in your own home directory (change the version number and the x86_64
to match the file you downloaded).
The installer will ask the following questions:
Do you want a Unix-style distribution?
Answer no (the default).
Where do you want to install the "racket-6.6.0.4" directory tree?
Select /usr/racket
(type 1 Enter ⏎) or /usr/local/racket
(type 2 Enter ⏎) if you are installing Racket system-wide. Otherwise, to install it in your own home directory (e.g. if you are not an administrator), select ~/racket (/home/YOUR_USER_NAME/racket)
(type 3 Enter ⏎).
If you want to install new system links within the "bin", "man" and "share/applications" subdirectories…
If you are doing a system-wide installation it is a good idea to type /usr/local or /usr here (to know which, check which one is present in your PATH
, by typing echo $PATH in another terminal window). If you are installing it in your own home directory, leave the answer empty and just press Enter ⏎.
Depending on your answer to steps 9 and 10, you need to type one of the following commands in a terminal to start DrRacket:
YOUR_USER_NAME
by your actual username, or simply type ~/racket/bin/drracket)To avoid typing such a long command each time, you can add the following command to the file ~/.bashrc
, where /path/to/the/containing/folder/
should be one of /usr/racket/bin/
, /usr/local/racket/bin/
or /home/YOUR_USER_NAME/racket/bin/
:
export PATH="/path/to/the/containing/folder/:$PATH"
To run a program, open DrRacket as explained above, enter the program starting with #lang racket
, and click the Run
button near the top-right corner. Here is a first example program:
#lang racket
(displayln "Hello Racket!")