Start your 3-day free trial
Sign up to experience all premium features at no cost.
*Available only to new users. Each user is limited to one trial.


To fix apt update errors and repair broken packages, save the complete output, classify the failure, and only then run the matching repair: for confirmed broken dependencies, preview sudo apt-get --simulate --fix-broken install before the real --fix-broken install. apt update failures can also come from DNS or networking, a disabled or obsolete repository, signature authentication, another package process, an interrupted dpkg configuration, or a full filesystem. These categories need different actions; a broad force option can hide the evidence or authorize harmful removals.
Key Takeaways
- Save the exact repository URL, package name, and final error lines before changing configuration.
apt-get checkdiagnoses dependency state;--fix-brokenrequests a repair;--simulatepreviews an action. They are not interchangeable.[1]- Never delete package-manager lock files while another process may own them.
- Reject plans that remove unrelated desktop, kernel, security, or data packages.
Use the Device and App Troubleshooting Guide to keep observations separate from guesses. If the issue began with one downloaded package, also review safe installation of a downloaded DEB package.
Save the failed command, repository URL, package names, and final error lines. Record recent source, DEB, hold, or upgrade changes without publishing credentials.
Choose network or DNS, repository or release, signature authentication, active lock owner, interrupted dpkg state, broken dependency, or exhausted bytes or inodes.
Restore basic capacity and repository reachability before asking package tools to write. A full filesystem or unusable index can make a later repair fail for a second reason.
Run apt-get check, dpkg --audit, and apt-mark showhold. Do not treat a hold, an unpacked package, and a missing repository index as the same condition.
If a normal package process owns the lock, wait or follow its documented service procedure. Do not delete lock files or run a competing writer.
Correct only the confirmed repository or signature setup, or use dpkg --configure -a only for an explicit interrupted-configuration state.
For confirmed broken APT dependencies, run the --simulate --fix-broken form and inspect every install, upgrade, downgrade, and removal before allowing a real transaction.
Repeat the original operation, apt-get check, and dpkg --audit. Verify the affected program or service and keep the before-and-after output with the maintenance record.
The sequence deliberately delays mutation until the failure category is known. A successful simulation is only a plan, while a successful index refresh does not prove dpkg state is clean. If two branches coexist, handle the prerequisite first—for example, recover working space before package repair, or restore valid indexes before asking the dependency solver to fetch a version.
Run the failing command once in a terminal and keep its complete output. Do not paste secrets, private repository credentials, or internal hostnames into a public ticket. Note the Ubuntu release, time, last successful package operation, recent repository or DEB changes, and free space.
Use the wording to choose a branch:
| Error evidence | Likely branch | First check |
|---|---|---|
| Name cannot be resolved or temporary resolution failure | DNS or network | Query that exact hostname and test the IP path |
| Release file missing, repository has no Release file, or 404 | Repository/release | Confirm URL, suite, and vendor support |
| Public key, signature, or repository not signed | Authentication | Verify official signing instructions and system time |
| Could not get lock or frontend lock | Active package process | Identify and wait for the owning process |
| dpkg was interrupted or packages are unpacked but unconfigured | dpkg state | Inspect status, then complete configuration if appropriate |
| Unmet dependencies or held broken packages | Dependency state | Run apt-get check and inspect involved packages |
| No space left on device | Capacity or inode | Check the affected filesystem before retrying |
An apt update index error and a broken installed-package state can coexist, but one command does not repair every category.
Start with read-only or diagnostic commands:
sudo apt-get check
dpkg --audit
df -h
df -i
apt-get check updates the package cache as needed and checks for broken dependencies. The APT manual treats it separately from --fix-broken, which attempts to correct a dependency problem. dpkg --audit checks for partially installed or inconsistent package state.[2] Disk capacity and inode exhaustion must be repaired first because package tools need space to download, unpack, and update their databases.
Also review any held packages:
apt-mark showhold
A hold may be intentional for compatibility or operations. Do not remove it until you know who set it and what upgrade it prevents.
For a hostname failure, test the exact host with resolvectl query. If system name resolution is failing, diagnose the resolver and IP path rather than editing repository files.
For a 404, missing Release file, or unsupported suite, inspect the source definition and compare it with the vendor's official documentation for your Ubuntu release. A third-party repository may not support a new release yet, may have moved, or may have been retired. Disable or correct only the source you have positively identified, and keep a record so it can be restored. Do not delete every third-party source to make the warning disappear.
For signature errors, verify automatic time, the repository origin, its official key-installation method, and whether the signing key was rotated or expired. Do not use authentication-bypass options. The APT manual marks options such as allowing unauthenticated packages and force-yes as dangerous because they remove safeguards.
A lock usually means Software Updater, unattended upgrades, APT, or dpkg is already working. Identify normal package processes and wait for them to finish. On a managed server, check the maintenance job and logs before taking action.
Do not delete lock files. A file is not the ownership state itself, and removing it can allow two writers to modify package data concurrently. If a process appears stuck, first determine whether it is still downloading, unpacking, configuring, or waiting for input. Escalate through the system's normal service or maintenance procedure rather than killing it blindly.
If the error explicitly says dpkg was interrupted and no other package process is active, preview the affected state with dpkg --audit. Then the documented recovery may require:
sudo dpkg --configure -a
This resumes configuration for all unpacked but unconfigured packages, so read every prompt and error. It is not a generic first command for repository, DNS, or signature failures. The dpkg manual documents --configure -a as configuring all unpacked, unconfigured packages.
If one package's maintainer script fails repeatedly, keep its exact output and check the package's official support channel. Do not edit the dpkg database by hand.
--fix-broken?Use it only after apt-get check confirms a dependency problem and the repository indexes needed for the repair are usable. First simulate the proposed transaction:
sudo apt-get --simulate --fix-broken install
The simulation does not lock or write package state, so it is a preview rather than proof that the real transaction will succeed. Inspect every install, upgrade, downgrade, and removal. If the plan is narrow and understood, run the same repair without --simulate:
sudo apt-get --fix-broken install
Stop if the solver proposes removing unrelated applications, a desktop stack, the running kernel, security components, databases, or substantial data services. Resolve the conflicting repository, version pin, local DEB, or held package instead.
Run the original operation again and then check package state:
sudo apt update
sudo apt-get check
dpkg --audit
Success means repository indexes refresh without the original error, dependency checks pass, and no package remains partially configured. It does not prove every third-party application works; test the specific package or service through its documented health path.
If disk space was involved, follow recovering space on the affected Linux filesystem and verify both bytes and inodes before rerunning package tools.
Preserve the error, select the matching branch, and use diagnosis before repair. Correct DNS, repository, signature, lock, dpkg, dependency, or capacity state at its owner. Simulate dependency repair and reject surprising removals. Never trade package authentication or database integrity for a temporarily quiet terminal.
apt update install upgrades?No. It refreshes package indexes. Installation or upgrade is a separate action, though index refresh can reveal repository errors.
No. First find the process that owns package work and wait or use the documented service procedure. Deleting a pathname does not make concurrent database writes safe.
apt-get check change?Its purpose is diagnostic dependency checking, though it may update the package cache. It does not request the same repair as --fix-broken.
--fix-broken safe to run blindly?No. It can propose removals or other changes. Simulate first, review the plan, and understand the package or repository conflict.
apt --fix-broken install the same as apt-get -f install?For the repair request, yes: -f is the short form of --fix-broken, and with install you can omit package names so APT deduces a likely solution.[1] The apt front end requests the same repair. dpkg has no equivalent option, because it reports dependency problems rather than fetching packages to resolve them. Either way, simulate first.
The repository URL or suite may be wrong, obsolete, unsupported, or improperly published. Verify it with the repository owner's official instructions; do not bypass the warning.
dpkg --configure -a do?It attempts to configure all packages that are unpacked but not configured. Use it for an identified interrupted configuration state, not as a universal APT fix.
No. Verify the repository, system time, and current official signing setup. Authentication bypass turns a useful failure into an untrusted installation risk.
Disclaimer: Package state and recovery steps vary with Ubuntu release, enabled repositories, pins, and installed software. Maintain backups and a recovery console for important systems.
Sources:
Sources checked 4 October 2026.
Related Articles:
Sign up to experience all premium features at no cost.
*Available only to new users. Each user is limited to one trial.





