How to lock a source cache while you make changes


Suppose that you're managing a Pacman source cache that remote users have installed from. You might want to change the contents of your cache but only after doing some testing first. There are several ways of dealing with this situation in Pacman (see the tutorials). One simple thing you can do is lock the cache so that remote users can't install or update from your cache while you test the modified contents. To do this, simply

  1. Add a text file called lock to the top level directory of the cache. The first line of this file is an optional message to your users.
  2. With the presence of the lock file, remote users will not be able to browse, install or update and will instead get an error message incorporating your error message.
  3. Test the new contents of your cache as usual after doing
    % pacman -allow lock-override
    
    once.
When you are done testing, just remove the lock file.


Pacman Headquarters