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

Re: Bug#411280: apt-get actually works (sometimes?) better than aptitude



On Wed, Aug 11, 2010 at 12:37:13AM +0900, Osamu Aoki wrote:
> So far, ease of "hold" feature of aptitude is the missing feature for
> apt-get command line.  Writing /etc/apt/preferences by hand to hold
> a package is quite cumbersome....  If "apt-get hold ..." creates a file
> in /etc/apt/preferences.d, maybe difference is smaller but this is not
> so important.

'aptitude hold' is mentioned several times in the release notes, so we won't
entirely eliminate mention of aptitude here.

However, for the most part apt-get is a much safer recommendation than
aptitude for dist-upgrades, so I've applied the attached patch to the
release-notes svn.  Corrections are welcome.  (Note that there are
particular steps involved in an upgrade from lenny to squeeze, such as
kernel+udev+bootloader manual handling, which are not yet documented here
and will need to be before release.)

> If you have time, please check my updated Debian Reference. I borrowed
> much of your idea.  I just do not want to have gross misunderstanding.

>   http://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_literal_apt_get_literal_literal_apt_cache_literal_vs_literal_aptitude_literal

> I did notice constant breakage of aptitude resolver. So I put them as
> following note for people to understand situation:

> Note

> Although the aptitude command comes with rich features such as its
> enhanced package resolver, this complexity had caused (or may still
> causes) some regressions such as Bug #411123, Bug #514930, and Bug
> #570377. In case of doubts, please use the apt-get and apt-cache
> commands over the aptitude command.

This looks good to me - thanks!

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org
=== modified file 'en/about.dbk'
--- en/about.dbk	2009-02-08 17:36:07 +0000
+++ en/about.dbk	2010-08-18 06:40:11 +0000
@@ -73,18 +73,18 @@
 <para>
 
 <programlisting condition="fixme">
-TODO: check status of #494028 about apt-get vs. aptitude
 TODO: any more things to add here?
 </programlisting>
 
 The status of your package database before and after the upgrade:
 <command>dpkg</command>'s status database available at
 <filename>/var/lib/dpkg/status</filename> and
-<command>aptitude</command>'s package state information, available at
-<filename>/var/lib/aptitude/pkgstates</filename>.  You should have
-made a backup before the upgrade as described at <xref
-linkend="data-backup"/>, but you can also find backups of this
-information in <filename>/var/backups</filename>.
+<systemitem role="package">apt</systemitem>'s package state information,
+available at <filename>/var/lib/apt/extended_states</filename>.  You
+should have made a backup before the upgrade as described at
+<xref linkend="data-backup"/>, but you can also find backups of
+<filename>/var/lib/dpkg/status</filename> in
+<filename>/var/backups</filename>.
 </para>
 </listitem>
 <listitem>

=== modified file 'en/upgrading.dbk'
--- en/upgrading.dbk	2009-09-18 19:25:30 +0000
+++ en/upgrading.dbk	2010-08-18 06:40:11 +0000
@@ -26,8 +26,10 @@
 <para>
 The main things you'll want to back up are the contents of
 <filename>/etc</filename>, <filename>/var/lib/dpkg</filename>,
-<filename>/var/lib/aptitude/pkgstates</filename> and the output of
-<literal>dpkg --get-selections "*"</literal> (the quotes are important).
+<filename>/var/lib/apt/extended_states</filename> and the output of
+<literal>dpkg --get-selections "*"</literal> (the quotes are important).  If
+you use <command>aptitude</command> to manage packages on your system, you
+will also want to back up <filename>/var/lib/aptitude/pkgstates</filename>.
 </para>
 <para>
 The upgrade process itself does not modify anything in the
@@ -325,13 +327,13 @@
 upgraded.
 </para>
 <para>
-The <quote>hold</quote> package state for <command>aptitude</command> can be changed using:
+The <quote>hold</quote> package state for <command>apt-get</command> can be changed using:
 </para>
 <screen>
-# aptitude hold <replaceable>package_name</replaceable>
+# echo <replaceable>package_name</replaceable> hold | dpkg --set-selections
 </screen>
 <para>
-Replace <literal>hold</literal> with <literal>unhold</literal> to unset the
+Replace <literal>hold</literal> with <literal>install</literal> to unset the
 <quote>hold</quote> state.
 </para>
 <para>
@@ -403,10 +405,12 @@
 <section id="handle-conflict">
 <title>Manually unmarking packages</title>
 <para>
-To prevent <command>aptitude</command> from removing some packages that were
+To prevent <command>apt-get</command> from removing some packages that were
 pulled in through dependencies, you need to manually unmark them as
 <emphasis>auto</emphasis> packages.  This includes OpenOffice and Vim for
-desktop installs:
+desktop installs.  <command>apt-get</command> does not provide an interface
+for marking or unmarking <emphasis>auto</emphasis> packages, so you will need
+to use <command>aptitude</command> for this:
 </para>
 <screen>
 # aptitude unmarkauto openoffice.org vim
@@ -585,9 +589,11 @@
 <title>Upgrading packages</title>
 <para>
 The recommended way to upgrade from previous &debian; releases is to
-use the package management tool <command>aptitude</command>.  This program
-makes safer decisions about package installations than running
-<command>apt-get</command> directly.
+use the package management tool <command>apt-get</command>.  In previous
+releases, <command>aptitude</command> was recommended for this purpose, but
+recent versions of <command>apt-get</command> provide equivalent
+functionality and also have shown to more consistently give the desired
+upgrade results.
 </para>
 <para>
 Don't forget to mount all needed partitions (notably the root and
@@ -660,13 +666,8 @@
 This is done by executing:
 </para>
 <screen>
-# aptitude update
+# apt-get update
 </screen>
-<para>
-Running this the first time new sources are updated will print out some
-warnings related to the availability of the sources.  These warnings are
-harmless and will not appear if you rerun the command again.
-</para>
 </section>
 
 <section id="sufficient-space">
@@ -688,12 +689,12 @@
 difficult to recover from.
 </para>
 <para>
-Both <command>aptitude</command> and <systemitem role="package">apt</systemitem> will show you
-detailed information of the disk space needed for the installation.  Before
-executing the upgrade, you can see this estimate by running:
+<command>aptitude</command> can show you detailed information of the disk
+space needed for the installation.  Before executing the upgrade, you can see
+this estimate by running:
 </para>
 <screen>
-# aptitude -y -s -f --with-recommends dist-upgrade
+# aptitude -y -s -f dist-upgrade
 [ ... ]
 XXX upgraded, XXX newly installed, XXX to remove and XXX not upgraded.
 Need to get xx.xMB/yyyMB of archives. After unpacking AAAMB will be used.
@@ -718,8 +719,8 @@
 <para>
 Remove packages that have been previously downloaded for installation (at
 <filename>/var/cache/apt/archives</filename>).  Cleaning up the package cache by
-running <command>apt-get clean</command> or <command>aptitude clean</command>
-will remove all previously downloaded package files.
+running <command>apt-get clean</command> will remove all previously downloaded
+package files.
 </para>
 </listitem>
 <listitem>
@@ -894,7 +895,7 @@
 <title>Minimal system upgrade</title>
 <para>
 Because of certain necessary package conflicts between &oldreleasename; and &releasename;, running
-<literal>aptitude dist-upgrade</literal> directly will often remove large
+<literal>apt-get dist-upgrade</literal> directly will often remove large
 numbers of packages that you will want to keep.  We therefore recommend a
 two-part upgrade process, first a minimal upgrade to overcome these conflicts,
 then a full <literal>dist-upgrade</literal>.
@@ -903,7 +904,7 @@
 First, run:
 </para>
 <screen>
-# aptitude safe-upgrade
+# apt-get upgrade
 </screen>
 <para>
 This has the effect of upgrading those packages which can be upgraded without
@@ -981,7 +982,7 @@
 You are now ready to continue with the main part of the upgrade.  Execute:
 </para>
 <screen>
-# aptitude dist-upgrade
+# apt-get dist-upgrade
 </screen>
 <para>
 This will perform a complete upgrade of the system, i.e.  install the newest
@@ -1001,7 +1002,7 @@
 changing the install status of another package will be left at their current
 version (displayed as <quote>held back</quote>).  This can be resolved by either using
 <command>aptitude</command> to choose these packages for installation or by
-trying <literal>aptitude -f install
+trying <literal>apt-get -f install
 <replaceable>package</replaceable></literal>.
 </para>
 </section>
@@ -1015,7 +1016,7 @@
 checking mechanism:
 </para>
 <screen>
-# aptitude update
+# apt-get update
 </screen>
 <para>
 The upgrade will have already retrieved and enabled the signing keys for
@@ -1052,15 +1053,15 @@
 <para>
 Sometimes it's necessary to enable the <literal>APT::Force-LoopBreak</literal>
 option in APT to be able to temporarily remove an essential package due to a
-Conflicts/Pre-Depends loop.  <command>aptitude</command> will alert you of this
+Conflicts/Pre-Depends loop.  <command>apt-get</command> will alert you of this
 and abort the upgrade.  You can work around this by specifying the option <literal>-o
-APT::Force-LoopBreak=1</literal> on the <command>aptitude</command> command
+APT::Force-LoopBreak=1</literal> on the <command>apt-get</command> command
 line.
 </para>
 <para>
 It is possible that a system's dependency structure can be so corrupt as to
 require manual intervention.  Usually this means using
