---
title: "在 Ubuntu 上使用 ibus-rime 在 vscode 中无法输入中文的问题"
date: 2021-08-12T21:11:44.000Z
author: Z.SHINCHVEN
tags: [ibus-rime, vscode, Ubuntu, 中文输入法]
canonical: https://atlassc.net/2021/08/13/vscode-ibus-rime-chinese-input-issue-on-ubuntu
---
我在`Snap Store`中安装了`vscode`，但是发现无法使用`ibus-rime`进行中文输入。

Google 了一会儿以后，看到有 blog post 提到从`Snap Store`中安装的`vscode`确实存在无法输入中文的问题，通过[微软源](https://code.visualstudio.com/docs/setup/linux#:~:text=f%20%23%20Install%20dependencies-,Note%20that%20other%20binaries%20are%20also%20available%20on%20the%20VS%20Code%20download%20page.,-Installing%20the%20.deb)在`apt`中安装可以解决这个问题。

```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt install apt-transport-https
sudo apt update
sudo apt install code # or code-insiders

```
output:

```log
$ sudo apt install code
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  code
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 78.1 MB of archives.
After this operation, 296 MB of additional disk space will be used.
Get:1 https://packages.microsoft.com/repos/code stable/main amd64 code amd64 1.59.0-1628120042 [78.1 MB]
Fetched 61.6 MB in 2min 49s (364 kB/s)                                         
Selecting previously unselected package code.
(Reading database ... 218411 files and directories currently installed.)
Preparing to unpack .../code_1.59.0-1628120042_amd64.deb ...
Unpacking code (1.59.0-1628120042) ...
Setting up code (1.59.0-1628120042) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for shared-mime-info (1.15-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
```
