How to verify the MD5 of the Debian Software Package

Source: Internet
Author: User

How to verify the MD5 of the Debian Software Package
GuideWhen downloading a software package, you may face these problems: unstable network connection or sudden power failure, which may cause damage to the installed software package. This article will guide you how to generate an MD5 checksum in Linux and use it to verify the file.

How to verify installed Debian software packages against MD5 checksum

On the Debian/Ubuntu system, you can use the debsums tool to verify the MD5 and. If you want to know about the debsums package before installation, you can use APT-CACHE, just like this:

apt-cache search debsums

Next, use the apt command to install it, as shown below:

sudo apt install debsums

Now you can learn how to use the debsums tool to verify the MD5 sum of installed software packages.

Note: sudo is used in all the commands below, because normal users may not have the permission to read some files.

In addition, the output from the debsums command shows the file location on the left and the inspection result on the right. You will get three possible results, including:

  • ·OKDD indicates that the MD5 value of a file is good.
  • ·FAILEDDD indicates that the MD5 of a file does not match.
  • · REPLACEDDD indicates that a specific file has been replaced by a file from another software package.

If you do not need any options for running, debsums will verify each file on the system against the conventional md5sum file, scan the file system, find MD5 and

  1. /Usr/bin/a11y-profile-manager-indicatorOK
  2. /Usr/share/doc/a11y-profile-manager-indicator/copyrightOK
  3. /Usr/share/man/man1/a11y-profile-manager-indicator.1.gzOK
  4. /Usr/share/accounts/providers/facebook. providerOK
  5. /Usr/share/accounts/qml-plugins/facebook/Main. qmlOK
  6. /Usr/share/accounts/services/facebook-microblog.serviceOK
  7. /Usr/share/accounts/services/facebook-sharing.serviceOK
  8. /Usr/share/doc/account-plugin-facebook/copyrightOK
  9. /Usr/share/accounts/providers/flickr. providerOK
  10. /Usr/share/accounts/qml-plugins/flickr/Main. qmlOK
  11. /Usr/share/accounts/services/flickr-microblog.serviceOK
  12. /Usr/share/accounts/services/flickr-sharing.serviceOK
  13. /Usr/share/doc/account-plugin-flickr/copyrightOK
  14. /Usr/share/accounts/providers/google. providerOK
  15. /Usr/share/accounts/qml-plugins/google/Main. qmlOK
  16. /Usr/share/accounts/services/google-drive.serviceOK
  17. /Usr/share/accounts/services/google-im.serviceOK
  18. /Usr/share/accounts/services/picasa. serviceOK
  19. /Usr/share/doc/account-plugin-google/copyrightOK
  20. /Lib/systemd/system/accounts-daemon.serviceOK
  21. /Usr/lib/accountsservice/accounts-daemonOK
  22. /Usr/share/dbus-1/interfaces/org. freedesktop. Accounts. User. xmlOK
  23. /Usr/share/dbus-1/interfaces/org. freedesktop. Accounts. xmlOK
  24. /Usr/share/dbus-1/system-services/org. freedesktop. Accounts. serviceOK
  25. /Usr/share/doc/accountsservice/READMEOK
  26. /Usr/share/doc/accountsservice/TODOOK
  27. ....

To verify each file and configuration file of each software package and find any changes, add the-a or -- all option:

sudo debsums --all

Verify the MD5 and:

  1. /Usr/bin/a11y-profile-manager-indicatorOK
  2. /Usr/share/doc/a11y-profile-manager-indicator/copyrightOK
  3. /Usr/share/man/man1/a11y-profile-manager-indicator.1.gzOK
  4. /Etc/xdg/autostart/a11y-profile-manager-indicator-autostart.desktopOK
  5. /Usr/share/accounts/providers/facebook. providerOK
  6. /Usr/share/accounts/qml-plugins/facebook/Main. qmlOK
  7. /Usr/share/accounts/services/facebook-microblog.serviceOK
  8. /Usr/share/accounts/services/facebook-sharing.serviceOK
  9. /Usr/share/doc/account-plugin-facebook/copyrightOK
  10. /Etc/signon-ui/webkit-options.d/www.facebook.com. confOK
  11. /Usr/share/accounts/providers/flickr. providerOK
  12. /Usr/share/accounts/qml-plugins/flickr/Main. qmlOK
  13. /Usr/share/accounts/services/flickr-microblog.serviceOK
  14. /Usr/share/accounts/services/flickr-sharing.serviceOK
  15. /Usr/share/doc/account-plugin-flickr/copyrightOK
  16. /Etc/signon-ui/webkit-options.d/login.yahoo.com. confOK
  17. /Usr/share/accounts/providers/google. providerOK
  18. /Usr/share/accounts/qml-plugins/google/Main. qmlOK
  19. /Usr/share/accounts/services/google-drive.serviceOK
  20. /Usr/share/accounts/services/google-im.serviceOK
  21. /Usr/share/accounts/services/picasa. serviceOK
  22. /Usr/share/doc/account-plugin-google/copyrightOK
  23. ...

It is also possible to verify only the configuration file, excluding all other files of the software package. To do this, you only need to use the-e or -- config options:

sudo debsums --config

Verify only the MD5 and:

  1. /Etc/xdg/autostart/a11y-profile-manager-indicator-autostart.desktopOK
  2. /Etc/signon-ui/webkit-options.d/www.facebook.com. confOK
  3. /Etc/signon-ui/webkit-options.d/login.yahoo.com. confOK
  4. /Etc/signon-ui/webkit-options.d/accounts.google.com. confOK
  5. /Etc/dbus-1/system. d/org. freedesktop. Accounts. confOK
  6. /Etc/acpi/asus-keyboard-backlight.shOK
  7. /Etc/acpi/events/asus-keyboard-backlight-downOK
  8. /Etc/acpi/ibm-wireless.shOK
  9. /Etc/acpi/events/tosh-wirelessOK
  10. /Etc/acpi/asus-wireless.shOK
  11. /Etc/acpi/events/lenovo-undockOK
  12. /Etc/default/acpi-supportOK
  13. /Etc/acpi/events/ibm-wirelessOK
  14. /Etc/acpi/events/asus-wireless-onOK
  15. /Etc/acpi/events/asus-wireless-offOK
  16. /Etc/acpi/tosh-wireless.shOK
  17. /Etc/acpi/events/asus-keyboard-backlight-upOK
  18. /Etc/acpi/events/thinkpad-cmosOK
  19. /Etc/acpi/undock. shOK
  20. /Etc/acpi/events/powerbtnOK
  21. /Etc/acpi/powerbtn. shOK
  22. /Etc/init. d/acpidOK
  23. /Etc/init/acpid. confOK
  24. /Etc/default/acpidOK
  25. ...

Next, if you want to display only changed files in the debsums output, use the-c or -- changed option. I did not find any changed files in my system.

sudo debsums --changed

The next command outputs a file without md5sum information. Here we use the-l and -- list-missing options. On my system, this command does not display any files.

sudo debsums --list-missing

Now, you only need to specify the name to verify the md5 and:

sudo debsums apache2

Verify the MD5 and:

  1. /Lib/systemd/system/apache2.service. d/apache2-systemd.confOK
  2. /Usr/sbin/a2enmodOK
  3. /Usr/sbin/a2queryOK
  4. /Usr/sbin/apache2ctlOK
  5. /Usr/share/apache2/apache2-maintscript-helperOK
  6. /Usr/share/apache2/ask-for-passphraseOK
  7. /Usr/share/bash-completion/completions/a2enmodOK
  8. /Usr/share/doc/apache2/NEWS.Debian.gz OK
  9. /Usr/share/doc/apache2/PACKAGING.gz OK
  10. /Usr/share/doc/apache2/README.Debian.gz OK
  11. /Usr/share/doc/apache2/README. backtraceOK
  12. /Usr/share/doc/apache2/README. multiple-instances OK
  13. /Usr/share/doc/apache2/copyrightOK
  14. /Usr/share/doc/apache2/examples/apache2.monitOK
  15. /Usr/share/doc/apache2/examples/secondary-init-scriptOK
  16. /Usr/share/doc/apache2/examples/setup-instanceOK
  17. /Usr/share/lintian/overrides/apache2OK
  18. /Usr/share/man/man1/a2query.1.gz OK
  19. /Usr/share/man/man8/a2enconf.8.gz OK
  20. /Usr/share/man/man8/a2enmod.8.gz OK
  21. /Usr/share/man/man8/a2ensite.8.gz OK
  22. /Usr/share/man/man8/apache2ctl.8.gz OK

If you run debsums as an ordinary user without the sudo permission, you can use the -- ignore-permissions option to treat the permission error as a warning:

debsums --ignore-permissions
How to use the. Deb file to generate MD5 and?

The-g option tells debsums to generate MD5 sum using deb content, where:

  • · MissingDD command debsums uses deb to generate MD5 and for software packages that do not provide MD5 and.
  • · The allDD command debsums ignores the disk and uses the sum existing in the deb file, or uses it to generate one if it does not exist.
  • · The keepDD command debsums writes the extracted/generated and to the/var/lib/dpkg/info/package. md5sums file.
  • · NocheckDD indicates that extracted/generated verification is not performed against installed software packages.

If you look at the directory/var/lib/dpkg/info/, you will see the md5sum of each file, as shown in:

cd /var/lib/dpkg/infols *.md5sums

List all MD5 and:

  1. A11y-profile-manager-indicator.md5sums
  2. Account-plugin-facebook.md5sums
  3. Account-plugin-flickr.md5sums
  4. Account-plugin-google.md5sums
  5. Accountsservice. md5sums
  6. Acl. md5sums
  7. Acpid. md5sums
  8. Acpi-support.md5sums
  9. Activity-log-manager.md5sums
  10. Adduser. md5sums
  11. Adium-theme-ubuntu.md5sums
  12. Adwaita-icon-theme.md5sums
  13. Aisleriot. md5sums
  14. Alsa-base.md5sums
  15. Alsa-utils.md5sums
  16. Anacron. md5sums
  17. Apache2-bin.md5sums
  18. Apache2-data.md5sums
  19. Apache2.md5sums
  20. Apache2-utils.md5sums
  21. Apg. md5sums
  22. Apparmor. md5sums
  23. App-install-data.md5sums
  24. App-install-data-partner.md5sums
  25. ...

Remember: using the-g option is the same as -- generate = missing. You can try to generate md5 and for The apache2 package by running the following command:

sudo debsums --generate=missing apache2

Because the apache2 package on my system already has md5 and, it will display the following output, which is the same as running $ sudo debsums apache2.

For more information about options and usage, see the debsums reference manual.

man debsums

This article describes how to verify installed Debian/Ubuntu software packages against MD5 checksum. To prevent installation and execution of corrupted binary or software package files on your system, it is necessary to verify the files on the file system against the information stored in the software package.

From: http:// OS .51cto.com/art/201610/519012.htm

Address: http://www.linuxprobe.com/check-debian-package-md5.html


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.