4

I'd like to know how I can list all available versions (installed as well as non installed) of a given package in Arch Linux, not only the latest version. I know Gentoo (eix <package>), CentOS/Suse/Redhat/... (yum list <package>) and Debian (apt-cache policy <package>). I know I once did that in Arch but cannot remember how. It is assumed the package I want is not in pacman cache.

With Arch I have this:

$ pacman -Ss gcc
core/gcc 6.2.1-1 (base-devel)
    The GNU Compiler Collection - C and C++ frontends
core/gcc-ada 6.2.1-1
    Ada front-end for GCC (GNAT)
core/gcc-fortran 6.2.1-1
...

Here's an example of what you have with Gentoo:

eix gcc
...
[I] sys-devel/gcc
     Available versions:  
     (2.95.3) ~*2.95.3-r10^s
     (3.3.6) ~3.3.6-r1^s
     (3.4.6) 3.4.6-r2^s
     (4.0.4) **4.0.4^s
     (4.1.2) 4.1.2^s
     (4.2.4) ~4.2.4-r1^s
     (4.3.6) 4.3.6-r1^s
     (4.4.7) 4.4.7^s
     (4.5.4) 4.5.4^s
     (4.6.4) 4.6.4^s
     (4.7)  4.7.4^s
     (4.8)  ~4.8.0^s ~4.8.1-r1^s ~4.8.2^s 4.8.3^s 4.8.4^s 4.8.5^s
     (4.9)  ~*4.9.0^s ~*4.9.1^s ~4.9.2^s ~4.9.3^s
     (5.1)  **5.1.0^s
     (5.2)  **5.2.0^s
       {altivec awt boundschecking cilk +cxx d debug doc fixed-point +fortran gcj go graphite hardened libssp mudflap multilib multislot +nls nopie nossp +nptl objc objc++ objc-gc +openmp regression-test +sanitize vanilla}
     Installed versions:  4.8.5(4.8)^s(10:57:39 02/09/15)(cxx fortran multilib nls nptl openmp sanitize -altivec -awt -debug -doc -fixed-point -gcj -go -graphite -hardened -libssp -mudflap -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla)
     Homepage:            http://gcc.gnu.org/
     Description:         The GNU Compiler Collection
...

Here you have all available versions of GCC, with the installed one highlighted (can't see it here) in inverse video. On the system I ran this, installed GCC is version 4.8.5.

So how does one do it under Arch Linux again?


EDIT: Though I no longer have Arch on my machine, I think I have to add some details for precision. What I wanted at that time was not [how] to downgrade a package. What I needed is to know the list of available versions of a package that I want to upgrade, not just the latest version. This is useful for instance when I know the latest version (at the time of the upgrade) of a package is buggy and I want to try the previous one, if it also happens to be an upgrade of the currently installed version on my system.

3

A simple pacman -Ss <package> will show you that information:

↪ LC_ALL=en_US.utf8 pacman -Ss evince
testing/evince 3.22.0+1+gc1dd9eb-1 (gnome) [installed: 3.20.1-2]
Document viewer (PDF, Postscript, djvu, tiff, dvi, XPS, SyncTex support with gedit, comics books (cbr,cbz,cb7 and cbt))
extra/evince 3.20.1-2 (gnome) [installed]
Document viewer (PDF, Postscript, djvu, tiff, dvi, XPS, SyncTex support with gedit, comics books (cbr,cbz,cb7 and cbt))

Update after the example in your question:

In Arch Linux, you can only ever have (unless you're using unofficial repositories) two versions of a package available: a stable version in one of the core/extra/community/multilib repositories and one in testing.

If you really really really want to install older packages you have multiple options to find those:

  1. Use the Arch Linux Archive to find old versions of the packages.

  2. Use one of the tools from the downgrading wiki article to find them, for example agetpkg -l gcc or downgrader gcc.

Please note that packages in Arch Linux do not usually specifiy version bounds on their dependencies because partial upgrades are unsupported, so installing older versions of some packages is not a good idea.

  • Ah, I know that pacman -Ss command. It only lists the latest version of packages that match the search criterion. What I want is something like "pacman, list me all the versions you know of gcc, installed and non installed as well" for instance. – user86969 Oct 1 '16 at 7:34
  • There can be only one version of a package in each repository and those are exactly the ones pacman -Ss shows. – Wieland Oct 1 '16 at 10:30
  • 1
    Are you suggesting what I want is impossible? – user86969 Oct 1 '16 at 10:37
  • 1
    I'm not sure what you want anymore :-) It would be great if you could add some expected output (maybe with an existing package and its currently available versions) to your question. – Wieland Oct 1 '16 at 10:44
  • 1
    I've updated my answer, but please don't do this. – Wieland Oct 1 '16 at 11:39
2

From the Arch Linux wiki (my emphasis):

To see old and new versions of available packages, uncomment the "VerbosePkgLists" line in /etc/pacman.conf.

More on installing specific versions here.

Edit:

Here's how it looks on my Arch system with VerbosePkgLists uncommented:

sudo pacman -Sy firefox
:: Synkroniserar paketdatabasen...
 core är senaste versionen
 extra är senaste versionen
 community är senaste versionen
löser beroenden...
Söker efter paket med konflikter...

Paket (1)      Gammal Version  Ny Version  Nettoskillnad  Hämtningsstorlek

extra/firefox  48.0.2-1        49.0.1-1        -0,35 MiB         39,82 MiB

Total hämtningsstorlek:     39,82 MiB
Total installationsstorlek:  89,81 MiB
Nettouppgraderingsstorlek:   -0,35 MiB

:: Fortsätt med installation? [Y/n] 

My system is (obviously) in Swedish, but "Gammal Version" means Old version and "Ny Version" means New version. And as you see above, I am prompted with a [Y/n] before installing anything.

  • Thanks. I'm a bit lost though. Will pacman go verbose with versions only upon installing a package then? – user86969 Sep 30 '16 at 16:00
  • @Nasha I'm not sure I understand. But you are always prompted before any install in Arch. pacman -S <package> should show the versions and their dependencies. You can abort by entering N. See here for instance. – maulinglawns Sep 30 '16 at 16:03
  • I have updated my question to reflect what I want exactly. – user86969 Oct 1 '16 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy