How to safely use apt-get upgrade?

Hello! I’ve installed the official build as detailed in Official Image | Milk-V and noticed that apt-get update doesn’t seem to work by default. The included repo in /etc/apt/sources.list uses a debian-ports archive snapshot, but according to https://www.ports.debian.org/ , as of yesterday (October 26), riscv64 was removed from debian-ports archive. As such, when attempting to apt-get update, it complains about certificate verification failed, the certificate is not trusted, the certificate chain uses not yet valid certificate, et cetera. I tried replacing the repo in sources.list with the following:

deb https://deb.debian.org/debian sid main

At first glance, it appears to work, and packages appear. However, problems occur upon doing apt-get upgrade or apt-get dist-upgrade. When I did apt-get dist-upgrade, the next time I rebooted, the entire desktop broke, and it only booted to command-line. I also couldn’t re-install gnome (the error said “you have held broken packages”, I don’t remember any other details), so I gave up and re-flashed the SD card. This time, after going through the same steps, I did apt-get upgrade, and although it rebooted to desktop and “worked”, it became extremely slow. It was so slow that seconds pass by between each frame, even on a low screen resolution like 720p. According to top, the gnome-shell process constantly used 100% CPU.

My guess is that some specific configuration is getting replaced by upgrades. Is there any proper way to configure the sources.list to make package upgrades work / is my URL wrong? Or might the issue be more complex?

It may also be worth noting that upon flashing the image to the SD card, there was very little free space left on /dev/mmcblk1p4, so the first thing I did always was use fdisk and resize2fs to expand it and use up the remaining space on the SD card.

It may be wise to avoid apt upgrade at this stage. I installed needed packages from the base image’s package index and have had no issues other than missing handlers for Microchip USB to serial chip (FTDI) which sort of shocked me. A USB to UART console cable happened to be Prolific and the kernel module loaded right up and seemed to function, though it does not get mapped into the device tree.

1 Like

Currently Mars/Mars CM uses an image based on the VisionFive 2 image, and in those docs, it recommends not to use apt upgrade yet:

After Logging into Debian, at the current state, avoid running apt upgrade as it will override the existing customized packages provided by StarFive.

From today the previous link to download Debian does not work (see Official Image | Milk-V ), the GitHub page has been removed.

On the other hand, a previous, more complete and larger release appeared:

1 Like

I finally have the answer, DietPi works, it updates (automatically on first startup) safely too:

Linux mars 6.1.59 #1 SMP Sat Oct 21 21:17:40 UTC 2023 riscv64 GNU/Linux

       _,met$$$$$gg.          christian@mars 
    ,g$$$$$$$$$$$$$$$P.       -------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux trixie/sid riscv64 
 ,$$P'              `$$$.     Host: StarFive VisionFive V2 
',$$P       ,ggs.     `$$b:   Kernel: 6.1.59 
`d$$'     ,$P"'   .    $$$    Uptime: 4 mins 
 $$P      d$'     ,    $$P    Packages: 296 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.15 
 $$;      Y$b._   _,d$P'      Resolution: 1366x768 
 Y$$.    `.`"Y$$$$P"'         Terminal: /dev/pts/0 
 `$$b      "-.__              CPU: (4) @ 1.500GHz 
  `Y$$                        Memory: 80MiB / 3872MiB 
   `Y$$.
     `$$b.                                            
       `Y$$b.                                         
          `"Y$b._
              `"""

I could successfully update my Mars CM (eMMC) using the current v1.0.5 official image, with some caveats. I used deb https://deb.debian.org/debian sid main as only package source and run apt update && apt upgrade - resulting in an unresolvable broken package: dbus wants usr-is-merged to be installed but I couldn’t install usrmerge because dbus is broken due to usr-is-merged cannot be installted.

So on the next attempt with a fresh image, I first installed usrmerge and run dist-upgrade and that one worked fine.

I previously set the target to textmode, and removed all GNOME packages, since I don’t need them.

TLDR

My approach to a successful update to Debian Sid/Trixie:

  1. Run apt update && apt upgrade.
  2. Edit /etc/apt/sources.list, replace the current snapshot.debian.org with
deb https://deb.debian.org/debian sid main
  1. apt update && apt install usrmerge
  2. Reboot
  3. apt update && apt dist-upgrade
  4. Reboot

Worked for me on my Mars CM, that I only use as a headless system.

1 Like

I started with a desktop system from the “official” 1.05 ports image. I did the TLDR above and the upgrade process seems to have completed ok. The desktop kept locking on me as it timed out for power monitoring and eventually locked me out during the final dist-upgrade. I waited for a long while and then just pulled the plug and restarted. It booted ok but apparently needed to finish the dist-upgrade as it asked me a couple of questions and then hundreds of files installed. HINT: disable screen lock!

I got back to the command line on boot after the full dist-upgrade completed but my desktop was gone. Since I despise gnome desktop I was secretly happy. :slight_smile: and then I tried a kde-plasma-desktop install. The installation went smoothly, though I was never prompted to choose sddm. Presumably that was because gdm3 had been removed on the dist-upgrade.

A reboot worked and led to a blank x11 screen with a mouse cursor (no sddm). Fooling with all of that now. It’s not really critical to have a desktop, but I’d like to see it work!

I still have a lot of missing firmware to find (Microchip 2221 (cdc_acm kernel module) for example). Anyone having pointers on that please pipe up. It’s been 25 or more years since I built a kernel and I honestly don’t want to do so.

Regards,
Mitch

update: purged kde-plasma-desktop and kde-standard and sddm packages and ensured that budgie-desktop and it’s suggestions were installed along with lightdm.

that makes for a nice desktop! KDE was pretty piggish for a small SBC system anyway.

UPDATE:
budgie is pig-dog slow, so there must be a lack of GPU memory in the config somewhere. Disk has plenty of room, no swap at all and only 810 MB of RAM being used.

Punted and tried dietpi.
0. Using the standard dietpi image for StarFive VisionFive2 on the SD card, booted the board.

  1. Could not get past splash screen for MilkV until I unplugged the Ethernet cable (pulled power and started again 3 times, on the third, removing the Ethernet cable first). Once it got past the splash I plugged Ethernet back in and it was handled.
  2. Keyboard was not functional until I unplugged it and plugged it back in. Then I could log in with the credentials supplied on the screen. NOTE: was plugged into the black port originally then moved to a blue port.
  3. The setup and package update process proceeded normally. Once the system automatically rebooted, passed the MilkV splash screen with Ethernet plugged in. Keyboard also worked properly.
  4. DietPi configuration proceeds at this point, and it is a bit circular. Muddled thru.
  5. SD card file system was automatically extended to the full available space.
  6. Installed requisite software : build-essential git cmake net-tools nano to test things out.
  7. Reboot to clear the decks. Still missing key kernel module for cdc_acm (Microchip 2221 USB serial device)

Compared to the “official image” 1.0.5 this is much better.

From today the new image is available, it is no longer necessary to download the previous one and update it:
https://dietpi.com/downloads/images/testing/DietPi_VisionFive2-RISC-V-Sid.img.xz