1)install remove inactive
Uninstall any inactive or uncommited IOS on 9XXX switches to have more space on flash.
1.1) delete /force flash:cat*.pkg
1.2) delete /force flash:packages.conf
If more space needed. (be aware about what you doing)
2)copy usbflash0: flash:
Copy IOS file to flash(e.g:cat9k_lite_iosxe.17.06.05.SPA.bin)
3)install add file flash:cat9k_lite_iosxe.17.06.05.SPA.bin activate commit
Install and commit the IOS
Switch will reload automatically after the process
4)dir flash:*.pkg
If the switch not reload automaticall,Confirm the installation of the new package installed on flash