The confirmation for `sudo apt install nano` comes only after APT calculates dependencies. I’m struck by the step between repository information and the dependency plan APT presents.
Inspect the local index APT uses to calculate package changes. Compare it with the installed package state dpkg tracks.
What apt manages on a Debian-based system
APT, the Advanced Package Tool, manages Debian packages through a high-level command-line interface. The apt command is intended for interactive use, with common actions for finding packages and changing installed software, as described in the Debian apt manual.
Repositories publish package records and archives, while your system keeps a local index of package names, versions, and dependencies. APT reads that index to plan a change, then uses dpkg to install or remove package files.
| Layer | What it provides | What changes |
|---|---|---|
| Repository | Package records and downloadable archives | Source data maintained by the distribution or repository owner |
| APT index | Local information about available package versions and dependencies | Refresh it with apt update |
| dpkg | Installed package files and local package state | APT requests package changes through it |
Check your distribution and permissions first
APT is the package manager on Debian-family distributions, not all Linux distributions. If you use Ubuntu, our Ubuntu version check helps identify the release before you follow release-specific instructions.
The version command reports the installed APT program, not the distribution release or the packages offered by configured repositories. It is a quick check that the apt executable is available.
apt --version
- Use administrator privileges for commands that install, upgrade, remove, or purge system packages.
- Searches and package-detail queries read the local index and do not change installed software.
- Read the proposed transaction before confirming it, especially when APT can remove packages.
Refresh, install, and upgrade packages
The update action downloads package information from configured sources. It refreshes the local index, so it does not install newer versions of software already on your system.
sudo apt update
Install names the package you want APT to add, and APT calculates the required dependencies before it asks you to confirm. For example, this command requests Nano from the enabled repositories.
sudo apt install nano
Upgrade applies available versions of installed packages without removing installed packages. If an upgrade needs a removal, apt upgrade leaves that package back rather than removing another package to complete the change.
sudo apt upgrade
Unlike apt upgrade, full-upgrade may remove installed packages when APT needs removals to complete the dependency plan. Review those removals before accepting the transaction, as the apt manual distinguishes this behavior from upgrade.
sudo apt full-upgrade
| Command | What it changes | Use it when |
|---|---|---|
| apt update | Refreshes available package information | The local package index needs new repository data |
| apt install | Adds a package and any required dependencies | You want a package from configured sources |
| apt upgrade | Upgrades installed packages without removing installed packages | You want eligible package updates applied |
| apt full-upgrade | May remove installed packages to complete upgrades | You accept the full transaction after reviewing its removals |
APT can install a local .deb file and resolve dependencies through configured repositories. Ubuntu’s local-package instructions explain the syntax, and our Ubuntu DEB installation guide walks through the path and checks.
Find a package and inspect its candidate
Search looks through package information in the local index, so its results can include a package whose description matches your terms. The same search can show an installed marker, but use an installed-only query when you need a package inventory.
apt search '^apt$'

The example output marks apt as installed. Search results still depend on the local repository data, so an available match is not by itself proof that a package is installed.
apt show apt
apt policy apt
apt list --installed apt
The show action prints package details, policy separates installed and candidate versions, and list can filter for installed packages. I saw apt policy print the installed and candidate fields separately, so compare those fields before requesting a particular version.
For a full inventory rather than one package, follow our guide to listing installed packages with apt. The candidate version and its repository priority can explain why APT selects one version over another.
Remove a package without deleting the wrong data
Remove, purge, and autoremove do different jobs. The focused apt removal guide covers the full procedure, while this table shows what each action targets.
| Action | Effect | Check before confirming |
|---|---|---|
| remove | Removes packaged software and usually leaves package-level configuration files | Confirm the package name and dependent packages |
| purge | Removes the package and its package-level configuration files | It does not remove personal files stored in your home directory |
| autoremove | Proposes removing automatic dependencies that are no longer required | Keep any package you still want, even if it was installed as a dependency |
sudo apt remove nano
sudo apt purge nano
sudo apt autoremove
APT lists the packages it plans to remove and waits for confirmation before continuing. The first retained screenshot shows the confirmation prompt and a typed response, but it does not show a completed command.

The typed y accepts the proposed transaction, but the prompt alone does not prove that removal finished. The next image shows APT reporting the removal action and its update to the editor alternative.

The removal line confirms that APT started the action. Wait for the command to return to the shell, then check the installed-package list if you need confirmation.
When APT will not proceed
A stale index can hide a package available from an enabled source. Refresh the index, then verify the package name and source before changing installation methods.
sudo apt update
An upgrade that leaves packages back can reflect a dependency change that would require removing another installed package. Check held packages and inspect the candidate before choosing a broader transaction.
apt-mark showhold
A beginner on the Linux Mint forum asked, “I know APT Install but how am I suppose to know that “-f” is for dependences ?” The apt-get manual lists -f as shorthand for –fix-broken, which asks APT to repair an existing dependency problem and can propose package changes.
sudo apt-get --fix-broken install
Use apt for interactive work and apt-get in scripts
APT provides several command-line tools with overlapping jobs. The apt command uses defaults for interactive terminal use, while apt-get and apt-cache expose dedicated interfaces for package actions and metadata queries.
I chose apt-get and apt-cache for script examples because the Debian apt manual says they preserve backward compatibility as much as possible. The same manuals explain apt-get and apt-cache in more detail.
| Tool | Use it for | What to remember |
|---|---|---|
| apt | Interactive package management | Designed for terminal users, with human-oriented defaults |
| apt-get | Package changes in scripts and automation | Its command-line behavior aims for backward compatibility |
| apt-cache | Read-only package metadata queries | It reads the local index, which can be stale |
That warning is about scripts, not interactive apt use. Scripts should call dedicated tools because their behavior aims for backward compatibility across versions.
Inspect the planned change before accepting it
APT’s simulation mode calculates a package plan without applying changes and runs without the locks used for a live transaction. Treat that output as a preview, not a guarantee of what a later install will do.
apt-get --simulate install nano
Read the proposed packages and any removals before running the live command with administrator privileges. A package plan is useful only when you understand which installed software it will keep and which it will change.
Common questions about apt
Can apt install a local .deb file?
Yes. APT can install a local .deb package and resolve dependencies from the repositories configured on your system. Use the file path when the package is not in the current directory.
How do I open the full apt manual?
Run man apt to read the manual installed on your system. Our guide to reading Linux manual pages explains the pager controls.
