This article outlines a problem that can occur when performing a format install on EX Series switches, which may result in the "cannot open package" error. The condition is found to be due to the password file not being created properly.
For more information about performing a format install on EX Series switches, refer to KB20643 [juniper.net] .
When trying to perform a format install on an EX switch from the loader prompt, the problematic device may show the following error conditions:
loader> install tftp://10.10.10.10/jinstall-ex-4300-13.2X50-D18-domestic-signed.tgz cannot open package (error 60)
loader> install --format tftp://10.10.10.10/jinstall-ex-4300-13.2X50-D18-domestic-signed.tgz cannot open package (error 60)
loader> install file:///jinstall-ex-4300-13.2X50-D18-domestic-signed.tgz cannot open package (error 22)
The device may have entered a problematic state due to which the password files are not being created properly. This may be the result of multiple power cycles on the device to recover it.
In general, after password recovery, it is recommended to perform a system snapshot so that both partitions have the same Junos OS release.
To correct this problem and recover the password file, use the following procedure:
Get into "single user mode" during the boot cycle by first getting to the loader prompt. To get to the loader prompt, press the space bar when you see " Loading /boot/defaults/loader.conf ," at the beginning of the boot cycle.
Loading /boot/defaults/loader.conf
loader> boot -s
Check and mount the /var file system.
/var
# df Filesystem 512-blocks Used Avail Capacity Mounted on /dev/da0s1a 647748 349172 246760 59% / devfs 2 2 0 100% /dev /dev/md0 436012 436012 0 100% /packages/mnt/junos # mount /dev/da0s3e /var WARNING: /var was not properly dismounted # df Filesystem 512-blocks Used Avail Capacity Mounted on /dev/da0s1a 647748 349172 246760 59% / devfs 2 2 0 100% /dev /dev/md0 436012 436012 0 100% /packages/mnt/junos /dev/da0s3e 347504 13932 305772 4% /var <===da0s3e mounted
Check the password files in the root directory.
root
# ls -lrt /var/etcroot
Create read-write access to the root partition and create the symbolic links to the password files.
# mount -uw / # ln -s /var/etcroot/spwd.db /etc/spwd.db # ln -s /var/etcroot/pwd.db /etc/pwd.db
Unmount the /var partition.
# cd / # umount /var # df Filesystem 512-blocks Used Avail Capacity Mounted on /dev/da0s1a 647748 349172 246760 59% / devfs 2 2 0 100% /dev /dev/md0 436012 436012 0 100% /packages/mnt/junos # exit
This will boot the EX device into amnesiac mode from where you can log in to the device by using the root username.
Amnesiac (ttyu0) login: root Logging to master root>
2020-04-28: Article checked for accuracy; article found to be valid and relevant; minor changes made
2021-09-24: Changed step 6 in the solution to reflect EX devices, instead of just EX4300.