選項 1:恢復/etc/lsb-release到原始版本:

選項 1:恢復/etc/lsb-release到原始版本:

昨天剛安裝了 Linux Mint 18.2 Cinnamon,現在正在嘗試安裝 Wine,但我所做的一切都會導致相同的錯誤。不知何故,我的代號一定與 Linux Mint Cinnamon 不匹配,並且不知道如何解決這個問題或如何安裝 Wine。在核心 4.14.1-041401-generic 上運行。任何幫助都會很棒!謝謝!

sudo add-apt-repository ppa:wine/wine-builds

LSB codename: 'Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 95, in <module>
    main()
  File "/usr/bin/lsb_release", line 59, in main
    distinfo = lsb_release.get_distro_information()
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 383, in get_distro_information
    distinfo = guess_debian_release()
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 281, in guess_debian_release
    get_distro_info(distinfo['ID'])
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 41, in get_distro_info
    RELEASES_ORDER.sort(key=lambda n: float(n[0]))
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 41, in <lambda>
    RELEASES_ORDER.sort(key=lambda n: float(n[0]))
ValueError: could not convert string to float: '14.04 LTS''.
Version of base-files: '18.2.1'.
Your LSB codename isn't a valid Linux Mint codename.

答案1

看來已經/etc/lsb-release從 Mint 版本更換為 Ubuntu 版本了。

有時這樣做是為了讓為 Ubuntu 設計的軟體能夠在 Mint 上運作。

選項 1:恢復/etc/lsb-release到原始版本:

# Download the base-files package into /tmp
cd /tmp
apt download base-files
# Extract the lsb-release from the DEB
dpkg --fsys-tarfile base-files_*_all.deb  | tar xO ./etc/lsb-release > /tmp/lsb-release-mint
# Overwrite the existing /etc/lsb-release if filesize > 0
[ -s /tmp/lsb-release-mint ] && sudo mv /tmp/lsb-release-mint /etc/lsb-release

選項 2:在以下位置建立符號連結/usr/share/mintsources

MINT_CODENAME=$(grep -oP 'CODENAME=\K\w+' /etc/linuxmint/info)
UBUNTU_CODENAME=$(lsb_release -sc)
sudo ln -rs /usr/share/mintsources/$MINT_CODENAME /usr/share/mintsources/$UBUNTU_CODENAME

注意:如果您升級作業系統,您可能需要更新此符號連結。

相關內容