[Bug 848668] Re: apt-get remove breaks system when removing Wine
Daniel Hartwig
mandyke at gmail.com
Thu Jun 6 01:55:54 UTC 2013
> I discovered a possible bug in the apt-get remove command, it actually
> broke my whole system, and removed all my packages.
Well, you pretty much asked it to, so that is not a bug.
status invalid
>
> I was trying to remove Wine 1.3 devel from my machine. This package
> contains several other packages such as winetricks. So instead of
> removing them one-by-one, I ran the following command:
>
> sudo apt-get remove win*
>
> I double checked before this, by hitting the TAB twice after typing
> "win".
Bash-completion is not a proper verification of the actions that
apt-get will take. Either use ‘apt-get --simulate …’, or read the
summary that apt presents before asking whether to proceed.
> There was supposed to be only 3 packages here.
Maybe in your mind, but not apts. Quoting the manual:
> If no package matches the given expression and the expression
> contains one of '.', '?' or '*' then it is assumed to be a POSIX
> regular expression, and it is applied to all package names in the
> database. Any matches are then installed (or removed). Note that
> matching is done by substring so 'lo.*' matches 'how-lo' and
> 'lowest'. If this is undesired, anchor the regular expression with
> a '^' or '$' character, or create a more specific regular
> expression.
Here ‘win*’ is a regular expression matching anywhere in the package
name. Any package whose name contains ‘wi’, which is perhaps quite a
few packages. Removing any non-trivial amount of packages generally
requires also removing many more, due to broken dependencies.
Apt is a system administration tool. Do not submit commands to it
without understand what those commands instruct.
> But after
> submitting the command, it actually started removing packages like:
> gtk+, gwibber, then the kernels, evolution etc. At this time it was
> too late to cancel the procedure.
Was there no summary of the actions followed by a prompt asking wheter
to proceed?
> The "win*" expression should cover only those packages those name is
> starting with win. Instead it considered * to be for every package.
>
As explained above. You have this very wrong. The expression you are
looking for in this case is “^win.*”.
Solution for this “bug” is to read the manual and disable options such
as Apt::Get::Assume-Yes, and Apt::Get::Force-Yes.
** Changed in: apt (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/848668
Title:
apt-get remove breaks system when removing Wine
Status in “apt” package in Ubuntu:
Invalid
Bug description:
Hi,
I discovered a possible bug in the apt-get remove command, it actually
broke my whole system, and removed all my packages.
I was trying to remove Wine 1.3 devel from my machine. This package
contains several other packages such as winetricks. So instead of
removing them one-by-one, I ran the following command:
sudo apt-get remove win*
I double checked before this, by hitting the TAB twice after typing
"win". There was supposed to be only 3 packages here. But after
submitting the command, it actually started removing packages like:
gtk+, gwibber, then the kernels, evolution etc. At this time it was
too late to cancel the procedure. There were no entries in the
bootloader after reboot, only Windows was still present (I was on
dual-boot).
The "win*" expression should cover only those packages those name is
starting with win. Instead it considered * to be for every package.
Note: I had several PPA's added to my repositories, including the
official Wine PPA. But don't think this has anything to do with this
issue.
I was using:
* Ubuntu 11.04 32-bit with latest updates and patches installed as of 09/12/2011
* Official wine repository: sudo add-apt-repository ppa:ubuntu-wine/ppa
* Wine 1.3.28 devel : sudo apt-get install wine1.3
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/848668/+subscriptions
More information about the foundations-bugs
mailing list