Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using Fedora I usually use yum localinstall as a way to install a rpm obtained outside the distribution repositories. I can't find an equivalent option in the apt-get man page. I'm running Ubuntu 11.04, if that matters.

What is the apt-get equivalent of yum localinstall? Should I use dpkg directly in this case?

share|improve this question
up vote 9 down vote accepted

If you package depends on some other packages available in repositories, the following command will take care of installing dependencies too (which dpkg cannot do):

gdebi my_local_package.deb

however you may need to first install gdebi itself, if not already available on your Debian installation.

share|improve this answer
That's exactly what I was looking for! Thank you. – Vitor Py Sep 6 '11 at 15:16
Just note, that this requires X. It's good for workstation. Not so good for server operated remotely. – Michał Šrajer Sep 6 '11 at 15:37
@Michał Šrajer: no, it do not need X, you talk about gdebi-gtk. – enzotib Sep 6 '11 at 15:40
@enzotib: +1 good point. Thanks. – Michał Šrajer Sep 6 '11 at 15:47
when trying gdebi solution, look for gdebi-core package for CLI only. it looks like gdebi is GTK by default. You can see the list of gdebi pkgs like so: apt-cache search gdebi. You want this one: "gdebi-core - simple tool to install deb files". – mighq Aug 24 '14 at 16:46

As said @enzotib, gdebi is nice, it even allows simple inspection of pre/post install script if your are a paranoid like me.

But don't forget the shell way, little padawan.

In a shell, "simply":

dpkg -i file.deb

If all dependencies are present, it will install. Else you will see an ugly and long error message but this is not the end of the world:

# dpkg -i somepackage.deb 
dpkg: error processing somepackage (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:

Now, either install the missing dependencies or revert:

# apt-get install -f
The following extra packages will be installed:
Do you want to continue [Y/n]?
share|improve this answer

You need to use dpkg directly:

dpkg -i my_local_package.deb 

or setup your own local repository. I prefer to do just dpkg -i.

share|improve this answer
Is this the preferred way to do that on Debian-based distribution? On Fedora and RHEL I always use yum and never touch rpm directly. – Vitor Py Sep 6 '11 at 14:43
I think it's fine. From official docs: "dpkg is a command-line tool used to install packages". – Michał Šrajer Sep 6 '11 at 14:49
As a note for future googlers, this answer will fail if the new package depends on other packages which are not already installed. dpkg checks dependencies, but does not fetch them, that's why apt and gdebi were made. – Knetic Mar 4 at 9:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.