[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: aptitude --mind-your-own-business option?



On Sat, Dec 02, 2006 at 11:27:46 -0900, Ken Irving wrote:
> On Sat, Dec 02, 2006 at 11:59:29AM -0500, Douglas Tutty wrote:
> > Aptitude may go a little 'crazy' or 'run away' when you first start
> > using it until you tell it which packages are installe because _you_
> > want them there and which are only installed to meet dependancies.
> > After this step is done it is remarkably well behaved.
> 
> Maybe this is a perlism, but aptitude to me violates the "principle
> of least surprise" in this regard.  I asked it to install a simple,
> standalone program, but it was not able to do this without "fixing" things
> to its own model of consistency, not mine, first.  IMHO it should do this
> if necessary, but it should do so when installed, like other well-bahaved
> packages with partucular needs.  Some packages install but require some
> file in /etc/something to be tweaked before being fully functional.

My theory is: There are no surprises with aptitude if one reads the
available documentation before one starts to use it.

> If it isn't "safe" to use apt-get once aptitide is installed, i.e.,
> apt-get conflicts with aptititude, then couldn't this be handled in the
> package setup as policy?

It is perfectly safe to mix aptitude and apt-get. I will now perform a
daring experiment to demonstrate this: I have here an up-to-date Debian Sid
box, which I have upgraded daily with aptitude for the last year (before
that I used apt-get, also daily). Now, what unspeakable horrors lie in
wait for me if I install something with apt-get and run aptitude
afterwards? There is only one way to find out...

First of all, an md5sum of aptitude's list of installed packages (which
includes the "auto" flag) - I want to be able to show that I can restore
this state:

$ aptitude search '~i' | md5sum
06f9da945e91f95eb2913ed081809159  -

As my guinea pig I will use the package "aiksaurus" since it does not
have too many dependencies, which makes it easier to follow what
happens. This is the starting configuration for this package and its
dependencies:

$ aptitude search '~n^aiksaurus$|~R^aiksaurus$'
p   aiksaurus                                   - an English-language thesaurus (utility)
p   libaiksaurus-1.2-0c2a                       - an English-language thesaurus (development)
p   libaiksaurus0c102                           - an English-language thesaurus (development)
i A libc6                                       - GNU C Library: Shared libraries
i A libgcc1                                     - GCC support library
i A libstdc++5                                  - The GNU Standard C++ Library v3
i A libstdc++6                                  - The GNU Standard C++ Library v3

Let's become root and tempt fate:

# apt-get install aiksaurus
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  libaiksaurus-1.2-0c2a
The following NEW packages will be installed:
  aiksaurus libaiksaurus-1.2-0c2a
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 34.2kB of archives.
After unpacking 147kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.nl.debian.org testing/main libaiksaurus-1.2-0c2a 1.2.1+dev-0.12-3 [23.7kB]
Get:2 http://ftp.nl.debian.org testing/main aiksaurus 1.2.1+dev-0.12-3 [10.5kB]
Fetched 34.2kB in 0s (112kB/s)
Reading package fields... Done
Reading package status... Done
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Selecting previously deselected package libaiksaurus-1.2-0c2a.
(Reading database ... 240380 files and directories currently installed.)
Unpacking libaiksaurus-1.2-0c2a (from .../libaiksaurus-1.2-0c2a_1.2.1+dev-0.12-3_i386.deb) ...
Selecting previously deselected package aiksaurus.
Unpacking aiksaurus (from .../aiksaurus_1.2.1+dev-0.12-3_i386.deb) ...
Setting up libaiksaurus-1.2-0c2a (1.2.1+dev-0.12-3) ...
Setting up aiksaurus (1.2.1+dev-0.12-3) ...

Have we confused aptitude with this maneuver?

$ aptitude search '~n^aiksaurus$|~R^aiksaurus$'
i   aiksaurus                                   - an English-language thesaurus (utility)
i A libaiksaurus-1.2-0c2a                       - an English-language thesaurus (development)
p   libaiksaurus0c102                           - an English-language thesaurus (development)
i A libc6                                       - GNU C Library: Shared libraries
i A libgcc1                                     - GCC support library
i A libstdc++5                                  - The GNU Standard C++ Library v3
i A libstdc++6                                  - The GNU Standard C++ Library v3

That does not look too unreasonable, does it now? (libaiksaurus0c102 is
included in this list because I have unstable, testing and stable in my
sources.list) How about some dist-upgrades as root:

# aptitude dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.

# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Do I recover the original state if remove aiksaurus again? (I have to
purge, otherwise the configuration files will stay in place.)

# aptitude --purge-unused purge aiksaurus
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
The following packages are unused and will be REMOVED:
  libaiksaurus-1.2-0c2a{p}
The following packages will be REMOVED:
  aiksaurus{p}
0 packages upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 147kB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
(Reading database ... 240389 files and directories currently installed.)
Removing aiksaurus ...
Removing libaiksaurus-1.2-0c2a ...

So far, so good:

$ aptitude search '~n^aiksaurus$|~R^aiksaurus$'
p   aiksaurus                                   - an English-language thesaurus (utility)
p   libaiksaurus-1.2-0c2a                       - an English-language thesaurus (development)
p   libaiksaurus0c102                           - an English-language thesaurus (development)
i A libc6                                       - GNU C Library: Shared libraries
i A libgcc1                                     - GCC support library
i A libstdc++5                                  - The GNU Standard C++ Library v3
i A libstdc++6                                  - The GNU Standard C++ Library v3

Whew, the C(++) libraries are still there. In fact, it looks like
nothing ever happened. What about the overall state of the installed
packages?

$ aptitude search '~i' | md5sum
06f9da945e91f95eb2913ed081809159  -

I rest my case.

-- 
Regards,
          Florian



Reply to: