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

Bug#865215: release-notes: Perform upgrades with apt(8) instead of apt-get(8)



Control: tags -1 patch moreinfo

Hi Julian,

On Mon, 19 Jun 2017 22:37:06 +0200 Julian Andres Klode <jak@debian.org>
wrote:
> Upgrades are really an interactive situation, and the apt tool should allow upgrades to go
> a bit more smoothly because it has the APT::Get::Upgrade-Allow-New default to true, allowing
> additional packages to be installed in the upgrade command.

I have replaced all references to apt-get by apt and added a note in the
section where we recommend apt. Can you please check that I didn't say
anything stupid and that all cases are supported?

Paul
From 4dd6344909cee5a8ed683f52c816ba3d6e8996b6 Mon Sep 17 00:00:00 2001
From: Paul Gevers <elbrus@debian.org>
Date: Fri, 15 Mar 2019 22:22:41 +0100
Subject: [PATCH] Replace apt-get by apt

Closes: #865215
---
 en/issues.dbk    |  4 ++--
 en/old-stuff.dbk |  4 ++--
 en/upgrading.dbk | 61 +++++++++++++++++++++++++++---------------------
 3 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/en/issues.dbk b/en/issues.dbk
index 4bf9b8dd..5f49a728 100644
--- a/en/issues.dbk
+++ b/en/issues.dbk
@@ -125,14 +125,14 @@ information mentioned in <xref linkend="morereading"/>.
     <title>Things to do post upgrade before rebooting</title>
     <!-- If there is nothing to do -->
     <para>
-      When <literal>apt-get dist-upgrade</literal> has finished, the
+      When <literal>apt dist-upgrade</literal> has finished, the
       <quote>formal</quote> upgrade is complete.  For the upgrade to
       &releasename;, there are no special actions needed before
       performing a reboot.
     </para>
     <!-- If there is something to do -->
     <para condition="fixme">
-      When <literal>apt-get dist-upgrade</literal> has finished, the <quote>formal</quote> upgrade
+      When <literal>apt 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>
diff --git a/en/old-stuff.dbk b/en/old-stuff.dbk
index 89207647..0a53d737 100644
--- a/en/old-stuff.dbk
+++ b/en/old-stuff.dbk
@@ -33,7 +33,7 @@ If any of the lines in your <filename>/etc/apt/sources.list</filename>
 refer to <quote><literal>stable</literal></quote>, it effectively
 points to &releasename; already. This might not be what you want if
 you are not ready yet for the upgrade.  If you have already run
-<command>apt-get update</command>, you can still get back without
+<command>apt update</command>, you can still get back without
 problems by following the procedure below.
 </para>
 <para>
@@ -75,7 +75,7 @@ to check for yourself if the location they refer to contains an
 If you've made any changes, save the file and execute
 </para>
 <screen>
-# apt-get update
+# apt update
 </screen>
 <para>
 to refresh the package list.
diff --git a/en/upgrading.dbk b/en/upgrading.dbk
index aa1f0b76..a93378c6 100644
--- a/en/upgrading.dbk
+++ b/en/upgrading.dbk
@@ -303,7 +303,7 @@ instructions in <xref linkend="old-upgrade"/>.
   recommended and the text below was mostly already there in 2008.
 </programlisting>
 <para>
-In some cases, the use of <command>apt-get</command> for installing packages
+In some cases, the use of <command>apt</command> for installing packages
 instead of <command>aptitude</command> might make <command>aptitude</command>
 consider a package as <quote>unused</quote> and schedule it for removal.  In general, you
 should make sure the system is fully up-to-date and <quote>clean</quote> before proceeding
@@ -371,7 +371,7 @@ essential for the upgrade is on hold, the upgrade will fail.
 </para>
 <para>
 Note that <command>aptitude</command> uses a different method for registering
-packages that are on hold than <command>apt-get</command> and
+packages that are on hold than <command>apt</command> and
 <command>dselect</command>.  You can identify packages on hold for
 <command>aptitude</command> with
 </para>
@@ -380,7 +380,7 @@ packages that are on hold than <command>apt-get</command> and
 </screen>
 <para>
 If you want to check which packages you had on hold for
-<command>apt-get</command>, you should use
+<command>apt</command>, you should use
 </para>
 <screen>
 # dpkg --get-selections | grep 'hold$'
@@ -391,7 +391,7 @@ epoch in the version, you must put it on hold to prevent it from being
 upgraded.
 </para>
 <para>
-The <quote>hold</quote> package state for <command>apt-get</command> can be changed using:
+The <quote>hold</quote> package state for <command>apt</command> can be changed using:
 </para>
 <screen>
 # echo <replaceable>package_name</replaceable> hold | dpkg --set-selections
@@ -617,8 +617,15 @@ database.
 <title>Upgrading packages</title>
 <para>
 The recommended way to upgrade from previous &debian; releases is to
-use the package management tool <command>apt-get</command>.
+use the package management tool <command>apt</command>.
 </para>
+<note>
+  <para>
+    <command>apt</command> is meant for interactive use, and should not be used
+    in scripts. In scripts one should use <command>apt-get</command>, which has
+    a stable output better suitable for parsing.
+  </para>
+</note>
 <para>
 Don't forget to mount all needed partitions (notably the root and
 <filename>/usr</filename> partitions) read-write, with a command like:
@@ -694,7 +701,7 @@ First the list of available packages for the new release needs to be fetched.
 This is done by executing:
 </para>
 <screen>
-# apt-get update
+# apt update
 </screen>
 </section>
 
@@ -717,12 +724,12 @@ sufficient space you might end up with an incomplete upgrade that is
 difficult to recover from.
 </para>
 <para>
