Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

3 Answers 3

up vote 5 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 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
2  
@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

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 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 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 
...snip...
dpkg: error processing somepackage (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 somepackage

Now, either install the missing dependencies or revert:

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

Your Answer

 
discard

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.