Home » How do I install a .deb file via the command line?

How do I install a .deb file via the command line?


Packages are manually installed via the dpkg command (Debian Package Management System). dpkg is the backend to commands like apt-get and aptitude, which in turn are the backend for GUI install apps like the Software Center and Synaptic.

Something along the lines of:

dpkg –> apt-get, aptitude –> Synaptic, Software Center

But of course the easiest ways to install a package would be, first, the GUI apps (Synaptic, Software Center, etc..), followed by the terminal commands apt-get and aptitude that add a very nice user friendly approach to the backend dpkg, including but not limited to packaged dependencies, control over what is installed, needs update, not installed, broken packages, etc.. Lastly the dpkg command which is the base for all of them.

Since dpkg is the base, you can use it to install packaged directly from the command line.

Install a package

sudo dpkg -i DEB_PACKAGE

For example if the package file is called askubuntu_2.0.deb then you should do sudo dpkg -i askubuntu_2.0.deb. If dpkg reports an error due to dependency problems, you can run sudo apt-get install -f to download the missing dependencies and configure everything. If that reports an error, you’ll have to sort out the dependencies yourself by following for example How do I resolve unmet dependencies after adding a PPA?.

Remove a package

sudo dpkg -r PACKAGE_NAME

For example if the package is called askubuntu then you should do sudo dpkg -r askubuntu.

Reconfigure an existing package

sudo dpkg-reconfigure PACKAGE_NAME

This is useful when you need to reconfigure something related to said package. Some useful examples it the keyboard-configuration when you want to enable the Ctrl+Alt+Backspace in order to reset the X server, so you would the following:

sudo dpkg-reconfigure keyboard-configuration

Another great one is when you need to set the Timezone for a server or your local testing computer, so you use use the tzdata package:

sudo dpkg-reconfigure tzdata

Debian (.deb) packages are the packages that are used in Ubuntu. You can install any .deb package in your system. .deb files can generally be installed from your file manager (Nautilus) merely by clicking on them, since file associations with the default installer is already set in Ubuntu. These instructions are for those who wish to install packages from the command-line terminal (Terminal).

To install a downloaded Debian (Ubuntu) package (.deb): Open Terminal and type

sudo dpkg -i packagename.deb

To remove a Debian (Ubuntu) package (.deb):

sudo dpkg -r packagename

To Reconfigure/Repair an installed Debian (Ubuntu) package (.deb):

sudo dpkg-reconfigure packagename

My favourite is GDebi, available from both terminal/shell or graphical desktop.


I usually associate .deb files with GDebi as it is fast and efficient – especially compared to Ubuntu Software Center. One of the main feature of GDebi is it resolves dependencies and installs them.

For command-line run sudo gdebi <package.deb> to install a single deb file.

Related Solutions

What’s the point of a delayed popup on a webpage?

It is about increasing the chance of the user having a look at the popup. Task-completion mode Users in task-completion mode are eager to fulfil their goal (eg, "Is the product/information/answer I'm after on this page?"). As such, they simply ignore anything...

Is the folder structure dying?

Rumors of its death are greatly exaggerated... Classic hierarchical folder views aren't dying. But they are being complemented by other ways of viewing and interacting with files. The key trend here is the decoupling of views from the underlying file system....

Are you sure you want to answer this question?

Yes. There is a very simple, effective heuristic that adjusts to the preference of each user. Place a check box in the warning message dialog that says: Don't show this message again Which can be improved further by stating where that dialog can be reenabled....

What are the negative and positive aspects of dark color scheme?

Darker color scheme are often used effectively in software that focuses heavily on visual content. For example Adobe Lightroom, Adobe After Effects, Microsoft Expression Blend, and Kaxaml are interfaces that have a dark color theme. This allows the interface to...

Intuitive interface for Composing Boolean Logic?

See also iTunes 9 or later. It adds the ability to do "nested" AND / OR expressions, akin to how a programmer would do it with parenthesis: This one tested well with both the technical and non-technical users and can generate pretty much any possible database...

Avoiding the Hermann grid illusion

The illusion is caused by bright areas exciting retinal neurons while surrounding dark areas simultaneously inhibit them, causing bleed (lateral inhibition). Thus, the idea is to reduce the bright areas at the corners so that those neurons aren't excited as...

How to encourage honest user behavior in UI

This is a constrained behavioral design problem Observations It's similar, but not identical to, a tragedy of the commons problem where participants are able to use and potentially exhause a common resource (in this case, free disposal for garden waste). This...

Why should we ask the password twice during registration?

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. We should not ask for password twice - we should ask for it once...

What is best practice for designing form error messages?

Encapsulated flags are the only solution I've found that reach all edge cases. Pointing the flag at the label rather than the input allows for consistency with radio buttons and check mark groups or weird inputs like sliders or sorters. Highlighting the field...

How Do I Avoid Users Becoming Numb to Warnings?

Mostly it’s crying wolf. Ninety-nine percent of the time the user selects the command, that’s exactly what they mean to do, so they very quickly get in the habit of smacking the OK button without more than a glance at the message. Designers don’t help the...

Why do idle elevators close the doors?

A Google search doesn't really provide me any answers but I do have some ideas on why the doors would close: 1: Time Efficiency (As stated by Andrew, Ruudt, and Angelo) Closing the door reduces the time the elevator needs, to move to a different floor when...

Why is it impossible to deselect HTML “radio” inputs?

You're not supposed to leave radio buttons blank. They're allowed to be blank so you can avoid setting defaults as mentioned in the question about setting a default gender. You can't not pick a gender, it's a required field, though you can leave a "prefer not...

How to discover what users NEED and not what they WANT?

Make sure that you focus on goals. Don't ask what your users want or need in terms of functionality or form. Find out what they need (or want) to achieve .. that way the parameters you use to define and solve the problem will be much clearer and focused....

Why is this design considered cluttered or overwhelming?

This is where UX gets hard There's nothing inherently wrong with your interface. It appears to be handling a large amount of information in a reasonably clear and standardized way. But there is something wrong with your interface: The users don't feel...

Do people really want to look at multiple windows at once?

I've always viewed it as a matter of "state" tracking. When I use a computer, I am doing a task, not using a program. This task may be something as simple as check email, and only requires one window open. Or it could be complex, such as design a section of a...

At what point does a user lose trust in a Busy Spinner?

Jakob Nielsen wrote an article called Response times - 3 important limits. The basic advice regarding response times has been about the same for thirty years [Miller 1968; Card et al. 1991]. He wrote this in 1993: 0.1 second is about the limit for having the...

Why is the 0 next to 9, not next to 1? [duplicate]

Many early typewriter keyboards did not have any key to the left of the "2", since a typist who needed to type the digit below that could use an uppercase "I" [for machines without "shift" keys] or lowercase "l" [for machines with them] for the purpose....

When to use icons vs. icons with text vs. just text links?

Icons are notoriously ineffective as labels, being very difficult to interpret correctly without training or experience. For most situations, users learn correct interpretations better with text alone than with icons alone. See: Wiedenbeck, S (1999). The use of...