I am trying to install mongodb on my amazon linux 2 server by following the documentation MongoDB but when I am trying to save the repo file it shows the following error
Error writing /etc/yum.repos.d/mongodb-org-4.0.repo: Permission Denied
The repo file contents are:
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
The error is displayed when I try to save my file. How can I resolve this error? Thanks in advance.