45

Is there a way to update only selected programs in pacman?

I'm running ArchLinux on my netbook, and the complete upgrade of my system takes up more temporary space than I have on my system, so I'd like to just update one program at a time

SkaveRat
  • 3,807
  • 4
  • 21
  • 17
  • 2
    This will cause breakage at some point. You are better of upgrading everything (it is a rolling release), and then every couple of days or weeks backing up /var/cache/pacman to an external drive and flushing the cache with pacman -Scc – jasonwryan May 12 '11 at 18:49

2 Answers2

54

Pacman's install command really means 'synchronize', so the command to install a new package and to upgrade a single package is the same.

pacman -S packagename

This will upgrade the package.

sipefree
  • 656
  • 6
  • 2
  • 1
    A `package -Syu` might be necessary before, so you actually have a relevant version to synchronize with. See [the doc](https://wiki.archlinux.org/index.php/Pacman#Upgrading_packages) – Alexandre Bourlier Jan 17 '17 at 23:28
  • 1
    isn't this considered a "partial upgrade" and therefore unsupported/not recommended? – Severo Raz Jan 22 '18 at 23:35
  • ah I guess only if you do a `pacman -Sy` before, then you'd run into danger of breaking packages – Severo Raz Jan 22 '18 at 23:38
12

In pacman, you can actually specify the cache directory:

--cachedir <dir> set an alternate package cache location

So if you plug a USB stick into your computer, you can do a full system upgrade the normal way and just toss the downloaded packages onto the stick, like so:

pacman -Syu --cache /media/USB_STICK/pacman/

It doesn't take much space (a normal 1GB stick will suffice), so it should work fine with your netbook.

If you have slow internet, you can even create a download list and download the files from another computer, like so:

pacman -Syup

And it will print out a list of package URLs. Quite useful (at least to me).

Blender
  • 1,853
  • 2
  • 18
  • 25