8

I'm fairly new to Linux and shell scripting; and have a requirement to parse and query an xml. I was able to find and use XML starlet for Windows successfully.

However, my goal is to have that run on Linux via a shell script.

Can anyone please share the steps to install and configure XMLStarlet on Linux?

Thanks!

αғsнιη
  • 2,627
  • 2
  • 25
  • 38
Rishi
  • 91
  • 1
  • 1
  • 3

2 Answers2

14

For Ubuntu:

sudo apt-get update
sudo apt-get install xmlstarlet

For CentOS: It is present in epel repo, download the repo and enable it

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Confirm if it is enabled or not

cd /etc/yum.repos.d
grep -re enabled=1

This should show

epel.repo:enabled=1

Then Download xmlstarlet

sudo yum -y install xmlstarlet
Ismail
  • 779
  • 1
  • 8
  • 18
-1

If you are using Ubuntu/Debian run the following command in the terminal:

sudo apt-get update
sudo apt-get install xmlstarlet

if the OS is Centos

 Download latest epel-release rpm  http://download-ib01.fedoraproject.org/pub/epel/6/x86_64/

 Install epel-release rpm:
 $ sudo rpm -Uvh epel-release*rpm

 Install xmlstarlet rpm package:
 $ sudo yum install xmlstarlet

or download from https://centos.pkgs.org/6/epel-x86_64/xmlstarlet-1.3.1-1.el6.x86_64.rpm.html

Sriram
  • 626
  • 7
  • 11