2019 年更新答案

2019 年更新答案

我已经安装了Wine,并且对当前版本非常满意,但是winetricks各种错误消息让我失望了几次。

如何更新winetricks以获取 Ubuntu 的最新版本?

答案1

Ubuntu 原版安装中附带的版本winetricks通常很旧。手动更新是一个好主意,而且非常安全winetricks独立的Wine安装后,只需几个简单的步骤即可完成:

1.检查最新版本,删除旧版本:

首先检查一下最新版本使用这个方便的单行命令从上游获取:

curl --silent --show-error \
https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks --stderr - \
| grep ^WINETRICKS_VERSION | cut -d '=' -f 2

然后,如果这个版本胜过你自己安装的版本(查看你的版本winetricks --version从命令行运行)删除当前安装的版本:

sudo apt-get remove winetricks

2.安装最新版本:

然后下载并安装最新版本:

wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks 
sudo mv -v winetricks /usr/local/bin

正如在我自己的系统上所演示的那样,可以测试最新版本:

andrew@ilium~$ winetricks --version
20240105-next - sha256sum: c43ad4a2529441656e3f5a0b5ed6e248de15bf5cf657510ec2c0f6efc2562080
andrew@ilium~$ 

3. 添加一些额外内容并检查较新的语法:

确保你有几个必需的“辅助”应用程序可以winetricks运行也是一个好主意,尽管其中大多数应该已经随 Wine 副本一起安装:

sudo apt-get install cabextract p7zip unrar unzip wget zenity

然后检查正确的用法,这可能与旧版本有所不同:

andrew@ilium~$ winetricks -h
Usage: /usr/local/bin/winetricks [options] [command|verb|path-to-verb] ...
Executes given verbs.  Each verb installs an application or changes a setting.

Options:
    --country=CC      Set country code to CC and don't detect your IP address
-f, --force           Don't check whether packages were already installed
    --gui             Show gui diagnostics even when driven by commandline
    --gui=OPT         Set OPT to kdialog or zenity to override GUI engine
    --isolate         Install each app or game in its own bottle (WINEPREFIX)
    --self-update     Update this application to the last version
    --update-rollback Rollback the last self update
-k, --keep_isos       Cache isos (allows later installation without disc)
    --no-clean        Don't delete temp directories (useful during debugging)
    --optin           Opt in to reporting which verbs you use to the Winetricks maintainers
    --optout          Opt out of reporting which verbs you use to the Winetricks maintainers
-q, --unattended      Don't ask any questions, just install automatically
-r, --ddrescue        Retry hard when caching scratched discs
-t  --torify          Run downloads under torify, if available
    --verify          Run (automated) GUI tests for verbs, if available
-v, --verbose         Echo all commands as they are executed
-h, --help            Display this message and exit
-V, --version         Display version and exit

Commands:
list                  list categories
list-all              list all categories and their verbs
apps list             list verbs in category 'applications'
benchmarks list       list verbs in category 'benchmarks'
dlls list             list verbs in category 'dlls'
fonts list            list verbs in category 'fonts'
settings list         list verbs in category 'settings'
list-cached           list cached-and-ready-to-install verbs
list-download         list verbs which download automatically
list-manual-download  list verbs which download with some help from the user
list-installed        list already-installed verbs
arch=32|64            create wineprefix with 32 or 64 bit, this option must be
                      given before prefix=foobar and will not work in case of
                      the default wineprefix.
prefix=foobar         select WINEPREFIX=/home/andrew/.local/share/wineprefixes/foobar
annihilate            Delete ALL DATA AND APPLICATIONS INSIDE THIS WINEPREFIX
andrew@ilium~$ 

4. 安全地逆转这些步骤:

如果由于某种原因您希望返回到旧的存储库版本,您只需运行以下命令:

sudo rm /usr/local/bin/winetricks
sudo apt-get install winetricks

一切将恢复原样。

笔记:

  • WineHQ 维基:winetricks所有最好的 winetricks 信息均来自 WineHQ Wiki。
  • 半自动化:现在可以部分通过运行自动执行更新过程sudo winetricks --self-update,如果对结果不满意,则使用以下命令回滚:sudo winetricks --update-rollback

答案2

2019 年更新答案

Disco 和 Eoan 中提供的 winetricks 版本能够自行更新[1]
如果你恰好使用的是 19.04 或更高版本,只需运行:

sudo apt install winetricks
sudo winetricks --self-update

如果您使用的是旧版本的 Ubuntu,您可以在此处获取.deb 包:
https://packages.ubuntu.com/eoan/all/winetricks/download

相关内容