> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/linux.md).

# 在 Linux 上安装 Unsloth

在 Linux 上安装 Unsloth Desktop、Unsloth Studio 或 Unsloth Core。

要在 Linux 上安装 Unsloth Desktop，请按照以下步骤操作。

{% stepper %}
{% step %}

### 下载

<a href="https://unsloth.ai/download/linux" class="button secondary" data-icon="linux">为 Linux 下载 Unsloth</a>
{% endstep %}

{% step %}

### 安装

1. 打开 Unsloth 安装程序（`.deb` 文件）
2. 选择安装
3. 启动应用并等待安装完成
   {% endstep %}

{% step %}

### 选择一个模型

打开“选择模型”或“模型中心”，选择一个模型和量化方式，然后下载。完成后即可开始聊天——无需设置。

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FNCEVgKLJI0goPqjgcg9B%2Fmodel%20hub%20models.png?alt=media&amp;token=533b5e3c-a901-4b33-963e-4a703cc9d5a6" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Unsloth 现已就绪

要开始聊天，请输入消息并按 Enter。

* **连接工具：** [Claude Code](/docs/zh/ji-chu-zhi-shi/claude-code.md), [Codex](/docs/zh/ji-chu-zhi-shi/codex.md)、网页搜索、 [MCP](/docs/zh/ji-chu-zhi-shi/mcp.md) 等更多
* **训练模型：** 微调文本、扩散、嵌入等更多模型
* **生成媒体：** 在本地创建并训练图像、视频、TTS

<figure><img src="https://2657992854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpAGvwjGD0iVMZKBoyu7m%2Fgreeennn.png?alt=media&amp;token=d17a5528-8375-444c-9aff-f9e9f7903bcd" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### 高级安装

开发版、每夜版 Unsloth Studio 或基于代码的 Unsloth Core 请使用这些选项。

#### 从主仓库安装 Unsloth Studio

```bash
git clone https://github.com/unslothai/unsloth
cd unsloth
./install.sh --local
unsloth studio -H 0.0.0.0 -p 8888
```

#### 安装每夜版 Unsloth Studio

```bash
git clone https://github.com/unslothai/unsloth
cd unsloth
git checkout nightly
./install.sh --local
unsloth studio -H 0.0.0.0 -p 8888
```

#### 使用 uv 安装 Unsloth Core

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv unsloth_env --python 3.13
source unsloth_env/bin/activate
uv pip install unsloth --torch-backend=auto
```

或者直接安装最新的 pip 版本：

```bash
pip install unsloth
```

要安装带有 Unsloth 的 vLLM：

```bash
uv pip install unsloth vllm --torch-backend=auto
```

有关虚拟环境、CUDA 和 Torch 专用命令以及高级 pip 选项：

[**查看高级 pip 安装指南**](https://unsloth.ai/docs/get-started/install/pip-install)

### 手动安装 Unsloth Studio

下面的命令会安装 **Unsloth Studio**，即基于浏览器的 Web 界面。它不会安装原生桌面应用。

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

使用同一命令更新 Unsloth Studio。

#### 启动 Unsloth Studio

{% tabs %}
{% tab title="本地启动" %}

```bash
unsloth studio
```

{% endtab %}

{% tab title="远程访问" %}

```bash
unsloth studio --secure
```

{% endtab %}
{% endtabs %}

有关详细的 Unsloth Studio 安装说明和要求， [查看 Unsloth Studio 指南](https://unsloth.ai/docs/new/studio/install).

### 卸载

#### Unsloth Desktop

**Ubuntu 或 Debian（`.deb`)**

1. 如果 Unsloth 正在运行，请将其关闭。
2. 移除软件包：

```bash
sudo apt remove unsloth
```

**AppImage**

1. 如果 Unsloth 正在运行，请将其关闭。
2. 删除已下载的 `.AppImage` 文件。

卸载 Unsloth Desktop 不会删除已下载的模型或你的文件。

#### Unsloth Studio（手动安装）

运行 Linux 卸载脚本：

```bash
curl -fsSL https://raw.githubusercontent.com/unslothai/unsloth/main/scripts/uninstall.sh | sh
```

这会移除 Unsloth Studio、其 CLI 命令、启动器数据以及 Linux 桌面快捷方式。它不会移除已下载的 Hugging Face 模型。

#### 删除已下载的模型文件

默认的 Hugging Face 缓存位置是：

```bash
~/.cache/huggingface/hub/
```

如果 `HF_HUB_CACHE`, `HF_HOME`，或 `XDG_CACHE_HOME` 已设置，请改用该位置。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/zh/kuai-su-kai-shi/install/linux.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
