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

Re: debian-faq: Patch4 to change apt-get / apt-cache into apt



Hi,

Holger Wansing <linux@wansing-online.de> wrote:
> Should we add a table which lists all the new apt commands and their old
> apt-get / apt-cache variants in comparison?
> Maybe that would make sense, since you are not always done with simply
> replacing "apt-get" with "apt". There are cases, which are not that intuitive:
> as an example, "apt-cache showpkg <name>" converts into "apt show -a <name>".

I have added a table with the changings in comparison.


Included in the attached patch.


Holger

-- 
============================================================
Created with Sylpheed 3.5.0 under
	D E B I A N   L I N U X   8 . 0   " J E S S I E " .

Registered Linux User #311290 - https://linuxcounter.net/
============================================================
Index: choosing.sgml
===================================================================
--- choosing.sgml	(Revision 11106)
+++ choosing.sgml	(Arbeitskopie)
@@ -336,7 +336,7 @@
 system running mixed distributions.
 
 <p>It might be best in some situations to just fully upgrade to the new
-distribution running <prgn>apt-get dist-upgrade</prgn>, <prgn>aptitude
+distribution running <prgn>apt full-upgrade</prgn>, <prgn>aptitude
 safe-upgrade</prgn> or <prgn>aptitude full-upgrade</prgn>. Read
 apt's and aptitude's manual pages for more information.
 
Index: pkgtools.sgml
===================================================================
--- pkgtools.sgml	(Revision 11106)
+++ pkgtools.sgml	(Arbeitskopie)
@@ -72,6 +72,33 @@
 <tt>/usr/share/doc/apt-doc/guide.html/index.html</tt> (you will have to install
 the <tt>apt-doc</tt> package).
 
+<p>Starting with Debian Jessie, some frequently used
+<prgn/apt-get/ and <prgn/apt-cache/ commands got an equivalent via
+the new <prgn/apt/ binary. This means some popular commands like
+<prgn/apt-get update/, <prgn/apt-get install/, <prgn/apt-get remove/,
+<prgn/apt-cache search/, or <prgn/apt-cache show/ now can also be called
+simply via <prgn/apt/, say <prgn/apt update/, <prgn/apt install/,
+<prgn/apt remove/, <prgn/apt search/, or <prgn/apt show/. 
+The following is an overview of the old and new commands:
+
+<example>
+ apt-get update             ->  apt update/
+ apt-get upgrade            ->  apt upgrade/
+ apt-get dist-upgrade       ->  apt full-upgrade/
+ apt-get install package    ->  apt install package/
+ apt-get remove package     ->  apt remove package/
+ apt-get autoremove         ->  apt autoremove/
+ apt-cache search string    ->  apt search string/
+ apt-cache policy package   ->  apt list -a package/
+ apt-cache show package     ->  apt show package/
+ apt-cache showpkg package  ->  apt show -a package/
+</example>
+
+<p>The <prgn/apt/ tool merges functionality of apt-get and apt-cache;
+and by default has a fancier colored output format, making it more
+pleasant for humans. For usage in scripts or advanced use cases, 
+apt-get is still preferable or needed.
+
 <p><prgn/apt-get/ provides a simple way to
 retrieve and install packages from multiple sources using the command
 line.  Unlike <prgn/dpkg/, <prgn/apt-get/ does not understand .deb
@@ -89,30 +116,34 @@
 
 <list>
        <item>To update the list of package known by your system, you can run:
-               <example>apt-get update</example>
+               <example>apt update</example>
        (you should execute this regularly to update your package lists)
 
        <item>To install the <var/foo/ package and all its dependencies, run:
-               <example>apt-get install foo</example>
+               <example>apt install foo</example>
 
        <item>To remove the foo package from your system, run:
-               <example>apt-get remove foo</example>
+               <example>apt remove foo</example>
 
        <item>To remove the foo package and its configuration files from your
              system, run:
-               <example>apt-get purge foo</example>
+               <example>apt purge foo</example>
 
+       <item>To list all packages, for which newer package versions are
+             available, run:
+               <example>apt list --upgradable</example>
+
        <item>To upgrade all the packages on your system (without installing
              extra packages or removing packages), run:
-               <example>apt-get upgrade</example>
+               <example>apt upgrade</example>
 
        <item>To upgrade all the packages on your system, and, if needed for a
              package upgrade, installing extra packages or removing packages, run:
-               <example>apt-get dist-upgrade</example>
+               <example>apt full-upgrade</example>
              (The command <tt>upgrade</tt> keeps a package at its installed
              obsolete version if upgrading would need an extra package to be
              installed, for a new dependency to be satisfied. The
-             <tt>dist-upgrade</tt> command is less conservative.)
+             <tt>full-upgrade</tt> command is less conservative.)
 
 </list>
 
@@ -131,10 +162,10 @@
 
 <list>
        <item>To find packages whose description contain <var/word/:
-               <example>apt-cache search <var>word</var></example>
+               <example>apt search <var>word</var></example>
 
        <item>To print the detailed information of a package:
