1

I am editing an Arch base installation script. I almost got it to work as I wanted!

I need to add the following into the end of /etc/pacman.conf

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Before I used cat command and it deleted everything inside /etc/pacman.conf and just added this. But I need to add it to the end of the file.

Here is the script I currently have: https://github.com/ArchT420/T420/blob/master/installer.sh

Thank you!

  • You can use below command – Praveen Kumar BS Oct 10 '18 at 3:24
  • sed -r '$s/.*/&\n[archlinuxfr]\nSigLevel = Never\nServer = http:\/\/repo.archlinux.fr\/\$arch/g' filename – Praveen Kumar BS Oct 10 '18 at 3:24
0

Why don't we simply use echo to append the context to a file.

echo -e '[archlinuxfr]\nSigLevel = Never\nServer = http://repo.archlinux.fr/$arch' >> /home/user/Documents/pacman.conf
1

This solution seems to work:

#!/bin/bash


## Add AUR repository in /etc/pacman.conf
cat <<EOF >> /mnt/etc/pacman.conf
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/\$arch
EOF

Not the answer you're looking for? Browse other questions tagged or ask your own question.