Be Aware of Important - Kali Linux Revealed

Be Aware of Important
Changes
To anticipate some of these problems, you can install the
apt-listchanges
package,
which displays information about possible problems at the beginning of a pack-
age upgrade. This information is compiled by the package maintainers and put in
/usr/share/doc/
package
/NEWS.Debian
files for your benefit. Reading these files
(possibly through
apt-listchanges
) should help you avoid nasty surprises.
Since becoming a rolling distribution, Kali can receive upgrades several times a day. However,
that might not be the best strategy. So, how often should you upgrade Kali Linux? There is no
hard rule but there are some guidelines that can help you. You should upgrade:
• When you are aware of a security issue that is fixed in an update.
• When you suspect that an updated version might fix a bug that you are experiencing.
• Before reporting a bug to make sure it is still present in the latest version that you have
available.
• Often enough to get the security fixes that you have not heard about.
There are also cases where it is best to not upgrade. For example, it might not be a good idea to
upgrade:
• If you can’t afford any breakage (for example, because you go offline, or because you are
about to give a presentation with your computer); it is best to do the upgrade later, when
you have enough time to troubleshoot any issue introduced in the process.
• If a disruptive change happened recently (or is still ongoing) and you fear that all issues
have not yet been discovered. For example, when a new GNOME version is released, not all
185
Chapter 8 — Debian Package Management
packages are updated at the same time and you are likely to have a mix of packages with
the old version and the new version. Most of the time this is fine and it helps everybody to
release those updates progressively, but there are always exceptions and some applications
might be broken due to such discrepancies.
• If the
apt full-upgrade
output tells you that it will remove packages that you consider
important for your work. In those cases, you want to review the situation and try to under-
stand why
apt
wants to remove them. Maybe the packages are currently broken and in this
case you might want to wait until fixed versions are available, or they have been obsoleted
and you should identify their replacements and then proceed with the full upgrade anyway.
In general, we recommend that you upgrade Kali at least once a week. You can certainly upgrade
daily but it doesn’t make sense to do it more often than that. Even if our mirrors are synchronized
four times a day, the updates coming from Debian usually land only once a day.
8.2.4. Removing and Purging Packages
Removing a package is even simpler than installing one. Let’s take a look at how to remove a
package with
dpkg
and
apt
.
To remove a package with
dpkg
, supply the -r or --remove option, followed by the name of a pack-
age. This removal is not, however, complete: all of the configuration files, maintainer scripts, log
files (system logs), data generated by the service (such as the content of an LDAP server directory
or the content of a database for an SQL server), and most other user data handled by the pack-
age remain intact. The remove option makes it easy to uninstall a program and later re-install it
with the same configuration. Also remember that dependencies are not removed. Consider this
example:
# dpkg --remove kali-tools-gpu
(Reading database ... 108172 files and directories currently installed.)
Removing kali-tools-gpu (2021.1.0) ...
You can also remove packages from the system with
apt remove package
. APT will automatically
delete the packages that depend on the package that is being removed. Like the
dpkg
example,
configuration files and user data will not be removed.
Through the addition of suffixes to package names, you can use
apt
(or
apt-get
and
aptitude
)
to install certain packages and remove others on the same command line. With an
apt install
command, add “-” to the names of the packages you wish to remove. With an
apt remove
com-
mand, add “+” to the names of the packages you wish to install.
The next example shows two different ways to install package1 and to remove package2.
# apt install package1 package2-
[...]
# apt remove package1+ package2
186
Kali Linux Revealed
[...]
This can also be used to exclude packages that would otherwise be installed, for example due to
a Recommends (discussed later in section
8.4.1.3
, “
Recommends, Suggests, and Enhances Fields
”
[page 214]). In general, the dependency solver will use that information as a hint to look for alter-
native solutions.
To remove all data associated with a package, you can purge the package with the
dpkg -P
|