If it is already known the bug report and the associated messages are usually

If it is already known the bug report and the

This preview shows page 2 - 4 out of 4 pages.

instructions). If it is already known, the bug report and the associated messages are usually an excellent source of information related to the bug. In some cases, a patch already exists and has been made available in the bug report itself; you can then recompile a fixed version of the broken package locally (see section 9.1, “Modifying Kali Packages” [page 222]). In other cases, users may have found a workaround for the problem and shared their insights about it in their replies to the report; those instructions may help you work around the problem until a fix or patch is released. In a best-case scenario, the package may have already been fixed and you may find details in the bug report. 3 4 Chapter 8 — Debian Package Management 187 Downgrading to a Working Version When the problem is a clear regression (where the former version worked), you can try to downgrade the package. In this case, you will need a copy of the old version. If you have access to the old version in one of the repositories configured in APT, you can use a simple one- liner command to downgrade (see section, “Installing Packages with APT” [page 177]). But with Kali’s rolling release, you will usually only find a single version of each package at any one time. You can still try to find the old .deb file and install it manually with dpkg. Old .deb files can be found in multiple places: • in APT’s cache in /var/cache/apt/archives/ • in the pool directory on your usual Kali mirror (removed and obsolete packages are kept for three to four days to avoid problems with users not having the latest package indices) • in if the affected package was provided by Debian and not by Kali; this service keeps historical versions of all Debian packages Dealing with Broken Maintainer Scripts Sometimes the upgrade gets interrupted because one of the package maintainer scripts fails (usually, it is the postinst). In those cases, you can try to diagnose the problem, and possibly work around it, by editing the problematic script. Here we rely on the fact that maintainer scripts are stored in /var/lib/dpkg/info/ and that we can review and modify them. Since maintainer scripts are usually simple shell scripts, it is possible to add a set -x line just after the shebang line and arrange them to be rerun (with dpkg --configure -a for postinst) to see precisely what is happening and where it is failing. This output can also nicely complement any bug report that you might file. With this newly gained knowledge, you can either fix the underlying problem or transform the failing command into a working one (for example by adding || true at the end of the line). Note that this tip does not work for a
Image of page 2
failing preinst since that script is executed even before the package gets installed so it is not yet in its final location. It does work for postrm and prerm although you will need to execute a package removal (respectively upgrade) to trigger them. The dpkg Log File The dpkg tool keeps a log of all of its actions in /var/log/dpkg.log. This log is extremely verbose, since it details all the stages of each package. In
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 4 pages?

  • Summer '16
  • nushawan
  • Debian, Dpkg, Advanced Packaging Tool

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes