Raspberry Pi replace kernel offline

It’s not that simple. But you can repair things on your RPi if you have (or can make) a second bootable SDCard.

Get your second SDCard with Debian and boot your RPi from that. Get your „broken“ SDCard in a USB reader, insert that in your RPi.

With chroot:

for i in /dev/sda*;do sudo umount $i; done
sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /sys /mnt/sys
sudo mount -t proc proc /mnt/proc
sudo mount -o bind /dev/pts /mnt/dev/pts

cd /mnt
sudo chroot .
sudo rpi-update
exit
cd /
for i in t/boot t/dev/pts t/dev t/sys t/proc t; do umount /mn$i; done
poweroff

With rpi-update only, when chroot does not work:

To check which device is used for the SD card that needs to be rescued: fdisk -l
In my case: /dev/sda

sudo mkdir -p /mnt/rescue/{boot,root}
sudo mount /dev/sda1 /mnt/rescue/boot
sudo mount /dev/sda2 /mnt/rescue/root
sudo ROOT_PATH=/mnt/rescue/root BOOT_PATH=/mnt/rescue/boot SKIP_BACKUP=1 rpi-update
umount /mnt/rescue/{boot,root}

MAKE A PASSWORD PROTECTED ZIP FILE

This article explains how to make an encrypted (password protect) compressed file also referred to as an archive file.

Note: The built in Windows compression tool cannot password protect a compressed file; therefore a third-party application has to be used. In this article we use 7-Zip utility which is licensed under the GNU LGPL/GNU LGPL + unRAR and hence is free to download and use.

What to do

  1. Download the 7-Zip installer for your computer from www.7-zip.org. Run the program and install 7-Zip to your computer.
  2. In Windows Explorer, browse to the file you want to compress with 7-Zip.
  3. With the file/files/folder highlighted right-click on one item and from the sub menu select 7-Zip Add to archive….
  4. If you are sending the file to another person, who may not have 7-Zip installed, change the Archive format option from the default 7z to zip.
  5. Under the heading Encryption enter a password in the first field, and reenter the same password into the second password field. Ensure you do not forget the password you entered as you will be prevented from opening files inside the archive in the future.
  6. You may now click OK to create the compressed archive.

Note: Not all compression programs can open archives protected with AES-256 encryption so the recipients may have a problem opening the archive, or you may have a problem opening the file on another computer. Consider the level of protection required for the files and select the method of encryption that is appropriate.

  • Either leave the Encryption method as ZipCrypto to maximize compatibility with other compression programs. If you are sending the file to another person their compression program will most likely open .zip files encrypted with the ZipCrypto standard.
  • Or change the Encryption method to AES-256 if you need maximum security protection for the file/files/folder contained inside the archive.

You will have a new file with a .zip file extension in the same folder as the file/files/folder you selected to compress in step three.

If you open the zip and then try to open a file inside the zip file you will be prompted for the password you set previously.

Distribution Upgrade OpenSUSE

Before you begin

Make sure that you read the list of annoying bugs for the new version you are going to install. Some of them could affect the update process. Usually, some solution or workaround is listed alongside the bug, so make sure that you are prepared for upcoming problems.

Also, read the Release Notes which list changes and glitches in the new release.

Upgrading from the command line

The following steps show how to upgrade to 15.3:

1. Update the repos

Check if your Leap repos defined in /etc/zypp/repos.d/ are using the $releasever variable already. If they are still hard-coded with a particular Leap version number, then you need to modify them first. For example, assuming your current version is Leap 15.2, then this can be done with

sudo sed -i 's/15.3/${releasever}/g' /etc/zypp/repos.d/*.repo

2. Refresh with the new repos

Switch and refresh all repositories to 15.3

# zypper --releasever=15.3 refresh

3. Execute the full distribution upgrade

Now execute the full distribution upgrade.Warning: It is strongly recommended that you run the upgrade outside the X-window graphical mode. Thus it is recommended you run the command from either runlevel 3 (text + network), or a virtual console. Unfortunately many times the WIFI connection is managed/available only in runlevel 5, so a virtual text console may be best while staying logged into the graphical console behind the scenes. People had their X session stopped/crashed during the upgrade, causing the upgrade to abort, which in turn left the system in an inconsistent state. To change to runlevel 3, see SDB:Switch_runlevel. To remain in runlevel 5, but use a „virtual console“, type control-alt-F1 (as an example).

# zypper --releasever=15.3 dup --download-in-advance --auto-agree-with-licenses --allow-vendor-change

With the above command, zypper will download all packages in advance – which is more reliable if your internet connection may fail. To download packages in heaps and install them in heaps, use:

# zypper --releasever=15.3 dup

Once the dup is finished, openSUSE sets the releasever variable to the new version.If you did the above dist upgrade before the official release date (eg.2021-06-02 for Leap 15.3), you may have installed a Release Candidate (RC) or a milestone version and will need to repeat the final zypper dup step now to receive the final release.

4. Reboot

After upgrading, a reboot is recommended to start the new kernel and newer versions of everything.

5. Add extra repositories

Search for updated openSUSE Leap 15.3 compatible third-party repositories that you used before — if you still need them — and add them.Warning: Use with caution. Using third-party repositories may break your system or cause instabilities.

zypper addrepo --name <name> <url> <alias>

Or, if you have URL of a .repo file:

# zypper ar <url.repo>

Executing zypper up may be enough to update your software from these extra repositories.

6. Afterwards

Discover and enjoy :)In addition, zypper up can be run from time to time to ensure you have the latest available packages from the various repositories that you have enabled. YOU (Yast Online Update) only addresses security updates from the official repositories.