Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Distributions»Debian»How To Upgrade Debian 8 to Debian 9 Stretch

    How To Upgrade Debian 8 to Debian 9 Stretch

    By RahulJune 7, 20183 Mins Read

    The Debian team has announced the latest version Debian 9.0 “Stretch” will be released on June 17th, 2017. This release has code name “Strech“. Debian 9 is full of new features and upgrades than the previous release.

    Advertisement

    In this tutorial, I will help you to Upgrade Debian 9 Stretch from Debian 8 Jessie with simple steps. In this tutorial, all commands are running with the root account. So you must have root user privilege or sudo privileges to complete this. The Desktop users can upgrade it immediately and use the new features, But the users with Debian servers can wait for their production upgrades. First, they should try this on their development environment and then upgrade on production, if everything goes fine.

    1. Backup Your Data

    The first and very important step is to backup your data. So we strongly recommend you to backup any data which is important for you in existing system. For example, Your Mariadb will be upgraded to version 10.1 and you can’t revert it back. So make sure backup your data to a remote location and after that proceed for upgrade. You may need to backup followings:

    • Application codebases
    • Databases
    • Configuration files (eg: DNS, Apache, MySQL, PHP, Postgres etc)
    • Emails and email accounts.
    • User accounts details.

    2. Upgrade All Packages of Debian 8

    Before upgrading to Debian 9, first update all packages of current installed Debian system using the following command.

    [email protected]:~:# apt update && apt upgrade
    

    3. Update sources.list Repository File

    Now edit Debian apt configuration file /etc/apt/sources.list and replace all “jessie” with “stretch” to get Debian 9 packages. Use sed command to replace all instances at once as following

    [email protected]:~:# cp /etc/apt/sources.list /etc/apt/sources.list.orig
    [email protected]:~:# sed -i 's/jessie/stretch/g' /etc/apt/sources.list
    

    The /etc/apt/sources.list file will look like below.

    deb http://mirrors.digitalocean.com/debian stretch main
    deb-src http://mirrors.digitalocean.com/debian stretch main
    
    deb http://security.debian.org/ stretch/updates main
    deb-src http://security.debian.org/ stretch/updates main
    
    # stretch-updates, previously known as 'volatile'
    deb http://mirrors.digitalocean.com/debian stretch-updates main
    deb-src http://mirrors.digitalocean.com/debian stretch-updates main
    

    4. Update all Packages Again

    After replacing all references in the Apt configuration file, Update all the packages on your system again. After that proceed to upgrade distribution.

    [email protected]:~:# apt update && apt upgrade
    

    5. Upgrade Debian 9 (Stretch)

    Finally, upgrade Debian 8 distribution to Debian 9 Stretch using the following command. This command will take some time to complete.

    [email protected]:~:# apt dist-upgrade
    

    6. Verify Upgrade

    At this point your system will have upgraded successfully to Debian 8. Lets reboot the instance first and check the version of upgraded system.

    [email protected]:~:# reboot
    

    After rebooting system, Login to serer Verify current version of Debian.

    [email protected]:~:# lsb_release -a
    
    Distributor ID: Debian
    Description:    Debian GNU/Linux 9.0 (stretch)
    Release:        9.0
    Codename:       stretch
    

    Congratulation’s, You have successfully upgraded to Debian 9 “Stretch”. Have fun!

    debian Debian 9 Debian Stretch Stretch upgrade debian
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Using the Apt Package Manager on Debian-based Systems

    How to Install Flask on Debian

    How to Install and Use Flask on Debian 11/10

    How to Setup DKIM (DomainKeys) with Postfix

    A Step-by-Step Guide to Installing OpenDKIM with Postfix on Ubuntu – Unleash the Power of DKIM!

    View 4 Comments

    4 Comments

    1. Aurelie on December 18, 2019 8:55 am

      Hello,
      After rebooting
      I tried Login with the same passphrase used before the update.
      Unfortunately I couldn’t because of ‘Permission denied (publickey)’
      What is the reason of this denied permission?
      Is there a plan B to login to the server

      thank you

      Reply
    2. tibi on February 16, 2018 10:52 pm

      thanks.

      take care that with this mysql will be auto upgraded to maria db

      Reply
    3. Kingsley Felix on August 19, 2017 5:37 am

      Hello;

      Will this upgrade the database server and everything else? like a fresh install of debian 9?

      Reply
    4. Jay LaCroix on June 20, 2017 11:05 pm

      Unfortunately, this process doesn’t seem to work on my Digital Ocean droplet. When I reboot after upgrading, the boot is delayed five or six minutes, with complaints on the screen about cloud init. I understand that cloud init is required in order for Digital Ocean’s snapshotting to work. I restored my snapshot that I took before upgrading, and tried the process again, same result.

      It appears to me that the only safe way of upgrading to Stretch on Digital Ocean is to create a new droplet and migrate your data over.

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • A Comprehensive Look at the Simple Mail Transfer Protocol (SMTP)
    • Understanding Basic Git Workflow: Add, Commit, Push
    • The Difference Between Git Reset –soft, –mixed, and –hard
    • Understanding the Staging Area in Git’s Workflow
    • Python Function with Parameters, Return and Data Types
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.