What are all the apt command-line commands and options?
I know they think that they are being helpful, but in fact they are being quite the opposite here in the apt --help
and manpage:
Much like apt itself, its manpage is intended as an end user interface and as such only mentions the most used commands and options partly to not duplicate information in multiple places and partly to avoid overwhelming readers with a cornucopia of options and details.
So basically in other words they only list a few of the commands and options and give you no idea about how to find out the rest which is greatly unhelpful if I am to use this tool.
So what are all the commands and options that they feel they are being 'helpful' not to provide, what are their details and usage, and how can I keep up-to-date with this information if they do not provide it officially? Or perhaps that has changed now and they are listed somewhere?
I am running Ubuntu GNOME 16.04 with GNOME 3.20.
Solution 1:
Please improve this wiki and add your favourite apt commands :)
apt changelog PACKAGE_NAME
The above cmd. hows the changelog history for the specified package in reverse date order (newest first) in less
format, pulled from changelogs.ubuntu.com
apt full-upgrade
(requires root privilege) a new name for apt-get dist-upgrade
- see man apt-get
:
dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages.
apt search PACKAGE_NAME
Almost the same as apt-cache search
but with prettified output - line-spaced and coloured for easier reading:
search performs a full text search on all available package lists for the POSIX regex pattern given. It searches the package names and the descriptions for an occurrence of the regular expression and prints out the package name and the short description, including virtual package names.
Solution 2:
From the apt(8)
manual page:
SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
The apt(8) commandline is designed as an end-user tool and it may change
behavior between versions. While it tries not to break backward
compatibility this is not guaranteed either if a change seems beneficial
for interactive use.
All features of apt(8) are available in dedicated APT tools like apt-get(8)
and apt-cache(8) as well. apt(8) just changes the default value of some
options (see apt.conf(5) and specifically the Binary scope). So you should
prefer using these commands (potentially with some additional options
enabled) in your scripts as they keep backward compatibility as much as
possible.
My understanding of what this means is that apt
is to be used with the options shown in the man page and other apt tools such as apt-get(8)
or apt-cache(8)
have additional options and functionality available to the end user.