Installing a DEB file on Ubuntu is usually one command, but it works only when apt gets the file’s path, not its name. The ./ prefix makes the same file install, and the GUI method handles the rest.
The command ends with E: Unable to locate package.
Add the ./ prefix and the same file installs.
I ran every command on this page on Ubuntu 24.04 with the current APT and dpkg, and the terminal output below is copied from those runs.
dpkg behaves differently. It unpacks a package before it checks dependencies, which can leave one half-installed on your system.
Install a downloaded DEB file with APT
The repositories it searches are the ones configured in your sources, which is why the failure reads as a missing package rather than a missing file.

cd ~/Downloads
sudo apt install ./myapp_1.0.0_arm64.deb -y
The ./ prefix is what changes the lookup. It tells APT that the argument is a file on disk, so APT reads the package metadata and resolves dependencies from your repositories instead of searching for a package by that name.
An absolute path works without the prefix, because the slashes already mark it as a path.
sudo apt install /home/you/Downloads/myapp_1.0.0_arm64.deb -y
A wrong path produces a message that describes the argument rather than the file. APT answers with E: Unsupported file and repeats the path you gave, so a missing file and a malformed path look the same from the outside.
Inspect the package before you install it
A DEB file carries its own control metadata, so you can read the package name, version, architecture, and dependencies before anything touches your system.
dpkg-deb --info ./myapp_1.0.0_arm64.deb
dpkg-deb --contents ./myapp_1.0.0_arm64.deb
dpkg-deb --field ./myapp_1.0.0_arm64.deb Package Version Architecture Depends
The info output covers identity and description. The contents output lists every path the package will write, with its ownership and permissions.
The field command is the one to reach for when the file came from somewhere you do not control. Depends shows what else has to be present before the package can be configured.
One quirk will mislead you if you do not expect it. When a package declares no dependencies, the Depends field is absent and dpkg-deb prints nothing for it. The empty result is correct, so read the fields that came back instead of assuming the command failed.
What dpkg does when a dependency is missing
dpkg installs single packages and does not resolve dependencies. It unpacks the archive first and reports a missing dependency afterward.

The phrase to watch for is leaving unconfigured. The files are on disk, so the package has been partly installed, but it is not registered as working until its dependencies are satisfied.
That state can stop a later APT command from running. List anything pending before you move on.
sudo dpkg --audit
The audit output names every package that was unpacked but never configured. An empty list means nothing is pending.
| Situation | APT | dpkg |
|---|---|---|
| Dependency resolution | Before the install | After unpacking |
| Missing dependency | Nothing changes | Package left unconfigured |
| Best suited to | Installing a downloaded package | Inspecting a package by hand |
Fix a package left unconfigured
The repair command is the same in both cases.
sudo apt --fix-broken install
What it does depends on whether the missing dependency exists in your configured repositories.

When the dependency is available, APT installs it and then configures the package it was holding back. Both steps finish in the same run.
When the dependency does not exist anywhere in your repositories, APT cannot satisfy it. It removes the half-installed package instead, and it names that package before you confirm.
Read the line under The following packages will be before you accept it. If it promises additional packages, you are completing the install. If it says will be REMOVED, you are about to lose the package, and the dependency named in its metadata is the problem to solve.
The same command produced both outcomes, and only the availability of the dependency decided which one.
Match the package architecture to your system
Every DEB filename ends with the architecture it was built for. dpkg compares that value with your system and refuses a mismatch before it unpacks anything.

The error names both architectures, so it tells you which side to change. Compare your own architecture against the value inside the package.
dpkg --print-architecture
dpkg-deb --field ./app_1.0.0_amd64.deb Architecture
Download the build that matches your system when the two values differ.
- amd64 is the 64-bit build for Intel and AMD desktop and server processors.
- arm64 covers 64-bit ARM systems, including most Raspberry Pi boards running a 64-bit operating system.
- all is architecture independent and installs anywhere, because it ships no compiled binaries.
Install the file and confirm it landed
With the path marked and the dependencies understood, the install is one command.

APT reports the package as newly installed, unpacks it, and reaches the setup step where the package is registered.
Confirm the result rather than assuming it. An install can finish while leaving you to guess where the files went.
dpkg -l myapp
dpkg -L myapp
dpkg -s myapp
The -l output prefixes each package with two status letters. ii means you asked for the package to be installed and it is installed, which is the state you want.
The -L output lists every file the package owns, so you can locate the binary without searching. The -s output prints the installed control metadata, including the Status line that reads install ok installed.
Remove a package that came from a DEB file
Once installed, a package from a DEB file is indistinguishable from one that came out of the repositories. Remove it by package name.
sudo apt remove -y myapp
If you also want the configuration files gone, purge the package.
sudo dpkg --purge myapp
One warning looks alarming and is harmless. If APT already removed the package completely, a following purge reports that it is ignoring the request because the package is not installed. Nothing was left behind to purge.
Add autoremove when the install pulled in a dependency that nothing else uses.
sudo apt autoremove -y
Frequently asked questions
Why does APT say unable to locate package for a file I can see?
APT treated the filename as a repository package name. Prefix it with ./ or pass the full path so that APT reads the file instead of searching the repositories.
Can I install a DEB file by double-clicking it?
On a desktop install, double-clicking hands the file to GNOME Software, which runs the same APT transaction behind a graphical window. The terminal is easier to read when a dependency is missing.
Is dpkg -i the wrong tool for a local package?
It is the right tool when you want the unpack to happen regardless of dependencies, such as when you are inspecting a package or repairing a machine offline. For a normal install, APT is safer because it will not leave a package half-configured.
