2

I needed to reinstall wine from scratch so I first decided to uninstall the current version but, running the command

sudo apt-cache pkgnames wine

before and after running any of:

sudo apt-cache --purge remove wine1.4
sudo apt-cache --purge remove wine1.6
sudo apt-cache --purge remove wine1.7

results in the same lists of packages, so how do i know that executing apt-cache remove actually has uninstalled the package I commanded?

also should'nt the --purge option imply complete removal of wine (including wine1.7-dbg, wine1.7dev and several other files)?

0

2 Answers 2

1

The correct command to remove a package is, e.g.

sudo apt-get --purge remove wine1.4

and NOT

sudo apt-cache --purge remove wine1.4

--purge doesn't remove other packages, if the other packages don't depend on this package.


The command sudo apt-cache pkgnames wine prints only known packages and not the installation status:

From man apt-cache,

pkgnames [prefix]
    This command prints the name of each package APT knows.
    The optional argument is a prefix match to filter the name list. The
    output is suitable for use in a shell tab complete function and
    the output is generated extremely quickly. This command is best used with
    the --generate option.

To show the installation status, you could use apt-cache policy:

$ apt-cache policy wine
wine:
  Installed: (none)
  Candidate: 1:1.7.44-0ubuntu1
  Version table:
     1:1.7.44-0ubuntu1 0
        500 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/ wily/main amd64 Packages
     1:1.6.2-0ubuntu10 0
        500 http://archive.ubuntu.com/ubuntu/ wily/universe amd64 Packages

or dpkg -l

$ dpkg -l | grep wine
rc  wine1.6                                     1:1.6.2-0ubuntu10                        amd64        Microsoft Windows Compatibility Layer (Binary Emulator and Library)
rc  wine1.6-amd64                               1:1.6.2-0ubuntu10                        amd64        Microsoft Windows Compatibility Layer (64-bit support)
rc  wine1.6-i386:i386                           1:1.6.2-0ubuntu10                        i386         Microsoft Windows Compatibility Layer (32-bit support)
ii  wine1.7                                     1:1.7.44-0ubuntu1                        amd64        Microsoft Windows Compatibility Layer (Binary Emulator and Library)
ii  wine1.7-amd64                               1:1.7.44-0ubuntu1                        amd64        Microsoft Windows Compatibility Layer (64-bit support)
ii  wine1.7-i386:i386                           1:1.7.44-0ubuntu1                        i386         Microsoft Windows Compatibility Layer (32-bit support)
ii  winetricks                                  0.0+20141009+svn1208-2ubuntu1            all          Microsoft Windows Compatibility Layer (winetricks)
2
  • 1
    And apt-get is the command for installing and removing packages. See man apt-get, and do sudo apt-get --purge remove wine1.7
    – waltinator
    Dec 17, 2015 at 7:36
  • @waltinator maybe you might want to post this as answer ? Dec 17, 2015 at 7:50
1

Paraphrasing from apt-get's man page:

   purge is identical to remove except that configuration files are deleted too.

It won't delete more or fewer packages than a plain remove would.

But to remove other packages which were installed as dependencies you can run this command afterwards:

sudo apt-get --purge autoremove

Quoting from the man page again:

   autoremove
       autoremove is used to remove packages that were automatically
       installed to satisfy dependencies for other packages and are now no
       longer needed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.