-               <example>apt-cache show <var>package</var></example>
+               <example>apt show <var>package</var></example>
 
        <item>To print the packages a given package depends on:
                <example>apt-cache depends <var>package</var></example>
@@ -148,6 +179,7 @@
 
 
 <p>For more information, install the <package/apt/ package and read
+<manref name="apt" section="8">,
 <manref name="apt-get" section="8">, <manref name="sources.list" section="5">
 and install the  <package/apt-doc/ package and read
 <file>/usr/share/doc/apt-doc/guide.html/index.html</file>.
Index: uptodate.sgml
===================================================================
--- uptodate.sgml	(Revision 11106)
+++ uptodate.sgml	(Arbeitskopie)
@@ -31,12 +31,15 @@
 To deal with this avalanche, many people prefer to use a more automated
 method.  Several different packages are available for this purpose:
 
-<sect1 id="aptitude-upgrade">aptitude
+<sect1 id="apt-upgrade">apt-get and apt-cdrom
 
-<p><prgn/aptitude/ is the recommended package manager for &debian; systems, and
-is described in <ref id="aptitude">.
+<p><prgn/apt-get/ is the recommended package manager for &debian; systems, which is an
+APT-based command-line tool (described previously in <ref id="apt-get">).
 
-<p>Before you can use <prgn/aptitude/ to make an upgrade, you'll have to edit the
+<p><prgn/apt-get/, the APT-based command-line tool for handling packages,
+provides a simple, safe way to install and upgrade packages.
+
+<p>Before you can use <prgn/apt-get/ to make an upgrade, you'll have to edit the
 <tt>/etc/apt/sources.list</tt> file to set it up.  If you wish to upgrade to
 the latest stable version of Debian, you'll probably want to use a source like
 this one:
@@ -44,12 +47,41 @@
 <example>http://ftp.us.debian.org/debian stable main contrib non-free</example>
 
 <p>You can replace ftp.us.debian.org (the mirror in the United States) with the
-name of a faster Debian mirror near you. See the mirror list at
+name of a faster Debian mirror near by you. See the mirror list at
 <url id="http://www.debian.org/mirror/list";> for more information.
 
 <p>More details on this can be found in the <manref name="sources.list"
 section="5"> manual page.
 
+<p>Then run
+      <example>apt-get update</example>
+      resp. <example>apt update</example>
+followed by
+      <example>apt-get dist-upgrade</example>
+      resp. <example>apt full-upgrade</example>
+Answer any questions that might come up, and your system will be upgraded.
+See also the <manref name="apt-get" section="8"> manual page, as well
+as <ref id="apt-get">.
+
+<p>If you want to use CDs/DVDs/BDs to install packages, you can use <prgn/apt-cdrom/.
+For details, please see the Release Notes, section "Adding APT sources from
+optical media".
+
+<p>Please note that when you get and install the packages, you'll still have
+them kept in your /var directory hierarchy. To keep your partition from
+overflowing, remember to delete extra files using <tt>apt-get clean</tt> and
+<tt>apt-get autoclean</tt>, or to move them someplace else (hint: use
+<package/apt-move/).
+
+<sect1 id="aptitude-upgrade">aptitude
+
+<p>An alternative to <prgn/apt-get/ is <prgn/aptitude/ which
+is described in <ref id="aptitude">.
+
+<p>To use <prgn/aptitude/, edit the
+<tt>/etc/apt/sources.list</tt> file to set it up, just as for <ref
+id="apt-upgrade">.
+
 <p>To update your system in command line, run
       <example>aptitude update</example>
 followed by
@@ -68,36 +100,6 @@
 <p>For details, see the manual page <manref name="aptitude" section="8">,
 and the file <file>/usr/share/aptitude/README</file>.
 
-<sect1 id="apt">apt-get and apt-cdrom
-
-<p>An alternative to <prgn/aptitude/ is <prgn/apt-get/ which is an
-APT-based command-line tool (described previously in <ref id="apt-get">).
-
-<p><prgn/apt-get/, the APT-based command-line tool for handling packages,
-provides a simple, safe way to install and upgrade packages.
-
-<p>To use <prgn/apt-get/, edit the
-<tt>/etc/apt/sources.list</tt> file to set it up, just as for <ref
-id="aptitude-upgrade">.
-
-<p>Then run
-      <example>apt-get update</example>
-followed by
-      <example>apt-get dist-upgrade</example>
-Answer any questions that might come up, and your system will be upgraded.
-See also the <manref name="apt-get" section="8"> manual page, as well
-as <ref id="apt-get">.
-
-<p>If you want to use CDs/DVDs/BDs to install packages, you can use <prgn/apt-cdrom/.
-For details, please see the Release Notes, section "Adding APT sources from
-optical media".
-
-<p>Please note that when you get and install the packages, you'll still have
-them kept in your /var directory hierarchy. To keep your partition from
-overflowing, remember to delete extra files using <tt>apt-get clean</tt> and
-<tt>apt-get autoclean</tt>, or to move them someplace else (hint: use
-<package/apt-move/).
-
 <sect1 id="mirror">mirror
 
 <p>This Perl script, and its (optional) manager program called

Reply to: