Skip to main content
apappu
Gold ⭐️
Gold ⭐️
May 22, 2019 4:49 AM UTC

How to update repo versions in Ambari server

  • Oct 5, 2026 8:51 AM UTC
  • 3 replies
  • 5523 views
  • Translate All

1. Get the output from Ambari server

http://AMBARI-HOST:8080/api/v1/stacks/HDP/versions?fields=repository_versions/operating_systems/repositories/*,repository_versions/operating_systems/OperatingSystems/*&repository_versions/RepositoryVersions/repository_version=3.1.0.0-78


2. Copy the json of "operating_systems" outer block of step1 output and create repo.json file -

it would looks like repo.json


3. update repo.json file to reflect your changes/modifications.


4. now run below API call to update.


curl -insecure  -H "X-Requested-By:ambari" --user admin:admin --data @repo.json  -X PUT  http://AMBARI-HOST:8080/api/v1/stacks/HDP/versions/3.1/repository_versions/1

Note: please make sure you include correct repo version id at the end. in this case it is 1


5. Now go and check in UI to see if those changes reflects.


Note: This tried and tested in Ambari2.7.x

3 replies

akhilsnaik
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
May 22, 2019 10:41 AM UTC

Helpfull Article to update Repo URLS incase manage version UI is not loading.


Translate
ArvindRoy
Silver ⭐️
Jun 19, 2021 6:24 AM UTC

Hi, This was really helpful as we were not able to change the baseurls in Ambari due to some errors.

 

While trying Step4 and executing the curl command, I am facing the below error message from Ambari:

 

p://<node>:8080/api/v1/stacks/HDP/versions/3.1/repository_versions/302/
HTTP/1.1 100 Continue

HTTP/1.1 500 Internal Server Error
Date: Sat, 19 Jun 2021 06:07:38 GMT
X-Frame-Options: ALLOW
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
Set-Cookie: AMBARISESSIONID=node0onkjuwcpwf2c6wyejo1o42go0.node0;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain;charset=utf-8
X-Content-Type-Options: nosniff
Transfer-Encoding: chunked

{
"status" : 500,
"message" : "An internal system exception occurred: Json structure for operating systems is incorrect"

 

 

Could you please help us resolve the issue.

Translate
arunek95
Gold ⭐️
Gold ⭐️
Jun 21, 2021 8:05 AM UTC

Hi Arvind , Can you check the Ambari server logs to see what error you are getting. If you are seeing something like this :

 

Caused by: org.apache.ambari.server.AmbariException: Base url is missing for request RepositoryRequest

 

Try to add this : 

gpl.license.accepted=true" in /etc/ambari-server/conf/ambari.properties and restart ambari-server.

 

Translate