I want to install emacs-snapshot from http://emacs.orebokech.com But there is already an emacs-snapshot in Ubuntu's repositories.

How can I specify the repository from which a package will be installed?

link|improve this question
feedback

2 Answers

There is a preferences file for apt. I think it is located under /etc/apt, but not 100% sure. There you can set the priority for a package from a repository to be higher than for the same package from the Ubunto repository. For the exact syntax, look up in man apt-get. Edit the file, then install as usual with apt-get, it will fetch from the highest priority origin. Just make sure beforehand that the package from that repository is compiled for your distro (e.g. a debian binary may look for dependencies in the wrong places) and for your kernel version (this changes quite often throughout the life cycle of a Ubuntu version). Else it is a matter of chance if it will work.

link|improve this answer
feedback
up vote 0 down vote accepted

I found a workaround. First I needed to find the repositories that had the pacakage:

$ apt-cache showpkg emacs-snapshot
Package: emacs-snapshot
Versions: 
1:20100111-1~lenny1 (/var/lib/apt/lists/emacs.orebokech.com_dists_lenny_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 Description Language: 
                 File: /var/lib/apt/lists/emacs.orebokech.com_dists_lenny_main_binary-amd64_Packages
                  MD5: 906df684c212eabe267e6b5c2e8c2032

1:20090909-1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic_universe_binary-amd64_Packages)
 Description Language: 
                 File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic_universe_binary-amd64_Packages
                  MD5: 906df684c212eabe267e6b5c2e8c2032


Reverse Depends: ...
...

In the Versions: section. I see the versions that come from different repositories:

  • 1:20100111-1~lenny1
  • 1:20090909-1

So now we just tell apt or aptitude to install that specific version:

$ sudo aptitude install emacs-snapshot=1:20100111-1~lenny1

package-name=*version_name*

Victory.

I still don't know how to use a specific repository. But in this case a specific version was enough.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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