Skip to content

Commit

Permalink
Update 2016-09-26-Typora on Linux.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wcbing committed Nov 20, 2024
1 parent b7c4ebb commit 43ffa51
Showing 1 changed file with 13 additions and 70 deletions.
83 changes: 13 additions & 70 deletions _posts/basic/2016-09-26-Typora on Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,76 +9,30 @@ typora-root-url: ../../

Installation instructions for different flavours of Linux.

## Debian/Ubuntu
> If you are a user in China, replace all `https://typora.io/` with `https://typoraio.cn/`.
> 如果你是中国的用户,请将所有 `https://typora.io/` 替换为 `https://typoraio.cn/`
```bash
# or use
# wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
wget -qO - https://typoraio.cn/linux/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/typora.asc
## Debian/Ubuntu/Mint

```shell
# download the key
curl https://typora.io/linux/public-key.asc | sudo gpg --dearmor -o /usr/share/keyrings/typora.gpg

# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
echo "deb [signed-by=/usr/share/keyrings/typora.gpg] https://typora.io/linux ./" | sudo tee /etc/apt/sources.list.d/typora.list
sudo apt update

# install typora
sudo apt-get install typora
sudo apt install typora
```

### Alternative for `apt-key`

When you try to add an APT repository key using `apt-key` (first line in previous command line) on Debian, Ubuntu and Linux distributions based on these, you'll see the following message: "*Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))*".

The easiest way would be just to ignore it.

But if you’re not OK with the warning, you can do followings:

1. Download the key and save it locally somewhere.

```shell
curl https://typora.io/linux/public-key.asc | gpg --dearmor > /usr/share/keyrings/typora.gpg
```

2. Create repo file `typora.list` in `/etc/apt/sources.list.d`.

```shell
sudo vim /etc/apt/sources.list.d/typora.list
```

3. Paste repo definition into this file:

```shell
deb [arch=amd64 signed-by=/usr/share/keyrings/typora.gpg] https://typora.io/linux ./
```

4. Now you can install Typora:

```shell
sudo apt-get update
sudo apt-get install typora
```

### Upgrade Typora

After installing Typora, the `typora` package will be managed by `apt-get`, so when your system updates installed packages, or you execute `apt-get upgrade`, Typora will be updated to latest version.
After installing Typora, the `typora` package will be managed by `apt`, so when your system updates installed packages, or you execute `apt upgrade`, Typora will be updated to latest version.

```bash
# upgrade all packages include Typora
sudo apt-get upgrade
```

## Mint

```sh
# or use
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -

# add Typora's repository
echo -e "\ndeb https://typora.io/linux ./" | sudo tee -a /etc/apt/sources.list
sudo apt-get update

# install typora
sudo apt-get install typora
sudo apt upgrade
```

## Download deb file manually
Expand All @@ -96,8 +50,7 @@ Then, input commands from https://typora.io/#linux into the newly opened termina

## Other Distributions

1. Download the binary package [Typora-linux-x64.tar.gz](https://typora.io/linux/Typora-linux-x64.tar.gz).
2. Try to install `apt-get` on your distribution, and then install typora.
Download the binary package [Typora-linux-x64.tar.gz](https://typora.io/linux/Typora-linux-x64.tar.gz).

## Snap Version

Expand Down Expand Up @@ -176,16 +129,6 @@ then:
1. Ensure `xenial-security` updates are included in *Software & Updates*.
2. run `sudo apt-get update && sudo apt-get install libnss3`

#### Malformed input, repository not added

You can add a repository by:

```sh
echo -e "\ndeb https://typora.io/linux ./" | sudo tee -a /etc/apt/sources.list
```

see related discussion in <https://github.com/typora/typora-issues/issues/2065#issuecomment-455877843>.

#### Shortcut for Heading 5 is not working

Please check if you uses fcitx (e.g. for typing Chinese)? `Ctrl + 5` is the global shortcut key for fcitx to reload its config. Deleting that global shortcut should make ctrl+5 work in Typora. (Thanks to https://github.com/typora/typora-issues/issues/867#issuecomment-647082881).
Expand Down

0 comments on commit 43ffa51

Please sign in to comment.