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.

A few years ago I added this repository to my sources.list:

http://www.deb-multimedia.org/

because it contained packages like acroread or flash player, which were either missing or out of date in the official repos.

However, now I have just realized that some of the packages from that repository are broken, e.g. mencoder. Hence a few questions:

  1. How can I find out which packages are installed from this particular repository?
  2. How can I make this repository lower priority, so that only the packages I want are automatically installed/upgraded from there?

EDIT: I edited `/etc/apt/preferences' file as someone suggested:

grzes:/home/ga# cat /etc/apt/preferences
Package: *
Pin: release a=testing
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

Package: *
Pin: release a=unstable
Pin-Priority: 50

Package: *
Pin: origin deb-multimedia.org/
Pin-Priority: 50

but it didn't seem to work (note that I downgraded this package manually):

grzes:/home/ga# apt-cache policy mencoder
mencoder:
  Installed: 2:1.0~rc4.dfsg1+svn34540-1+b2
  Candidate: 3:1.1-dmo5
  Version table:
     3:1.1-dmo5 0
         50 http://www.deb-multimedia.org/ unstable/main i386 Packages
        700 http://www.deb-multimedia.org/ testing/main i386 Packages
 *** 2:1.0~rc4.dfsg1+svn34540-1+b2 0
         50 http://ftp.uk.debian.org/debian/ unstable/main i386 Packages
        700 http://ftp.uk.debian.org/debian/ testing/main i386 Packages
        100 /var/lib/dpkg/status
     2:1.0~rc3++final.dfsg1-1 0
        600 http://ftp.uk.debian.org/debian/ stable/main i386 Packages
share|improve this question
    
You have multiple matching configurations (release a=testing and origin deb-multimedia.org/). I guess the first pinning configuration is overwriting the latter one. Also I don't know if origin works with a '/' at the end, use the exact string as reported by apt-cache policy. –  scai Aug 3 '12 at 7:53
    
Here, deb-multimedia.org has origin www.deb-multimedia.org (note the www at the beginning). After putting it at the beginning of the file it works. –  scai Aug 3 '12 at 8:35
    
@scai - I confirm that you are right, cheers! –  Grzenio Aug 3 '12 at 9:37
    
Have a look at this answer on superuser how to search for all installed packages from deb-multimedia.org –  Ulrich Dangel Aug 3 '12 at 12:57
add comment

3 Answers 3

I don't know how to list all packages and their repositories, but for a single one you can just execute apt-cache policy <package>. The line with the *** is the currently installed version with the corresponding repositories.

Setting the priority of a particular source is called apt pinning and can be done via /etc/apt/preferences (newer Ubuntu versions require the configuration to be in /etc/apt/preferences.d/ instead!):

You can pin either per release, origin or version. In your case, you want to pin either per origin:

Package: *
Pin: origin www.deb-multimedia.org
Pin-Priority: 300

or per release and the o= option:

Package: *
Pin: release o=Unofficial Multimedia Packages
Pin-Priority: 300

Note: It seems like the first matching pin configuration is used and additional matching configurations are ignored.

To see all currently known package sources, their priority, origins and other attributes, just call apt-cache policy without any option.

share|improve this answer
    
Hi, thanks for your answer. I tried the pinning, but it doesn't seem to work - see the edit to the question. –  Grzenio Aug 3 '12 at 7:49
    
Sorry for unaccepting your answer, I found a better way to do it from apt maintainers... –  Grzenio Sep 4 '12 at 9:17
add comment

You can use the script apt-show-versions.

apt-show-versions -b | grep deb-multimedia

would give you a list of packages from deb-multimedia.org.

share|improve this answer
1  
This doesn't seem to work. apt-show-versions only shows if the package comes from testing/unstable etc, and not from which repository. –  Grzenio Aug 29 '12 at 15:25
add comment
up vote 0 down vote accepted

It turns out that you can't have both the origin and release clauses at the same time. Every repository provides a label though, which can be used for filtering. In my case the correct /apt/cache/preferences file looks like this:

Package: acroread acroread-data acroread-debian-files acroread-dictionary acroread-dictionary-en acroread-escript acroread-fonts-jpn acroread-l10n acroread-l10n-en acroread-plugin-speech acroread-plugins cinelerra flashplayer-mozilla mozilla-acroread w32codecs
Pin: release a=testing,l=Unofficial Multimedia Packages
Pin-Priority: 550

Package: acroread cinelerra flashplayer-mozilla mozilla-acroread w32codecs
Pin: release a=stable,l=Unofficial Multimedia Packages
Pin-Priority: 500

Package: *
Pin: origin "www.deb-multimedia.org"
Pin-Priority: 50

Package: *
Pin: release a=testing
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

Package: *
Pin: release a=unstable
Pin-Priority: 50

To get the list of all available labels you need to run:

apt-cache policy

without specifying package name.

share|improve this answer
add comment

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.