Upgrading Photon OS - dcasota/photonos-scripts GitHub Wiki

Here a code snippet on how to upgrade Photon OS.

# fix repo if necessary. sed must already be present
if [ `cat /etc/yum.repos.d/photon.repo | grep -o "packages.vmware.com/photon" | wc -l` -eq 0 ]; then
	cd /etc/yum.repos.d/
	sudo sed -i 's/dl.bintray.com\/vmware/packages.vmware.com\/photon\/$releasever/g' photon.repo photon-updates.repo photon-extras.repo photon-debuginfo.repo
fi
sudo tdnf distro-sync -y
sudo tdnf update -y
sudo tdnf -y install photon-upgrade

# cd /bin
# sudo sed -i 's/[Yy]* ) reboot/[Yy]* ) \/sbin\/reboot/g' photon-upgrade.sh

sudo photon-upgrade.sh