Aptitude: Show What Repo a Package is From, Listing Contents of a Repo
Asked Answered
R

4

16

I am trying to prepare an AWS instance by installing some software, one of which is Fabric for Python, a SSH connection library.

By default, AWS's yum doesn't have access to a Fabric distribution to install, so I was attempting to figure out where Aptitude would get Fabric from.

I can't figure out a way to get what repo Fabric is in using Aptitude, or Yum for that matter.

Also, on a similar note, if I do have the url of a specific repo, how would I go about listing all of the packages it has available?

Recognizee answered 12/5, 2011 at 0:53 Comment(0)
O
13

You can use apt-cache policy to get that information (aptitude uses the same repositories as shown with apt-cache policy).

apt-cache policy fabric

Shows version and repository information about the fabric package.

As pointed out in another answer, you can also use

aptitude versions fabric

to get more or less the same information (in a slightly different format).

Ottava answered 19/9, 2011 at 12:28 Comment(1)
aptitude versions somepackage does not show the repository; an information like http://deb.debian.org/debian isn't returned.Liebknecht
V
3

To show available repository using aptitude you can try:

$ aptitude versions fabric 
Package fabric:                        
p   1.4.3-1                                                   testing,unstable                       990 

This should display all available repositories for the package and it will also list the policy priority at the end. Maybe also check /etc/apt/sources.list

Vaish answered 22/5, 2013 at 19:54 Comment(2)
As it is obvious from the provided example output, aptitude versions somepackage does not show the repository; an information like http://deb.debian.org/debian isn't returned.Liebknecht
@Liebknecht that's true, it doesn't return a URL, just the names of the repositories that contain the package (like "stable", "testing", or "unstable"). If the package isn't in any repository, aptitude versions returns nothing in the third columns instead.Ottava
T
1

Not quite sure this is a stack overflow problem: seems more a system admin than a software dev question. In any case, I'm also not sure you can use Aptitude with YUM: Aptitude typically uses apt-get on Debian-based platforms, while yum is generally for Fedora/Red-hat platforms.

From a command line on a machine with the package installed you can typically do:

dpkg -l | grep <package> to list all matching installed packages and then do apt-cache madison <packagename> to see what repo the package came from.

Turboelectric answered 12/5, 2011 at 2:38 Comment(0)
B
0

Run the following one-liner Bash shell script to list all the installed packages along with the repository names from which they are installed.

dpkg -l |awk '{print $2}'|tail -n 796|while read pkg;do apt-cache madison $pkg;done

for one package just run:

apt-cache madison package_Name
Biblio answered 8/5 at 10:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.