本指南將向您展示如何在Ubuntu 16.04(Xenial Xerus)LTS 64位Linux上安裝Spotify客戶端。首先,我們從添加一個Spotify存儲庫開始:
$ sudo echo 'deb http://repository.spotify.com stable non-free' >> /etc/apt/sources.list
執行以下命令並導入未過期的密鑰。您的數字選擇很有可能是1
如下所示:
# gpg --keyserver hkp://keyserver.ubuntu.com --search-key 'Spotify Public Repository Signing Key'
gpg: data source: http://91.189.89.49:11371
(1) Spotify Public Repository Signing Key
4096 bit RSA key EFDC8610341D9410, created: 2017-07-25, expires: 2018-07-25
(2) Spotify Public Repository Signing Key
4096 bit RSA key 13B00F1FD2C19886, created: 2015-05-28, expires: 2017-11-22 (expired)
(3) Spotify Public Repository Signing Key
2048 bit RSA key 082CCEDF94558F59, created: 2012-06-25, expires: 2015-06-25 (expired)
(4) Spotify Public Repository Signing Key
1024 bit DSA key 4F9946354E9CFF4E, created: 2010-06-23, expires: 2012-06-22 (expired)
Keys 1-4 of 4 for "Spotify Public Repository Signing Key". Enter number(s), N)ext, or Q)uit > 1
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key EFDC8610341D9410: public key "Spotify Public Repository Signing Key " imported
gpg: Total number processed: 1
gpg: imported: 1
要確認,因此列出所有導入的密鑰,請運行:
# gpg --list-keys
/root/.gnupg/pubring.kbx
------------------------
pub rsa4096 2017-07-25 [SC] [expires: 2018-07-25]
0DF731E45CE24F27EEEB1450EFDC8610341D9410
uid [ unknown] Spotify Public Repository Signing Key
接下來,更新軟件包索引:
$ sudo apt-get update
如果您收到有關丟失密鑰的錯誤消息,請用錯誤消息中提供的密鑰替換上述密鑰。在這一階段,我們應該能夠像往常一樣使用apt-get
命令如下圖所示:
$ sudo apt-get install spotify-client
安裝完成後,從終端運行spotify以捕獲任何可能的錯誤:
$ spotify
您的Spotify客戶很可能會抱怨丟失libgcrypt.so.11
共享庫。
spotify: error while loading shared libraries: libgcrypt.so.11: cannot open shared object file: No such file or directory
如果是這種情況,您需要下載到libgcrypt11_1.5.3-5_amd64.deb
或來自debian存儲庫的類似版本的軟件包:
$ wget http://ftp.acc.umu.se/mirror/cdimage/snapshot/Debian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.3-5_amd64.deb
$ sudo dpkg -i libgcrypt11_1.#5.3-5_amd64.deb
Selecting previously unselected package libgcrypt11:amd64.
(Reading database ... 172946 files and directories currently installed.)
Preparing to unpack libgcrypt11_1.5.3-5_amd64.deb ...
Unpacking libgcrypt11:amd64 (1.5.3-5) ...
Setting up libgcrypt11:amd64 (1.5.3-5) ...
Processing triggers for libc-bin (2.21-0ubuntu5) ...