First you need to mount your boot partition to /boot. It could be anything and there is no way of me knowing for your system. So run df -h
and you will get a list of storage devices that are mounted on your system.
Example output:
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 24G 145M 24G 1% /dev/shm
tmpfs 9.4G 9.8M 9.4G 1% /run
/dev/sdc3 912G 331G 536G 39% /
In this example /
is your root partition, which as you can see is /dev/sdc3
and unless you have some weird manual setup the EFI/boot partition will be on the first partition on the same device so in this case its /dev/sdc1
sudo mount /dev/sdc1 /boot
Now for a script to make it easier. Threw this together and tested it on my system, worked fine. Make sure you have a backup of everything you need. I take no responsibility for this script, run it at your own risk. If you boot multiple Linux distros DO NOT RUN THIS AT ALL as I did not account for that fully or test it.
This script will KEEP the currently loaded kernel, delete everything else, unmount boot partition, update Solus, reinstall the linux-current
and linux-lts
kernel, check for and fix any broken packages then run all post install triggers. This is all done to make absolutely sure you are on the latest kernel packages by the end of the script.
It will prompt for delete confirmation so pay attention to the prompts.
#!/bin/bash
keepkernel=( $(uname -r | sed s/-.*//) )
deletekernels=( $(ls /boot/EFI/com.solus-project | grep -v $keepkernel) )
deleteloaders=( $(ls /boot/loader/entries | grep -v $keepkernel) )
echo -e "The active kernel has been detected as $keepkernel you will not be prompted to remove files related to this kernel version."
sudo rm -i /boot/EFI/com.solus-project/${deletekernels[*]}
sudo rm -i /boot/loader/entries/${deleteloaders[*]}
echo "Unmounting boot parition..."
sudo umount /boot
echo "Updating Solus..."
sudo eopkg up -y
echo "Reinstalling linux-current kernel package..."
sudo eopkg it --reinstall linux-current
echo "Reinstalling the linux-lts kernel package..."
sudo eopkg it --reinstall linux-lts
echo "Checking for any broken packages."
solchk() {
output=( $(sudo eopkg check | tee /dev/stderr | grep Broken | awk '{print $4}' ) )
output_length=${#output[@]}
if [ $output_length -gt 0 ]; then
exec sudo eopkg it --reinstall ${output[*]}
else
echo -e "\nThere were no broken packages."
fi
}
solchk
echo "Running all triggers"
sudo usysconf run -f
Reboot and you should be good.