Pacman.conf - repository section

Hi to all,
is it possible to configure pacman that it does not die if a repository is not reachable?
Background:
I am using an external repository (repo.nasutek.com) for trinity packages. Sadly the maintainer often forgets to renew the SSL certificate, and when it is renewed, the server is misconfigured and accessing throws a 404 or 403 error. pacman -Syu stops at the refreshing of the repo dbs and dies. Is it possible to configure pacman (or this single repo) that it can be ignored if it is not reachable? Up to now I always edited the repository section of trinity but that is quite ugly. I must observe the repo and enable the section again when it is reachable…

Off topic - I cannot get trinity to run - dcop errors, how did you fix this?

On topic:

You could keep two copies of pacman.conf, say pacman.ntde & pacman.tde then wrap a script around it:

#!/bin/bash
ping -w 3 -c 1 167.114.53.33

if [ "$?" -ne "0" ]; then
	echo "Errorlevel detected"
        cp /etc/pacman.ntde /etc/pacman.conf
else
       cp /etc/pacman.tde /etc/pacman.conf
fi
sudo pacman -Syu

ntde = no Trinity Desktop, tde = with Trinity desktop.

You don’t need to copy the config file like that. pacman can be passed the config file location in the command line.

If you do that you won’t have to worry about the current state of the config file. For example, putting the original config file back.

I couldn’t find that option, what is the syntax?

       --config <file>
           Specify an alternate configuration file.
1 Like
#!/bin/bash
ping -w 3 -c 1 167.114.53.33

if [ "$?" -ne "0" ]; then
	echo "Errorlevel detected"
        sudo pacman -Syu
else
        sudo pacman -Syu --config /etc/pacmantde.conf
fi

@dalto better?

1 Like

I think so. However in the first pacman line there is no need to specify /etc/pacman.conf since that is the default.

Done.

I know the possibility to use a different config file. But this does not answer my question. Is there an option to tell pacman DIRECTLY to ignore a specific repository if there is ANY issue?

Repo for trinity is not accessible - but server is up and responding to ping. I must dig deeper. Sometimes (as now) the SSL certificate expired. Sometimes it is only accessible via https://, sometimes it is only accessible via http://. And sometimes there is a 404 or 403 error. Everything must be handled seperately in a script. It would be very nice if there is a option like “ignore_if_not_accessible” for pacman.

I am not aware of any option like that nor do I see anything relevant in the man page.

If you don’t want to use a script, you could create a local mirror of the repo. Then your update process would always have access to the local copy and if there were temporary issues with the repo, it would just mean your local mirror would not get updated.

1 Like