-<command>aptitude</command> or
+<command>apt-get</command> or
 </para>
 <screen>
 # dpkg --remove <replaceable>package_name</replaceable>
@@ -1069,7 +1070,7 @@
 to eliminate some of the offending packages, or
 </para>
 <screen>
-# aptitude -f install
+# apt-get -f install
 # dpkg --configure --pending
 </screen>
 <para>
@@ -1101,7 +1102,7 @@
 </screen>
 <para>
 After fixing things up, you should be able to resume the upgrade by repeating
-the previously described <command>aptitude</command> commands.
+the previously described <command>apt-get</command> commands.
 </para>
 <para>
 During the upgrade, you will be asked questions regarding the configuration or
@@ -1168,7 +1169,7 @@
 # apt-cache show linux-image-2.6-686
 </screen>
 <para>
-You should then use <literal>aptitude install</literal> to install it.  Once
+You should then use <literal>apt-get install</literal> to install it.  Once
 this new kernel is installed you should reboot at the next available
 opportunity to get the benefits provided by the new kernel version.
 </para>
@@ -1279,7 +1280,7 @@
 <section id="nownownow">
 <title>Things to do before rebooting</title>
 <para>
-When <literal>aptitude dist-upgrade</literal> has finished, the <quote>formal</quote> upgrade
+When <literal>apt-get dist-upgrade</literal> has finished, the <quote>formal</quote> upgrade
 is complete, but there are some other things that should be taken care of
 <emphasis>before</emphasis> the next reboot.
 </para>
@@ -1803,15 +1804,19 @@
 provides a similar section but the listing it presents might differ.
 </para>
 <para>
-Also, if
-you have used <command>aptitude</command> to manually install packages in &oldreleasename;
+Also, if you have used <command>aptitude</command> or
+<command>apt-get</command> to manually install packages in &oldreleasename;
 it will have kept track of those packages you manually installed and will be
 able to mark as obsolete those packages pulled in by dependencies alone which
-are no longer needed if a package has been removed.  Also,
-<command>aptitude</command>, unlike <command>deborphan</command> will not mark
-as obsolete packages that you manually installed, as opposed to those that were
-automatically installed through dependencies.
-</para>
+are no longer needed if a package has been removed.
+<command>aptitude</command> and <systemitem role="package">apt</systemitem>,
+unlike <command>deborphan</command>, will not mark for removal packages that
+you manually installed, as opposed to those that were automatically
+installed through dependencies.  To remove automatically installed packages
+that are no longer used, run:
+<screen>
+# apt-get autoremove
+</screen>
 <para>
 There are additional tools you can use to find obsolete packages such as
 <command>deborphan</command>, <command>debfoster</command> or

=== modified file 'en/whats-new.dbk'
--- en/whats-new.dbk	2009-08-23 20:03:32 +0000
+++ en/whats-new.dbk	2010-08-18 06:40:11 +0000
@@ -327,24 +327,13 @@
 <section id="pkgmgmt">
 <title>Package management</title>
 
-<programlisting condition="fixme">
-TODO: is aptitude always prefered over apt-get?
-</programlisting>
-
-<para>
-The preferred program for package management from the command line is
-<command>aptitude</command>, which can perform the same package
-management functions as <command>apt-get</command> and has proven to be
-better at dependency resolution. If you are still using
-<command>dselect</command>, you should switch to <systemitem
-role="package">aptitude</systemitem> as the official front-end for package
-management.
-</para>
-<para>
-For &releasename; an advanced conflict resolving mechanism has been
-implemented in <command>aptitude</command> that will try to find the
-best solution if conflicts are detected because of changes in
-dependencies between packages.
+<para>
+The preferred program for interactive package management from a terminal is
+<command>aptitude</command>.  For a non-interactive command line interface
+for package management, it is recommended to use <command>apt-get</command>.
+If you are still using <command>dselect</command>, you should switch to
+<systemitem role="package">aptitude</systemitem> as the official front-end
+for package management.
 </para>
 
 <programlisting condition="fixme">
@@ -381,7 +370,7 @@
   <programlisting>deb     &url-debian-mirror-eg;/debian &releasename;-proposed-updates main contrib
 deb-src &url-debian-mirror-eg;/debian &releasename;-proposed-updates main contrib</programlisting>
   <para>
-    The next time you run <command>aptitude update</command>, the
+    The next time you run <command>apt-get update</command>, the
     system will become aware of the packages in the
     <literal>proposed-updates</literal> section and will consider them
     when looking for packages to upgrade.
@@ -418,7 +407,7 @@
 using:
 </para>
 <screen>
-# aptitude install selinux-basics
+# apt-get install selinux-basics
 </screen>
 <para>
 Note that SELinux support is <emphasis>not</emphasis> enabled by default.

Attachment: signature.asc
Description: Digital signature


Reply to: