如何从终端卸载软件包?

如何从终端卸载软件包?

几天前,我安装了 Wine 6.0.2(用于运行 Windows 软件)和 Winetricks '20210206-next',以便能够轻松使用 Wine。但是,我最近使用 卸载了 wine sudo apt-get remove --auto-remove winehq-stable。我从互联网上获得了此命令。

现在,当我wine在终端中输入时,我得到的bash: /usr/bin/wine: No such file or directory是应该得到的。但是,当我输入时,apt list -a wine我得到的是 wine/focal,focal 5.0-3ubuntu1 all。这是否意味着我仍然安装了 Wine?另外,我想卸载 Winetricks。我使用了,sudo apt-get purge winetricks然后它显示Package 'winetricks' is not installed, so not removed

请告诉我如何卸载 Winetricks。顺便说一句,当我输入时,apt list -a winetricks我得到了winetricks/focal,focal 0.0+20200412-1 all。此外,我在 Ubuntu GUI 包管理器中看不到 winetricks。

我运行了apt list --installed| grep wine*,但是没有看到任何名为 Wine 或 Winetricks 的包。但是,当我运行winetricks或时,winetricks --version我可以看到包在那里。

嗯,我使用的是 Ubuntu 20.04。以下是dpkg -l | grep -i wine

rc  wine-stable                                6.0.2~focal-1                         amd64        WINE Is Not An Emulator - runs MS Windows programs
rc  wine-stable-amd64                          6.0.2~focal-1                         amd64        WINE Is Not An Emulator - runs MS Windows programs
rc  wine-stable-i386:i386                      6.0.2~focal-1                         i386         WINE Is Not An Emulator - runs MS Windows programs

答案1

apt list -a wine或者apt list --all-versions wine列出所有可用的 wine 版本。我没有安装 wine,apt list -a wine在我的终端中的结果和你的一样:

Listing... Done
wine/focal,focal 5.0-3ubuntu1 all

运行检查某个包是否安装。确认 wine 包未安装的结果:apt policy packageapt policy wine

wine:
  Installed: (none)
  Candidate: 5.0-3ubuntu1

man apt显示选项结果list的部分结果apt

list
    list is somewhat similar to dpkg-query --list in that it can
    display a list of packages satisfying certain criteria. It supports
    glob(7) patterns for matching package names as well as options to
    list installed (--installed), upgradeable (--upgradeable) or all
    available (--all-versions) versions.

apt list --installed wineapt list -i wine根本不返回任何包的结果确认 wine 包未安装:

Listing... Done

当您运行winetricks或时,winetricks --version您可以看到包在那里,因为您没有从默认的 Ubuntu 20.04 存储库安装 winetricks。iinm 您使用以下命令手动安装了 winetricks 版本 20210206-next,并且没有从/usr/local/bin安装目录中手动删除 winetricks:

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

手动删除 winetricks 后,运行/usr/local/bin检查它是否仍然安装。cd /usr/local/bin && sudo rm winetricksapt policy winetricks

相关内容