-<command>apt-get</command> can show you detailed information about the disk
+<command>apt</command> can show you detailed information about the disk
 space needed for the installation.  Before executing the upgrade, you can see
 this estimate by running:
 </para>
 <screen>
-# apt-get -o APT::Get::Trivial-Only=true dist-upgrade
+# apt -o APT::Get::Trivial-Only=true dist-upgrade
 [ ... ]
 XXX upgraded, XXX newly installed, XXX to remove and XXX not upgraded.
 Need to get xx.xMB of archives. 
@@ -739,7 +746,7 @@ disk space.
 </note>
 
 <para>
-If you do not have enough space for the upgrade, <command>apt-get</command>
+If you do not have enough space for the upgrade, <command>apt</command>
 will warn you with a message like this:
 </para>
 <screen>
@@ -754,14 +761,14 @@ beforehand.  You can:
 <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> will remove all previously downloaded
+running <command>apt clean</command> will remove all previously downloaded
 package files.
 </para>
 </listitem>
 <listitem>
 <para>
 Remove forgotten packages.  If you have
-used <command>aptitude</command> or <command>apt-get</command> to manually
+used <command>aptitude</command> or <command>apt</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 redundant those packages
 pulled in by dependencies alone which are no longer needed due to a package
@@ -770,7 +777,7 @@ installed. To remove automatically installed packages that are no longer used,
 run:
 </para>
 <screen>
-# apt-get autoremove
+# apt autoremove
 </screen>
 <para>
 You can also use <command>deborphan</command>, <command>debfoster</command>, or
@@ -840,7 +847,7 @@ with.
 	remove the packages that have been previously downloaded for
 	installation:
 
-	<screen># apt-get clean</screen>
+	<screen># apt clean</screen>
       </para>
     </listitem>
     <listitem>
@@ -910,7 +917,7 @@ linkend="upgrading-full"/>.
 To do this, first run:
 </para>
 <screen>
-# apt-get upgrade
+# apt upgrade
 </screen>
 <para>
 This has the effect of upgrading those packages which can be upgraded without
@@ -938,7 +945,7 @@ Once you have taken the previous steps, you are now ready to continue
 with the main part of the upgrade.  Execute:
 </para>
 <screen>
-# apt-get dist-upgrade
+# apt dist-upgrade
 </screen>
 <para>
 This will perform a complete upgrade of the system, installing the newest
@@ -958,7 +965,7 @@ New versions of currently installed packages that cannot be upgraded without
 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>apt-get install
+trying <literal>apt install
 <replaceable>package</replaceable></literal>.
 </para>
 </section>
@@ -976,21 +983,21 @@ during an upgrade to &releasename;.
 <section id="immediate-configure">
 <title>Dist-upgrade fails with <quote>Could not perform immediate configuration</quote></title>
 <para>
-In some cases the <command>apt-get dist-upgrade</command> step can fail after
+In some cases the <command>apt dist-upgrade</command> step can fail after
 downloading packages with:
 <screen>
 E: Could not perform immediate configuration on '<replaceable>package</replaceable>'.  Please see man 5 apt.conf under APT::Immediate-Configure for details.
 </screen>
 </para>
 <para>
-If that happens, running <command>apt-get dist-upgrade -o
+If that happens, running <command>apt dist-upgrade -o
 APT::Immediate-Configure=0</command> instead should allow the upgrade
 to proceed.
 </para>
 <para>
 Another possible workaround for this problem is to temporarily add both
 &oldreleasename; and &releasename; sources to your
-<filename>sources.list</filename> and run <command>apt-get update</command>.
+<filename>sources.list</filename> and run <command>apt update</command>.
 </para>
 </section>
 
@@ -1014,15 +1021,15 @@ linkend="obsolete"/>.
 <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>apt-get</command> will alert you of this
+Conflicts/Pre-Depends loop.  <command>apt</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>apt-get</command> command
+APT::Force-LoopBreak=1</literal> on the <command>apt</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>apt-get</command> or
+<command>apt</command> or
 </para>
 <screen>
 # dpkg --remove <replaceable>package_name</replaceable>
@@ -1031,7 +1038,7 @@ require manual intervention.  Usually this means using
 to eliminate some of the offending packages, or
 </para>
 <screen>
-# apt-get -f install
+# apt -f install
 # dpkg --configure --pending
 </screen>
 <para>
@@ -1069,7 +1076,7 @@ on the <emphasis>last</emphasis> line of the error message:
 </screen>
 <para>
 After fixing things up, you should be able to resume the upgrade by repeating
-the previously described <command>apt-get</command> commands.
+the previously described <command>apt</command> commands.
 </para>
 
 </section>
@@ -1173,7 +1180,7 @@ available.  For example:
 # apt-cache show linux-image-amd64
 </screen>
 <para>
-You should then use <literal>apt-get install</literal> to install it.
+You should then use <literal>apt 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.  However, please have a look at <xref linkend="before-first-reboot" />
@@ -1241,12 +1248,12 @@ the packages to remove their configuration files.  See also
 # dpkg -l | awk '/^rc/ { print $2 }'
 </screen>
   <para>
-    The packages can be removed by using <command>apt-get
+    The packages can be removed by using <command>apt
     purge</command>.  Assuming you want to purge all of them
     in one go, you can use the following command:
   </para>
   <screen>
-# apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')
+# apt purge $(dpkg -l | awk '/^rc/ { print $2 }')
 </screen>
   <para>
     If you use <systemitem role="package">aptitude</systemitem>, you
-- 
2.20.1

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: