| Tested on | Ubuntu 26.04 LTS (Resolute Raccoon) |
|---|---|
| Package | chkrootkit 0.58b-6build1 (26.04 universe)Ubuntu 24.04 LTS ships 0.58b-1; 22.04 LTS ships 0.55-4; upstream release 0.59 |
| Applies to | Ubuntu 26.04 LTS, 24.04 LTS, and 22.04 LTS |
| Privilege | sudo or root for complete live-system scans |
| Scope | Install chkrootkit from Universe, run manual and daily rootkit scans, interpret INFECTED and PACKET SNIFFER output without treating package ownership labels as proof of integrity, configure the packaged systemd timer (or daily cron on layouts without the timer), and optionally run upstream 0.59 from a build directory without replacing the Ubuntu package. |
| Related guides | rkhunter rootkit scanner Install ClamAV on Ubuntu apt command systemctl command check Ubuntu version |
A rootkit is malware or a set of modifications designed to keep privileged access while hiding processes, files, or other signs of compromise.
chkrootkit is a second-opinion rootkit scanner that looks for known signatures and suspicious system behavior: tampered binaries, odd kernel modules, hidden files, and packet sniffers. It reports what it finds; it does not remove rootkits. A clean-looking run is not proof the host is safe, and it is not a substitute for patching, logging, or AV where you need file scanning (see does Ubuntu need antivirus? for that decision).
This guide installs chkrootkit on Ubuntu 26.04, 24.04, and 22.04 from apt, runs your first scan, configures packaged daily scans, and explains how to read results without mistaking package ownership labels—or exit code 0—for a clean bill of health.
Quick Answer
Install from Universe and run a quiet scan:
sudo apt update && sudo apt install -y chkrootkitRun a quiet scan that hides clean test lines:
sudo chkrootkit -qConfirm the package and timer:
chkrootkit -Vchkrootkit version 0.58bCheck that the packaged daily timer is loaded:
systemctl status chkrootkit.timer --no-pagerUse sudo chkrootkit -q for routine review. Do not wrap everyday scans in timeout unless you accept that an expired timeout means the scan did not finish.
chkrootkit Versions on Ubuntu
| Ubuntu release | apt package (typical) | Notes |
|---|---|---|
| 26.04 LTS | 0.58b-6build1 |
Tested in this guide; universe |
| 24.04 LTS | 0.58b-1 |
Same upstream line; timer + /etc/chkrootkit/ layout |
| 22.04 LTS | 0.55-4 |
Same install and manual scans; package 0.55; daily automation often relies on /etc/cron.daily/chkrootkit |
Ubuntu package vs upstream 0.59
The chkrootkit project released 0.59 upstream (January 2026) with additional checks and fixes. Ubuntu 24.04 and 26.04 still package 0.58b in Universe.
APT remains the right default for day-to-day use because you get Ubuntu integration:
/etc/chkrootkit/chkrootkit.confandchkrootkit.ignorechkrootkit.service/chkrootkit.timerand/etc/cron.daily/chkrootkit- Package updates and Ubuntu package lifecycle through apt (Universe; not the same as guaranteed Canonical security support for every component)
Upstream source is useful when you need the newest test names only in 0.59—see Optional: run upstream chkrootkit 0.59 at the end.
What chkrootkit Can and Cannot Detect
chkrootkit runs a fixed set of tests against the live system (ROOTDIR=/ by default). It is not a full-disk antivirus scan like ClamAV.
| It can help with | It cannot prove |
|---|---|
| Known rootkit signatures and suspicious paths | That every file on disk is trustworthy |
| Sniffer-style network behavior | That an attacker never touched the host |
| Oddities in core system binaries | Compliance or malware-free certification |
Treat warnings as leads to investigate, not automatic confirmation of compromise or safety.
Install chkrootkit on Ubuntu
Install from the Universe repository
Universe is one of Ubuntu’s standard software repository components. It is enabled on most desktop installs; if apt cannot find chkrootkit, enable it with sudo add-apt-repository universe and run sudo apt update.
Refresh indexes and install the package:
sudo apt update && sudo apt install -y chkrootkitOn 26.04, confirm the candidate:
apt-cache policy chkrootkitInstalled: 0.58b-6build1
Candidate: 0.58b-6build1
0.58b-6build1 500
500 http://in.archive.ubuntu.com/ubuntu resolute/universe amd64 PackagesWhy you may see a mail server configuration prompt
The Ubuntu package recommends a mail transport agent and bsd-mailx because daily scans can email results to root when MAILTO is set in chkrootkit.conf.
Manual scans do not require you to run a mail server. If the Postfix configuration dialog appears during install and you are not setting up mail alerts, choosing No configuration (or equivalent) is reasonable for a workstation or server that will not deliver local root mail.
Verify the installed version
Print the packaged upstream version string:
chkrootkit -Vchkrootkit version 0.58bThe binary lives at /usr/sbin/chkrootkit. The package name is chkrootkit, not chrootkit.
Run Your First Rootkit Scan
Run live-system scans with sudo (or as root) because many checks need process tables, kernel interfaces, networking state, and protected paths a normal user cannot fully inspect.
A default sudo chkrootkit walks dozens of tests across the running system. That can take many minutes on a busy host with little console output between lines.
Full scan
Run the verbose scan when you need every not infected line for documentation:
sudo chkrootkit 2>&1 | tee /tmp/chkrootkit-full.logThe transcript starts with the active root:
ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `sshd'... not infectednot found means the target is not installed; not tested means a helper was missing or the check was skipped.
Quiet scan for easier review
-q does not make tests faster. It suppresses output for tests with no suspicious result so you can focus on warnings and INFECTED lines.
sudo chkrootkit -qOn my 26.04 host, quiet mode still listed packaged dotfiles:
WARNING: The following suspicious files and directories were found:
/usr/lib/modules/7.0.0-38-generic/vdso/.build-id [From Debian package: linux-modules-7.0.0-38-generic]
/usr/lib/debug/.build-id [From Debian package: libc6-dbg:amd64]Budget several minutes for a full quiet run on a loaded system. If you must cap runtime for automation, see chkrootkit takes a long time to finish.
Run a single chkrootkit test
Spot-check one signature without waiting for the full suite:
sudo chkrootkit sshdROOTDIR is `/'
Checking `sshd'... not infectedList all test names:
chkrootkit -l/usr/sbin/chkrootkit: tests: aliens asp bindshell lkm rexedcs sniffer w55808 ...Scan a mounted alternate root filesystem
-r sets an alternate root directory for offline forensics—not a generic “scan this folder” pass. chkrootkit treats that path as / for the test battery.
Mount the suspect disk read-only, then point at the mount:
sudo chkrootkit -r /mnt/suspect-rootROOTDIR is `/mnt/suspect-root/'
Checking `basename'... not foundUse a dedicated mount such as /mnt/suspect-root, not arbitrary paths like /opt, unless you intend that directory to act as the root filesystem for the scan.
Understand chkrootkit Results
chkrootkit reports a warning
|
v
Can you explain it?
/ \
yes no
| |
v v
Verify package Treat as suspicious
ownership/checksum |
| v
v Preserve logs;
Document known isolate if needed
false positive |
| v
| Investigate from
| trusted media
v
(done)not infected
The test did not match a known rootkit pattern for that target. It does not scan every file on the system.
INFECTED
Stop and investigate—do not delete binaries immediately. Confirm package ownership, compare integrity, and gather independent evidence.
On Ubuntu 26.04, chkrootkit may flag core utilities as INFECTED when /usr/bin/basename and similar commands come from uutils (coreutils-from-uutils) instead of traditional GNU paths. That is a tool mismatch, not automatic proof of malware—verify with dpkg -S and your change-management records.
Example from the lab (uutils layout):
Checking `basename'... INFECTEDAsk dpkg which package provides that binary:
dpkg -S /usr/bin/basenamecoreutils-from-uutils: /usr/bin/basenamePACKET SNIFFER
This means a process uses a PF_PACKET socket. Monitoring tools, NetworkManager, and tcpdump can trigger it. Inspect listeners with the ss command:
ss -lp | grep PACKETPackage-owned suspicious files
A [From Debian package: …] ownership label means dpkg knows which package owns the path. It does not prove the file on disk still matches the packaged checksum.
dpkg -S /usr/lib/modules/7.0.0-38-generic/vdso/.build-idUse the dpkg command for ownership queries. For content verification, install and run debsums on the owning package when you need checksum proof.
Why exit code 0 does not mean the system is clean
Debian and Ubuntu’s packaged chkrootkit script exits 0 at the end even when individual tests print INFECTED or WARNING lines.
Do not wire monitoring to exit status alone. Parse /var/log/chkrootkit/log.today or the scan transcript for INFECTED and WARNING.
Example: basename reported INFECTED while the shell still returned success:
sudo chkrootkit basename; echo exit:$?Checking `basename'... INFECTED
exit:0Configure Automatic Daily Scans
Ubuntu 24.04 and 26.04 ship a systemd timer and /etc/cron.daily/chkrootkit. The cron helper exits immediately when /run/systemd/system exists, so the daily job does not run twice on a normal systemd boot. Prefer the packaged timer on current releases—do not add your own cron wrapper on top.
On 22.04, the same package layout may apply, but some hosts never had chkrootkit.timer enabled or the unit may be missing on minimal images. If systemctl status chkrootkit.timer reports Unit chkrootkit.timer could not be found, rely on the packaged /etc/cron.daily/chkrootkit script (it calls chkrootkit-daily when executable). Manual scans and /etc/chkrootkit/chkrootkit.conf work the same; only the scheduler differs.
Verify the chkrootkit systemd timer
Confirm the timer unit is enabled at boot:
systemctl is-enabled chkrootkit.timerenabledConfirm the timer is currently active:
systemctl is-active chkrootkit.timeractiveDaily schedule details:
systemctl cat chkrootkit.timer[Timer]
OnCalendar=daily
Persistent=trueEnable the timer immediately after install if it is not already active (systemctl enable --now):
sudo systemctl enable --now chkrootkit.timerConfigure RUN_DAILY, DIFF_MODE, and MAILTO
Edit the packaged config (not legacy /etc/chkrootkit.conf):
grep -E '^RUN_DAILY|^RUN_DAILY_OPTS|^DIFF_MODE|^MAILTO' /etc/chkrootkit/chkrootkit.confRUN_DAILY="true"
RUN_DAILY_OPTS=""
DIFF_MODE="true"
MAILTO="root"| Setting | Typical use |
|---|---|
DIFF_MODE="true" with RUN_DAILY_OPTS="" |
Daily diff against log.expected; full context in logs, changes highlighted |
DIFF_MODE="false" with RUN_DAILY_OPTS="-q" |
Each run prints only suspicious lines |
MAILTO="root" |
Requires working local mail if you want emailed reports |
Do not set RUN_DAILY_OPTS="-q" for everyone: with DIFF_MODE=true, leaving full output can make diffs easier to read while unchanged lines are suppressed in comparisons.
Apply edits with:
sudo nano /etc/chkrootkit/chkrootkit.confCreate a known-good baseline
A baseline is a saved copy of scan output you already reviewed as expected. With DIFF_MODE="true", the daily job compares new runs against /var/log/chkrootkit/log.expected and highlights changes.
Review the first daily log only after you are confident the system is in a known-good state:
sudo less /var/log/chkrootkit/log.todayCopy it to the expected baseline:
sudo cp -a /var/log/chkrootkit/log.today /var/log/chkrootkit/log.expectedCopying log.today from an already compromised host would bake malicious state into the baseline.
Ignore reviewed false positives
Add stable paths you have verified to /etc/chkrootkit/chkrootkit.ignore so daily diffs stay readable.
Optional: Run upstream chkrootkit 0.59
Use upstream 0.59 when you need checks that are not in Ubuntu’s 0.58b package. Build in a temporary directory and run ./chkrootkit from that directory so you do not shadow /usr/sbin/chkrootkit or break the Ubuntu timer.
Install build tools and a downloader (minimal servers often lack curl):
sudo apt install -y build-essential curlDownload the 0.59 source tarball. The link below is Debian’s mirror of the official upstream 0.59.orig.tar.gz (same content as the release on chkrootkit.org); use it for a simple HTTPS fetch:
cd /tmp && curl -fsSL -o chkrootkit-0.59.tar.gz https://deb.debian.org/debian/pool/main/c/chkrootkit/chkrootkit_0.59.orig.tar.gzExtract and build:
tar -xzf chkrootkit-0.59.tar.gz && cd chkrootkit-0.59 && make -schkrootkit version 0.59Run from the build tree (keep APT as the managed daily scanner):
sudo ./chkrootkit -qIf the script complains about netstat, install net-tools or rely on the Ubuntu package for scheduled scans.
Investigate a Possible Rootkit Safely
Verify package ownership and integrity
dpkg -S /path— which package owns the file?debsums -s package— do on-disk files match package checksums? (install thedebsumspackage if needed.) On a host you already believe is compromised, do not treat local checksum tools as absolute proof.- Compare with a second tool such as rkhunter—the two overlap but do not cover identical checks.
Scan from trusted media when compromise is credible
Do not trust local ps, ls, or chkrootkit results alone on a host you believe is rooted. Boot trusted live media, mount the root filesystem read-only, and run:
sudo chkrootkit -r /mnt/suspect-rootThe ps command on clean media helps compare process lists against what the suspect system reported.
Update chkrootkit
Ubuntu delivers fixes through apt:
sudo apt update && sudo apt install --only-upgrade chkrootkitUpstream 0.59 does not replace apt updates—rebuild from a newer tarball only when you deliberately need upstream tests.
Uninstall chkrootkit
Stop scheduled scans:
sudo systemctl disable --now chkrootkit.timerRemove the package:
sudo apt purge -y chkrootkitPreview orphaned dependencies:
sudo apt-get -s autoremoveRemove only packages you no longer need. See how to remove software on Ubuntu for the full removal workflow.
Optional log cleanup (do not delete scan history or log.expected while you are investigating a suspected compromise—preserve logs first):
sudo rm -rf /var/log/chkrootkitTroubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Unable to locate package chkrootkit |
Universe disabled | sudo add-apt-repository universe then sudo apt update |
| Scan seems hung | Full test battery on a large live system | Use -q, single tests, or wait; see long-run note below |
grep /etc/chkrootkit.conf fails |
Old tutorial path | Use /etc/chkrootkit/chkrootkit.conf |
pstree not tested |
Missing helper | sudo apt install -y psmisc |
| Daily mail never arrives | No MTA or aliases | Configure Postfix/aliases or set MAILTO="" after reviewing logs locally |
| Many package ownership labels in warnings | Packaged dotfiles on dev images | Verify, then chkrootkit.ignore |
chkrootkit.timer not found |
Older or minimal layout (common on 22.04) | Use /etc/cron.daily/chkrootkit; see Configure Automatic Daily Scans |
Confirm your release with check Ubuntu version when comparing package versions.
chkrootkit takes a long time to finish
Full scans can exceed ten minutes. timeout does not speed tests up—it stops them. Exit code 124 from timeout means chkrootkit was interrupted; partial output is not a completed clean scan.
For bounded automation only:
sudo timeout 15m chkrootkit -qInterpret timeout exits as incomplete, not as “no rootkit found.”
Summary
Install chkrootkit on Ubuntu 26.04, 24.04, or 22.04 with sudo apt install chkrootkit from Universe, then use sudo chkrootkit -q for readable routine scans. On 24.04 and 26.04, prefer chkrootkit.timer and /etc/chkrootkit/chkrootkit.conf over custom cron wrappers or default timeout wrapping; on 22.04, use the packaged daily cron helper when the timer unit is missing.
Read [From Debian package: …] as package ownership metadata, not integrity proof. INFECTED deserves investigation, but on 26.04 uutils coreutils can produce false INFECTED lines on standard utilities. exit 0 does not clear the host—review log output and consider offline chkrootkit -r on mounted roots when compromise is plausible.
Upstream 0.59 is optional for newer checks; keep apt as the maintained daily scanner unless you accept manual rebuilds.
References
- chkrootkit project — upstream releases and documentation
- chkrootkit man page (Ubuntu) — options including
-qand-r - Ubuntu chkrootkit source package — versions per Ubuntu release
Frequently Asked Questions
How do I install chkrootkit on Ubuntu?
Enable Universe if needed, then run sudo apt update and sudo apt install chkrootkit. The package installs /usr/sbin/chkrootkit and /etc/chkrootkit/chkrootkit.conf on supported LTS releases; Ubuntu 24.04 and 26.04 also ship chkrootkit.timer for daily scans.
Does chkrootkit remove rootkits?
No. chkrootkit reports signs of known rootkits. Removal means rebuilding or restoring from trusted media after you confirm compromise.
Can a clean chkrootkit scan prove Ubuntu is safe?
No. A scan only runs its fixed tests at a point in time. Quiet output can still list warnings, and the packaged script may exit 0 even when lines show INFECTED.
What is the difference between chkrootkit and rkhunter?
Both are heuristic rootkit scanners with overlapping but not identical checks. Either can miss threats the other flags; neither replaces patching, logging, or professional incident response.
Does this guide work on Ubuntu 24.04?
Yes. Install the same chkrootkit package from Universe. Package revision may differ (for example 0.58b-1 on 24.04 versus 0.58b-6build1 on 26.04) but configuration layout matches.
Does chkrootkit work on Ubuntu 22.04?
Yes. Install chkrootkit from Universe the same way; the package is 0.55-4 upstream 0.55, not 0.58b. Manual scans and /etc/chkrootkit/chkrootkit.conf behave like newer LTS releases. If chkrootkit.timer is not present, daily scans use the packaged /etc/cron.daily/chkrootkit job instead of systemd.
Should I use timeout with chkrootkit?
Not for everyday manual scans. timeout kills the run when the limit is reached, which can leave tests unfinished and invite a false sense of safety. Use timeout only when you understand partial results.
Why does apt want to configure Postfix when I install chkrootkit?
The package can email daily scan results to root. Manual scans do not require mail. Pick no mail configuration during install if you are not setting up alerts.

