> 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/kai-shi-shi-yong/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/claude-code.md), [Codex](/docs/zh/ji-chu/codex.md)、网页搜索， [MCP](/docs/zh/ji-chu/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**，即基于浏览器的网页界面。它不会安装原生桌面应用。

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

使用相同的命令更新 Unsloth Studio。

#### 启动 Unsloth Studio

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

有关详细的 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
