§2024-05-19

機器: hc4jammy.yushei.com.tw

$ sudo apt update && sudo apt -y upgrade
$ sudo apt auto-remove
$ sudo apt install update-manager-core
alexlai@hc4Jammy:~$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release 
set Prompt=normal in /etc/update-manager/release-upgrades.

alexlai@hc4Jammy:~$ sudo cp -v /etc/update-manager/release-upgrades /etc/update-manager/release-upgrades.backup
'/etc/update-manager/release-upgrades' -> '/etc/update-manager/release-upgrades.backup'
alexlai@hc4Jammy:~$ sudo nano  /etc/update-manager/release-upgrades
alexlai@hc4Jammy:~$ sudo diff /etc/update-manager/release-upgrades /etc/update-manager/release-upgrades.backup
16,17c16
< # Prompt=lts
< Prompt=normal
---
> Prompt=lts

alexlai@hc4Jammy:~$ sudo do-release-upgrade
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.   ---> cannot do auto upgrade

alexlai@hc4Jammy:~$ sudo apt update && sudo apt -y upgrade

機器: hc4jammy.yushei.net

¶Step 1: Back Up Ubuntu Data

I am going to skip this one, since most of my data is in the cloud

¶Step 3: Upgrade Ubuntu 22.04 LTS to 24.04 LTS

If upgrading via SSH, make sure to open port TCP port 1022 on ufw firewall for a stable connection during the upgrade process.

sudo ufw allow 1022/tcp

If you have physical access to your Ubuntu desktop and are upgrading locally, you don’t need to open any port. Simply install the Update Manager Core tool, which will ensure that all necessary tools for the upgrade are installed.

sudo apt install update-manager-core

Once the Update Manager Core is installed, initiate the upgrade process by entering the following command.

alexlai@n2Jammy:~$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release 
set Prompt=normal in /etc/update-manager/release-upgrades.

The error message you received indicates that you’re trying to upgrade to a non-existent development version of an LTS release.

Here’s what’s happening and how to address it:

Open the /etc/update-manager/release-upgrades upgrade configuration file and change the value of “Prompt” to “normal“, which ensures you’ll be notified about the upgrade and have the option to choose whether to proceed.

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting and upgrade behavior, valid options:
#
#  never  - Never check for, or allow upgrading to, a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the supported release that immediately succeeds the
#           currently-running release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that if this option is used and
#           the currently-running release is not itself an LTS release the
#           upgrader will assume prompt was meant to be normal.
# Prompt=lts   <-- change this
Prompt=normal

alexlai@n2Jammy:~$ sudo do-release-upgrade
Checking for a new Ubuntu release

= Welcome to Ubuntu 23.10 'Mantic Minotaur' =

The Ubuntu team is proud to announce Ubuntu 23.10 'Mantic Minotaur'.

To see what's new in this release, visit:
  https://wiki.ubuntu.com/ManticMinotaur/ReleaseNotes

Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.

We hope you enjoy Ubuntu.

== Feedback and Helping ==

If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at

  http://www.ubuntu.com/community/participate/

Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever.  If you feel
that you have found a bug please read:

  http://help.ubuntu.com/community/ReportingBugs

Then report bugs using apport in Ubuntu.  For example:

  ubuntu-bug linux

will open a bug report in Launchpad regarding the linux package.

If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:

  http://help.ubuntu.com/community/InternetRelayChat
  http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
  http://www.ubuntuforums.org/


== More Information ==

You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:

  http://www.ubuntu.com/


To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:

  http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce


Continue [yN] y
Get:1 Upgrade tool signature [833 B]                                                                                                                       
Get:2 Upgrade tool [1,267 kB]                                                                                                                              
Fetched 1,268 kB in 0s (0 B/s)                                                                                                                             
authenticate 'mantic.tar.gz' against 'mantic.tar.gz.gpg' 
extracting 'mantic.tar.gz'

Reading cache

Checking package manager

Continue running under SSH? 

