skip to Main Content

i was upgrading ubuntu 21.04 hirsute to 22.04 by following this tutorial ,in step 6 it’s failing it’s throwing an following error please help me to fix this issue

Reading cache

Checking package manager

Can not upgrade 

An upgrade from 'hirsute' to 'jammy' is not supported with this tool.
https://linuxconfig.org/how-to-upgrade-ubuntu-to-22-04-lts-jammy-jellyfish

4

Answers


  1. UPDATE: thanks to smknstd, JoeCool, MDarrinT and PurplProto.

    Script is working again.

    You can chose 3 different methods:

    # First method, upgrade to 22.04 with the official ubuntu method ( old-releases.ubuntu.com )
    # Replace sources.list   
    text="deb http://old-releases.ubuntu.com/ubuntu/ hirsute main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ hirsute-updates main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ hirsute-security main restricted universe multiverse"
    sudo echo "$text" | sudo tee /etc/apt/sources.list
    # Prerequisites
    sudo apt-get update
    sudo apt-get install update-manager-core update-manager -y
    sudo apt-get upgrade -y
    sudo apt-get dist-upgrade -y 
    # Download and run the ubuntu upgrade tool
    wget http://archive.ubuntu.com/ubuntu/dists/jammy-updates/main/dist-upgrader-all/current/jammy.tar.gz
    tar -xaf jammy.tar.gz 
    sudo ./jammy --frontend=DistUpgradeViewText
    
    -------------------------------++++++++++++++++++++++++--------------------------------
    
    # Second method, upgrade to 22.04 replacing the entire sources.list with the jammy repos
    # Replace sources.list   
    text="deb http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
    deb http://security.ubuntu.com/ubuntu jammy-security main universe restricted multiverse
    deb-src http://security.ubuntu.com/ubuntu jammy-security main universe restricted multiverse
    deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse"
    sudo echo "$text" | sudo tee /etc/apt/sources.list
    # Bypass "An upgrade from 'xxx' to 'xxx' is not supported with this tool" error
    sudo sed -i 's/continue/pass/g' /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py
    # Start upgrade
    sudo apt-get update
    sudo do-release-upgrade
    sudo apt-get update
    sudo apt-get upgrade -y
    sudo apt-get dist-upgrade -y
    sudo apt-get install -f -y
    sudo apt-get autoremove --purge -y
           
    -------------------------------++++++++++++++++++++++++--------------------------------
    
    # Third method, upgrade to 22.04 replacing the current distro codename with jammy into the sources.list with sed
    # Replace sources.list  
    sudo sed -i 's/hirsute/jammy/g' /etc/apt/sources.list
    # Bypass "An upgrade from 'xxx' to 'xxx' is not supported with this tool" error
    sudo sed -i 's/continue/pass/g' /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py
    # Start upgrade
    sudo apt-get update
    sudo do-release-upgrade
    sudo apt-get update
    sudo apt-get upgrade -y
    sudo apt-get dist-upgrade -y
    sudo apt-get install -f -y
    sudo apt-get autoremove --purge -y
           
    

    LInk to the complete github script here.

    Login or Signup to reply.
  2. Well, I tried the approach above. It failed.

    Going through the script, I decided to check the Ubuntu server for the packages. Strange, there are all these NotFound errors. Guess what? The apt files referenced were missing from the Ubuntu server.

    Then I went in and changed all the hirsute labels to jammy in the /etc/apt/sources.list file. Once I did that, apt ran. I could then run the script indicated above and have it find the packages.

    Now, it works. A couple of messages about php-fpm not being enabled under Apache HTTP, but since I run nginx, I hope it works.

    And it worked. I had to run through the apt upgrade && apt update && apt dist-upgrade && apt autoremove to clean out the detritus, but I have a working install on LTS.

    Login or Signup to reply.
  3. official (unsupported) upgrade path from EOL is described here:

    https://help.ubuntu.com/community/EOLUpgrades

    and requires pointing apt to old-releases.ubuntu.com mirror

    Login or Signup to reply.
  4. Before running the script, I had to modify my sources.list (/etc/apt/sources.list) and comment-out all lines leaving only these:

    ## EOL upgrade sources.list
    # Required
    deb http://old-releases.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
    

    Then it went first to ‘impish’ and then to ‘jammy’ by running the script twice.

    Or you can sudo do-release-upgrade after the first script; from ‘impish’ to ‘jammy’.

    Thank you and voted-up your answer.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search