I’m trying to install Typst on a Linux machine (Linux Mint, if it matters). On a Mac, this was very easy: brew install typst, and the resulting installation was in opt/homebrew/bin/typst (for the compiler) and opt/homebrew/share/man/man1/typst.1 (for the manual). Typst isn’t in my package manager, and I have not had good luck with Snap, so I downloaded the tarball. The installation instructions for Linux instruct the user to “unpack the archive in the directory where you want to keep the Typst compiler.” Fair enough, but where is that? For example, I don’t have directories /opt/bin and /opt/share; should I create them? Or do these files go somewhere else on a Linux system?
Fair enough, but where is that?
That’s arbitrary. You can put the binary anywhere included in your PATH environment variable. I personally prefer mkdir -p ~/.local/bin/.
By the way, GitHub - typst-community/typst-install: 🤖 curl | sh installer script for Typst · GitHub is also available.
If you use Fedora, you can add Terra package repository to install Typst
Nobody knows LInux Filesystem? I just think a forum question is one place to put answer, not put related info.
Take a look at the best Linux CLI book written by William Shotts:
The ~/bin directory is a good place to put scripts intended for personal use.
If we write a script that everyone on a system is allowed to use, the traditional location is /usr/local/bin.
Scripts intended for use by the system administrator are often located in /usr/local/sbin.
In most cases, locally supplied software, whether scripts or compiled programs, should be placed in the /usr/local hierarchy and not in /bin or /usr/bin. These directories are specified by the Linux Filesystem Hierarchy Standard to contain only files supplied and maintained by the Linux distributor.
So the answer is ~/bin/ or /usr/local/bin/.
My approach is to install packages from source code whenever possible. So I’ve installed Rust since Typst is written in it .
Then we install Typst the compiler and Tinymist the language server:
cargo install --locked typst-cli
cargo install --git https://github.com/Myriad-Dreamin/tinymist --locked tinymist
Be sure to append this statement to the .bashrc file in your home directory:
export PATH=~/.cargo/bin/typst:$PATH
You can now run the compiler on the commandline.
Tinymist is very handy if you are using a text editor that understands the language server protocol.
Any two month usage of Linux, won’t say such wrong words. Because /usr/local/bin/ is in PATH already, all sub files and sub folders are in PATH too.
I’m a Linux user for years, not WSL or VM or dual OS.
// Linux never do something like
PATH = /path/to/exe
// baceuse PATH is folder, not file
// exe is a sort of file
As for source code install, if u’re not a rust developer, never do such thing. Just like people wouldn’t compile Linux/GNU for source before using them.
| Typst | Rust + Cargo + Much More | |
|---|---|---|
| size | 50M | ~500M |
| file | 1 | >999 |
| update steps | 1 | >999 * (check+download+compile+++) |
| update time | 20s | >20m |