在 Manjaro 和其他基于 Arch Linux 的发行版上安装 Spotify
Spotify

> 
> Spotify 不需要介绍。它是最流行的音乐流媒体服务。
> 
> 
> 


![](/data/attachment/album/202208/25/133643nz8h58cl5ly8y6ly.jpg)


你可以 [在 Web 浏览器中播放 Spotify](https://open.spotify.com/)，但如果你经常使用它，使用桌面应用会是一个更好的选择。


为什么呢？因为你可以用媒体键控制播放，得到歌曲的通知，而且不需要担心不小心关闭浏览器标签或窗口。桌面客户端给人一种完整的体验。


Spotify 为 Ubuntu 和 Debian [提供了一个仓库](https://www.spotify.com/us/download/linux/)。但在 Arch Linux 上安装 Spotify 呢？


实际上，在 Arch Linux 上获得 Spotify 的桌面应用更加简单。只需使用这个命令：



```
sudo pacman -Syu spotify-launcher

```

这就是在基于 Arch 的 Linux 发行版上安装 Spotify 的众多方法之一，如 Manjaro、[Endeavour OS](https://endeavouros.com/)、[Garuda Linux](https://garudalinux.org/) 等。


在本教程中，我将讨论以下安装 Spotify 的方法：


* 使用 [pacman](https://wiki.archlinux.org/title/Pacman)（你已经在上面看到了，但我们会更深入地挖掘）。
* 使用 [Pamac](https://wiki.manjaro.org/index.php/Pamac)（Manjaro的软件包管理器）进行安装
* 使用 [Flatpak](https://itsfoss.com/what-is-flatpak/)（通用打包格式）进行安装
* 使用 Snap（Spotify 团队的官方包）。


### 方法 1：使用 pacman 安装 Spotify


Spotify 可在 Arch Linux 的社区仓库中 [找到](https://archlinux.org/packages/community/x86_64/spotify-launcher/)。它实际上是 Spotify 提供的 APT 仓库的 Rust 实现。


打开你的终端，按以下方式 [使用 pacman 命令](https://itsfoss.com/pacman-command/)：



```
sudo pacman -Syu spotify-launcher

```

安装后，从应用菜单中启动它，并登录开始收听。


![Spotify on Arch Linux](/data/attachment/album/202208/25/133645cs3nb4sbsb4e1s4n.png)


输入下面的命令，将其连同其依赖关系和配置文件一起删除。



```
sudo pacman -Rns spotify-launcher

```

### 方法 2：使用 Pamac 安装 Spotify


如果你使用 Manjaro 或者 [在你的系统中安装了 Pamac](https://itsfoss.com/install-pamac-arch-linux/)，你可以用它来图形化安装 Spotify。


从应用菜单中打开添加/删除软件。点击左上角的搜索图标，搜索 Spotify。然后，选择名为 `spotify-launcher` 的软件包，并点击应用进行安装，如下图所示。


![Using Pamac to install Spotify](/data/attachment/album/202208/25/133646f2qzug7jh5uj7r0u.png)


你也可以在安装后取消选择该软件包，并点击应用来删除它。


#### 使用 Pamac CLI


是的，Pamac 也有一个命令行界面，你可以通过以下方式使用它来获得 Spotify。



```
pamac install spotify-launcher

```

要删除，使用：



```
pamac remove spotify-launcher

```

### 方法 3：使用 Flatpak 安装 Spotify


许多用户喜欢使用 Flatpak 安装专有应用，因为它提供了沙盒。


在终端输入以下命令来更新你的系统并安装 Flatpak（如果你还没有）。



```
sudo pacman -Syu flatpak

```

然后，使用下面的命令启用 [Flathub 仓库](https://flathub.org)。



```
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

```

现在，通过输入下面的命令安装 Spotify。



```
flatpak install spotify

```

要删除 Spotify 的 Flatpak 包，你可以使用下面的命令。



```
flatpak remove spotify

```

### 方法 4：使用 Snap 安装 Spotify


我知道很多人对 Snap 打包格式的“封闭性”非常反感。然而，Spotify 官方提供了一个 Snap 包。你可以从 Spotify 的开发者那里得到它。


如果你的系统支持 Snap 包，请使用以下命令：



```
sudo snap install spotify

```

如果你以后想删除它，使用这个命令：



```
sudo snap remove spotify

```

### 总结


第一个方法中讨论的 Arch 包是由 [kpcyrd](https://github.com/kpcyrd) 开发和维护的。你可以在 [这里](https://github.com/kpcyrd/spotify-launcher) 查看源代码。


如果你喜欢 Arch Linux 并想支持它，请考虑向该项目捐款。所有的工作都是由社区成员完成的，他们是无偿的志愿者。


如果你在 Arch 上安装 Spotify 有任何问题，请告诉我。




---


via: <https://itsfoss.com/install-spotify-arch/>


作者：[Anuj Sharma](https://itsfoss.com/author/anuj/) 选题：[lkxed](https://github.com/lkxed) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

Spotify needs no introduction. It is the most popular music streaming service.

You can [play Spotify in a web browser](https://open.spotify.com/?ref=itsfoss.com), but using the desktop application would be a better option if you use it extensively.

Why? Because you can control the playback with the media key, get notifications for the songs, and don’t need to worry about accidentally closing the browser tab or window. The desktop client gives a wholesome experience.

Spotify [provides a repository](https://www.spotify.com/us/download/linux/?ref=itsfoss.com) for Ubuntu and Debian. But what about installing Spotify on Arch Linux?

Actually, it is even simpler to get the Spotify desktop application on Arch Linux. Just use this command:

`sudo pacman -Syu spotify-launcher`


That’s one of the many ways of installing Spotify on Arch-based Linux distros like Manjaro, [Endeavour OS](https://endeavouros.com/?ref=itsfoss.com), [Garuda Linux](https://garudalinux.org/?ref=itsfoss.com), etc.

In this tutorial, I’ll discuss the following methods of installing Spotify:

- Using
[pacman](https://wiki.archlinux.org/title/Pacman?ref=itsfoss.com)(you already saw it above but we’ll dig deeper) - Installing using
[Pamac](https://wiki.manjaro.org/index.php/Pamac?ref=itsfoss.com)(the package manager from Manjaro) - Installing using
[Flatpak](https://itsfoss.com/what-is-flatpak/)(the universal packaging format) - Using Snap (official package by the Spotify team)

## Method 1: Install Spotify using pacman

Spotify is [available](https://archlinux.org/packages/community/x86_64/spotify-launcher/?ref=itsfoss.com) from the Community repository of Arch Linux. It’s actually a Rust implementation of the APT repository provided by Spotify.

Open your terminal and [use the pacman command](https://itsfoss.com/pacman-command/) in the following manner:

`sudo pacman -Syu spotify-launcher`


Once installed, launch it from the Application Menu and log in to start listening.

![Spotify on Arch Linux](https://itsfoss.com/content/images/wordpress/2022/07/spotify-e1658764973807.png)

Enter the following command to remove it along with its dependencies and config files.

`sudo pacman -Rns spotify-launcher`


## Method 2: Install Spotify using Pamac

If you are using Manjaro or [have installed Pamac in your system](https://itsfoss.com/install-pamac-arch-linux/), you can use it to install Spotify graphically.

Open Add/Remove Software from Applications menu. Click on the search icon on the top left and search for Spotify. Then, select the package named `spotify-launcher`

and click Apply to install as shown below.

![Spotify on Manjaro](https://itsfoss.com/content/images/wordpress/2022/07/pamac-spotify-e1658764946532.png)

You can also deselect the package when installed and click Apply to remove it.

### Using Pamac CLI

yes, Pamac also has a command line interface and you can use it in the following manner to get Spotify.

`pamac install spotify-launcher`


And to remove later, use:

`pamac remove spotify-launcher`


## Method 3: Install Spotify using Flatpak

Many users prefer to install proprietary applications using Flatpak for the sandbox it provides.

Enter the following command in the terminal to update your system and install Flatpak (if you don’t have it already).

`sudo pacman -Syu flatpak`


Then, enable [Flathub repository](https://flathub.org/?ref=itsfoss.com) using the following command.

`flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo`


Now, install Spotify by entering the command below.

`flatpak install spotify`


To remove the Flatpak for Spotify you can use the command below.

`flatpak remove spotify`


## Method 4: Install Spotify using Snap

I understand that many people have a strong dislike for the Snap packaging format for its ‘closed’ nature. However, Spotify provides a Snap package officially. You are getting it from the Spotify developers themselves.

If you have Snap package support on your system, use the following command:

`sudo snap install spotify`


If you want to remove it later, use this command:

`sudo snap remove spotify`


### Conclusion

The Arch package discussed in the first method is developed and maintained by [kpcyrd](https://github.com/kpcyrd?ref=itsfoss.com). You can check out the source code for the same [here](https://github.com/kpcyrd/spotify-launcher?ref=itsfoss.com).

Please consider donating to the project if you like Arch Linux and want to support it. All the work is done by the community members, who are unpaid volunteers.

Let me know if you have any issues installing Spotify on Arch.