This session appears to be running under ssh. It is not recommended 
to perform a upgrade over ssh currently because in case of failure it 
is harder to recover. 

If you continue, an additional ssh daemon will be started at port 
'1022'. 
Do you want to continue? 

Continue [yN] y

Starting additional sshd 

To make recovery in case of failure easier, an additional sshd will 
be started on port '1022'. If anything goes wrong with the running 
ssh you can still connect to the additional one. 
If you run a firewall, you may need to temporarily open this port. As 
this is potentially dangerous it's not done automatically. You can 
open the port with e.g.: 
'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'  ---> you could log into -p 1022

To continue please press [ENTER]
...

An unresolvable problem occurred while calculating the upgrade. 

This was likely caused by: 
* Unofficial software packages not provided by Ubuntu 
Please use the tool 'ppa-purge' from the ppa-purge 
package to remove software from a Launchpad PPA and 
try the upgrade again. 

¶Fix with ppa-purge, by chatGPT

alexlai@n2Jammy:~$ grep -r ^ /etc/apt/sources.list /etc/apt/sources.list.d/ | grep -i ppa
/etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list.distUpgrade:deb http://ppa.linuxfactory.or.kr jammy main
/etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list.distUpgrade:deb http://ppa.linuxfactory.or.kr jammy non-free
/etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list.distUpgrade:deb http://ppa.linuxfactory.or.kr jammy contrib
/etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list:deb http://ppa.linuxfactory.or.kr jammy main
/etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list:deb http://ppa.linuxfactory.or.kr jammy non-free
/etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list:deb http://ppa.linuxfactory.or.kr jammy contrib

alexlai@n2Jammy:~$ sudo ppa-purge ppa:linuxfactory/or
Updating packages lists
PPA to be removed: linuxfactory or
Warning:  Could not find package list for PPA: linuxfactory or

alexlai@n2Jammy:~$ sudo rm /etc/apt/sources.list.d/ppa_linuxfactory_or_kr.list   <-- manually remove

alexlai@n2Jammy:~$ sudo apt-get update
Hit:1 http://tw.ports.ubuntu.com/ubuntu-ports jammy InRelease                           
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease                     
Hit:3 http://tw.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Hit:4 http://tw.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Reading package lists... Done

alexlai@n2Jammy:~$ sudo apt-mark showhold
alexlai@n2Jammy:~$ sudo apt-mark unhold package_name <--- ???
E: Unable to locate package package_name
E: No packages found
alexlai@n2Jammy:~$ sudo do-release-upgrade         <--- again

...
Checking package manager
Reading package lists... Done    
Building dependency tree... Done 
Reading state information... Done

Calculating the changes

Calculating the changes

Could not calculate the upgrade 

An unresolvable problem occurred while calculating the upgrade. 

If none of this applies, then please report this bug using the 
command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal. If 
you want to investigate this yourself the log files in 
'/var/log/dist-upgrade' will contain details about the upgrade. 
Specifically, look at 'main.log' and 'apt.log'. 


Restoring original system state

Aborting
Reading package lists... Done    
Building dependency tree... Done 
Reading state information... Done
```

```
alexlai@n2Jammy:~$ grep -i 'error'  /var/log/dist-upgrade/main.log 
2024-05-20 13:29:32,485 DEBUG running doUpdate() (showErrors=False)
2024-05-20 13:30:01,446 ERROR NoDistroTemplateException raised: Error: could not find a distribution template for Ubuntu/jammy
DistUpgrade.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/jammy
2024-05-20 13:30:06,073 DEBUG running doUpdate() (showErrors=True)
2024-05-20 13:32:52,044 ERROR Dist-upgrade failed: 'Broken packages after upgrade: ubuntu-budgie-desktop'
alexlai@n2Jammy:~$ grep -i 'error'  /var/log/dist-upgrade/apt.log 
  MarkInstall libgpg-error0:arm64 < 1.43-3 -> 1.47-2 @ii umU NPb IPb > FU=0
  ignore old unsatisfied important dependency on libgpg-error-l10n:arm64
```