Score:0

How do I uninstall a package from terminal?

eg flag

Days ago, I installed Wine 6.0.2 (to run windows software) and Winetricks '20210206-next' to be able to easily use Wine. However, I uninstalled wine recently using sudo apt-get remove --auto-remove winehq-stable . I got this command from internet.

Now when I type wine in terminal I get bash: /usr/bin/wine: No such file or directory as it should be. However, when I type apt list -a wine I get wine/focal,focal 5.0-3ubuntu1 all. Does it mean I still have Wine installed? Also, I wanted to uninstall Winetricks. I used sudo apt-get purge winetricks then it says Package 'winetricks' is not installed, so not removed.

Please let me know how do I uninstall Winetricks. Btw when I type apt list -a winetricks I get winetricks/focal,focal 0.0+20200412-1 all. Also, I can't see winetricks in my Ubuntu GUI package manager.

I ran apt list --installed| grep wine*, I can't see any package named Wine or Winetricks. However, when I run winetricks or winetricks --version I can see the package is there.

Well, I am using Ubuntu 20.04. Here is the output to 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
Someone avatar
my flag
You need to use `apt list --installed` to check installed packages. The command you are using list every package available in the repositpries. Also, [edit] you question and add the version of ubuntu you use.
Someone avatar
my flag
You can simply use `apt remove` to remove any installed package, what is hard in that?
Prakhar Sharma avatar
eg flag
i've edited the question.
N0rbert avatar
zw flag
To be sure please add output of `dpkg -l | grep -i wine` to the question.
Score:4
sa flag

apt list -a wine or apt list --all-versions wine lists all available versions of wine. I do not have wine installed, and the results of apt list -a wine in my terminal are the same as yours:

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

Run apt policy package to check if a package is installed. The results of apt policy wine confirm that the wine package is not installed:

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

Partial results of man apt showing the results for the list option of 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.

The results of apt list --installed wine or apt list -i wine don't return any packages at all confirming that the wine package is not installed:

Listing... Done

When you run winetricks or winetricks --version you can see the package is there, because you did not install winetricks from the default Ubuntu 20.04 repositories. iinm you manually installed winetricks version 20210206-next with the following commands and did not manually remove winetricks from the /usr/local/bin directory where it is installed:

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

After manually removing winetricks from /usr/local/bin with cd /usr/local/bin && sudo rm winetricks run apt policy winetricks to check if it is still installed.

Prakhar Sharma avatar
eg flag
This worked. I don't remember exactly how I installed Winetricks. Isn't there any Windows equivalent to add or remove programs. Ubuntu Software Center does not shows all installed packages. Also, in my case, I used wget, and I can't see the package in ' apt list --installed' .
karel avatar
sa flag
There are multiple ways that winetricks could end up installed in `/usr/local/bin` . If you moved winetricks into `/usr/local/bin` with `sudo mv -v winetricks /usr/local/bin` then you can remove it using the built-in Files file browser application by installing the nautilus-admin package with `sudo apt install nautilus-admin` nautilus-admin is an extension for Nautilus to do administrative operations. It's not exactly like Windows Add/Remove Programs, but at least it has a GUI.
karel avatar
sa flag
Packages that are compiled from source can be uninstalled similarly to Add/Remove Programs in Windows using the Software app if you converted the package into a .deb package before you installed it using the checkinstall package (`sudo apt install checkinstall`) .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.