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

Re: Total confusion with aptitude. Help, please!



On Fri, Jun 20, 2008 at 02:44:58PM +0000, Alan Mackenzie <acm@muc.de> was heard to say:
> On Thu, Jun 19, 2008 at 07:57:45PM -0700, Daniel Burrows wrote:
> > On Thu, Jun 19, 2008 at 07:22:24PM +0000, Alan Mackenzie <acm@muc.de> was heard to say:
> 
> > >     #Broken: 12  Will free 16.7MB of disk space DL Size: 6215kB
> 
> > > .  Using the aptitude command `find broken', it reports, amongst others,
> > > vim as being broken, giving as further details:
> 
> > >   * vim depends on libc6 (>= 2.3.6-6)
> > >   * vim depends on libncurses5 (>= 5.4-5)
> > >   * vim depends on vim-runtime (= 1:7.0-122+1etch3)
> 
> > > However, vim works just fine (I'm using it to write this email).
> 
> >   First possible problem: aptitude uses "broken" as a shorthand for
> > "broken *after I apply what you've told me to do*".
> 
> Ah!  Thanks!

  Just to be a little more clear, you can find out exactly what aptitude
thinks by examining the status flags on the left-hand side of the package
list.  Normally packages have flags like this:

pi  package-name ...

  The two characters on the left say what the current (p) and planned (i)
states of the package are.  "p" here is for "purged" and "i" is for
"installed".  You can find a complete list in the online help; of
particular interest for you is the "B" state, "broken".  I bet that the
flags on "vim" were something like:

iB  vim ...

  which means that vim is currently installed, and will be broken by the
current set of planned actions.

> [ .... ]
> 
> > > #########################################################################
> 
> > > So, I try to update aptitude itself (this will surely help me with my
> > > other problems ;-).  To begin with, I start aptitude, and type ":" on
> > > each of the 8 lines ("--- Security Updates", ....., "--- Tasks") in the
> > > hope of clearing out dross.
> 
> >   btw, to upgrade just aptitude it might be easier to run
> > "aptitude install aptitude".
> 
> OK.  But I'm a coward.  Where in all the documentation would I find a
> statement that doing this won't irreversibly hose my system, especially
> when I'm scared that it's already in a fragile, possibly inconsistent
> state?

  I don't know if it's explicitly stated, but aptitude prompts if it has
to take any actions that you didn't ask for.  But if you don't trust it
(and I couldn't blame you at this point), you can always run it as a
non-root user and pass the "-s" flag to see what it would do.

> What, exactly, does "install" mean?

  "install" means "install the current candidate version of the
package".  It doesn't do anything else (other pending actions stored in
the state file are ignored).

  Now more information than you probably want. ;-)

  In the apt universe, there are three main versions of a package: the
"current version", which is currently installed, the "candidate version",
which is what would be installed if you asked for a package, and the
"install version", the version that is going to be installed by any
pending action.  Normally the install version is either the current or
the candidate version.

  In other words, you might have something like

               current version       candidate version       other versions
aptitude       0.2.15.3              0.4.4                   0.4.11.5, 0.5.0
                   ^
	           |
	           |
	     install version

  The candidate version, btw, is chosen according to your current local
policy and preferences (see apt_preferences(5)).

  "Installing" aptitude, in apt lingo, would mean changing the install
to point at version 0.4.4.  Once the install was complete, both the
current and the candidate version would be 0.4.4.

  (I hope that's right, because it's the mental model I use. :-) )

> These aren't rhetorical questions.  I've looked in the aptitude man
> page (sarge version from 2005).  This is something I dislike about
> package managers - they demand complete trust on an all-or-nothing
> basis.  Or have I missed something?  What I would like is
> "test-download" facility that would prompt me for a directory, and
> put the new version of the package there WITHOUT TOUCHING MY CURRENT
> SETUP.  I could then make sure it works properly before committing
> myself to an irreversible and potentially catastrophic update.

  There are a couple things you could try:

    (a) set up a chroot and install the new aptitude there to convince
        yourself it works.
    (b) use a checkpointing facility if your filesystem supports it.
        e.g., if you have free extents you can run lvcreate --snapshot.

  I don't think these are very practical, though.  There isn't really a
good way to install packages into custom locations, though, or to roll
back entire systems (other than LVM snapshots, which I should add I've
never actually used).  My personal experience, though, is that the
Debian package management tools are very reliable and provide ample
opportunities to recover the situation on the occasions that something
does go wrong.

> > Is there a reason you're still using sarge?
> 
> <rant mode>
> Yes.  Installing Debian is (was?) so painful that I really can't face the
> drudgery again at the moment.  I've only had about 2 years use out of
> sarge so far.

  I'm sorry it was such a pain.  (rest of rant snipped)

> In the real world, nobody I know has got any sort of GNU/Linux installed
> and working in a few days.  Most have tried and given up after a weekend
> or two, going back to a Microsoft system.  Those few who have managed
> have, like me, endured weeks of drudgery.  Only on internet blogs do I
> read "Wow!" reports about how it works perfectly an hour and a half after
> inserting the installation DVD.

  Well, my first Debian installation was from a pile of floppies, so I'm
not going to be able to comment intelligently on how hard or easy today's
process is.

> > What happens if you just run "aptitude install python2.4", out of
> > curiosity?

  (note: as with "aptitude install aptitude", I was mostly curious about
the prompt you get, not about how the installation proceeds once you
kick it off)

> Might it possibly leave programs written in Python non-working?  Is
> aptitude itself, or are any of the other package tools written in python?

  Debian generally allows multiple python versions to be installed at
once.  Some Python programs might be buggy and use #!/usr/bin/python
when they really need pre-2.4 versions, though.

  aptitude isn't written in Python, nor is anything underneath it (i.e.,
dpkg).  There may be maintainer scripts written in Python, but those
packages will declare a Python dependency.

  Daniel


Reply to: