'How to resolve "No packages marked for update" problem for amzn2-core in ec2 linux machine?

I cannot use yum commands like sudo yum update in Amazon EC2 instance.

[ec2-user@ip-***-***-*** /]$ sudo yum update
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                                                                                                                               | 3.7 kB  00:00:00     
No packages marked for update 

I tried all of the stuff writing on net but I couldn't solved it. Lastly I tried:

sudo sed 's/-$guid//g' /etc/yum.repos.d/amzn2-core.repo -i

Is there any way to solve it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source