Results 1 to 4 of 4

Thread: What is the script of do-release-upgrade

  1. #1
    Join Date
    Sep 2018
    Beans
    15

    What is the script of do-release-upgrade

    Hello, everyone

    Due to some reason, my do-release-upgrade process was interrupted and I was not able to execute the `[COLOR=var(--black-800)]Remove obsolete packages? [/COLOR]` step.

    So does anyone know the script of that step? Just want to remove the obsolete packages after upgrading. Thanks

    Tom

    PS: So far I had done this,

    Code:
    sudo -i
    
    apt-get update
    apt-get autoremove
    apt-get clean
     
    UNUSCONF=$(dpkg -l|grep "^rc" | awk '{print $2}')
    apt-get remove --purge $UNUSCONF
    
    
    NEWKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
    
    
    ADDKERNEL="linux-(image|headers|ubuntu-modules|restricted-modules)"
    
    
    METAKERNEL="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
    
    
    UNUSKERNELS=$(dpkg -l | awk '{print $2}' | grep -E $ADDKERNEL | grep -vE $METAKERNEL | grep -v $NEWKERNEL)
    
    
    apt-get remove --purge $UNUSKERNELS
    
    
    update-grub
    Last edited by tomhsiung; June 10th, 2021 at 08:57 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the script of do-release-upgrade

    Quote Originally Posted by tomhsiung View Post
    Due to some reason, my do-release-upgrade process was interrupted... Just want to remove the obsolete packages after upgrading.
    The first 5 lines of your "PS" code:
    Code:
    sudo -i
    
    
    apt-get update
    apt-get autoremove
    apt-get clean
    ...should have removed "obsolete packages." if you think you have more there, you can generate a list of obsolete packages via:
    Code:
    apt-show-versions | grep 'No available version'
    But saying that you had an interupted Apt process, you might also do:
    Code:
    sudo apt-get install -f
    ...to fix any broken packages caused by that interruption.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    Sep 2018
    Beans
    15

    Re: What is the script of do-release-upgrade

    Thank you, pal. Yes, I had upgraded successfully. And I just want to know the script of the do-release-upgrade program for removing the obsolete packages.

  4. #4
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: What is the script of do-release-upgrade

    If that happens again, if you do:
    Code:
    dpkg configure -a
    ...then it usually reconnects to the process of that where it let off, unless there are some packages to repair first.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •