- Upgrading from the command line? [duplicate]
- 3 Answers 3
- Update Linux in a Terminal
- Update With a GUI
- Update In Terminal
- Conclusion
- Upgrade Ubuntu desktop
- When can I upgrade?
- Getting ready to upgrade
- 2. Launch the software updater
- 3. Follow the upgrade flow
- 4. Enjoy your shiny new Ubuntu!
- Help is always at hand.
- 5. (Optional) Upgrading to interim releases
Upgrading from the command line? [duplicate]
I would like to know how to upgrade from my current version of Ubuntu to the next stable from the Command line interface?
Well, they do, but command line is only mentioned as «Run do-release-upgrade in a terminal», as it’s that simple, after general steps («take backups»).
What worked for me is /usr/lib/ubuntu-release-upgrader/check-new-release -d and then do-release-upgrade -d works for me
For Ubuntu 20.04+, I had to do sudo apt-get update + sudo apt-get upgrade -y + sudo apt-get dist-upgrade and finally sudo do-release-upgrade .
3 Answers 3
You’ll first need to make sure update-manager-core is present (it may already be installed):
sudo apt-get install update-manager-core
You may need to check /etc/update-manager/release-upgrades and change the line:
for the release to show up.
I have Ubuntu 17.10 installed. Apparently the update-manager-core package has been added to the core packages since the answer was given, as trying to install it yields the output update-manager-core is already the newest version (1:17.10.13). , and the command do-release-upgrade is available. However, giving this command on the command line produces the output No new release found. , even though release 18.04 was released last week. (I do have the line Prompt=normal in file /etc/update-manager/release-upgrades .)
@TeemuLeisti the /etc/update-manager/release-upgrades documentation says 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.
So it seems that setting Prompt=normal is NOT enough to update to the latest version. This will only update you to the second-to-latest version
I found running /usr/lib/ubuntu-release-upgrader/check-new-release -d and then do-release-upgrade -d works for me
Update Linux in a Terminal
Keeping linux updated is a simple hassle free task, unlike that other OS. On linux you can use a GUI app or update in a terminal. Both methods achieve the same result, but users usually have a preference. For me that’s the terminal. It’s very important to keep your system up to date to keep it protected against vulnerabilities. Hackers are always trying new and different ways to obtain your valuable data. Updating will also install software improvements and new features when available.
Update With a GUI
Most linux distributions come with a GUI app to install updates. I’m currently using Xubuntu which comes with “Software Updater”. It’s a simple app that checks for updates and installs them for you. Now in my experience with the GUI app in both Ubuntu and Xubuntu, if an application repository changes name you do not get a prompt to confirm this. This is a problem because without your consent, that particular app is not updated and held back. This is why I prefer and recommend the terminal to update since it always gives you the prompt to confirm the repo name change.
Update In Terminal
Updating linux software in the terminal is actually quite simple and only requires two commands. We will be going over updating Debian and Debian based distros like Ubuntu and all of its derivatives with APT. The Advanced Package Tool(APT) is the command line tool for managing software efficiently from your terminal. Update software database: First we need to update the local software database with the latest software as follows:
Get:34 http://mirror.umd.edu/ubuntu bionic-security/main amd64 Packages [531 kB] Get:35 http://mirror.umd.edu/ubuntu bionic-security/main i386 Packages [382 kB] Get:36 http://mirror.umd.edu/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB] Get:42 http://mirror.umd.edu/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB] Get:43 http://mirror.umd.edu/ubuntu bionic-security/universe DEP-11 64x64 Icons [108 kB] Get:44 http://mirror.umd.edu/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B] Fetched 8,178 kB in 12s (660 kB/s) Reading package lists. Done Building dependency tree Reading state information. Done 7 packages can be upgraded. Run 'apt list --upgradable' to see them.
Perform the upgrade: Once the software database updates, then you can update all the software on your system as follows:
Reading package lists. Done Building dependency tree Reading state information. Done Calculating upgrade. Done The following NEW packages will be installed: linux-headers-5.0.0-32 linux-headers-5.0.0-32-generic linux-image-5.0.0-32-generic linux-modules-5.0.0-32-generic linux-modules-extra-5.0.0-32-generic The following packages will be upgraded: distro-info-data libtiff5 libtiff5:i386 linux-generic-hwe-18.04 linux-headers-generic-hwe-18.04 linux-image-generic-hwe-18.04 linux-libc-dev 7 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 68.7 MB of archives. After this operation, 332 MB of additional disk space will be used. Do you want to continue? [Y/n]
You rarely ever need to reboot after an update unless you also receive a kernel update(linux-headers). After running the second command above, if you see any kernel update mentioned in your terminal, then you should reboot your PC after the update process is done. Update and upgrade in a one line command: This one line command combines the previous two commands in a single one-liner. You’ll notice it contains a “-y” switch at the end. This will automatically say “yes” to the prompt asking if you wish to update.
sudo apt update && sudo apt upgrade -y
Update a single package(application): If you only wish to update a single package and not the entire system, you can run the following command: Replace “package_name” with the package you wish to update
sudo apt upgrade package_name
Conclusion
Upgrade Ubuntu desktop
Being able to upgrade Ubuntu from one version to the next is one of Ubuntu’s best features. You benefit from getting the latest software, including new security patches, and all the upgraded technology that comes with a new release without having to reinstall and reconfigure your system.
When can I upgrade?
Ubuntu users are prompted to upgrade at different times depending on their current release.
Users on interim releases such as Ubuntu 21.10 are prompted to upgrade within a few days of the next Ubuntu release becoming available. This prompt may happen automatically, or when checking for new updates.
Users on a Long Term Supported release such as Ubuntu 20.04 LTS will be prompted to upgrade once the first point release of the following LTS is available. For Ubuntu 22.04 LTS this prompt will appear once Ubuntu 22.04.1 LTS is available.
Note: Ubuntu 22.04.1 LTS is now available and the upgrade prompt will now appear for all users.
Getting ready to upgrade
Before proceeding ensure that your software is up to date by running:
sudo apt update
sudo apt upgrade
From your terminal, entering your password and pressing Y when prompted.
Also ensure that all of your user data has been backed up. Whilst it is unlikely that data will be lost during the upgrade process, it’s better to be safe than sorry.
2. Launch the software updater
You can find the Software Updater in your application menu. This will check for updates and prompt you to upgrade if it finds a more recent Ubuntu release. If no upgrade prompt appears, you are either on the latest version of Ubuntu or upgrades to the newest release have not yet been enabled.
Please Note: If you are trying to upgrade to an interim release in future (such as the upcoming Ubuntu 22.10). You may need to change your Update settings for the prompt to appear. See ‘Upgrading to interim releases’ at the end of this tutorial.
If the Software Updater finds additional updates, install them prior to upgrading and restart your machine if needed.
Once you have no additional updates to apply. Click Upgrade… to proceed.
3. Follow the upgrade flow
From this point on, the upgrade UI will guide you through the process. First you will see a link to the release notes for the target release, detailing the newest features, improvements and known issues.
Click Upgrade to continue.
This will take you to an overview window showing you the progress of the upgrade.
As this progresses through the stages you will receive some additional prompts to progress once the upgrade requirements have been gathered.
Click Start Upgrade to continue.
To prevent the OS locking during the process, the lock screen will be disabled.
Click Close to continue.
Once the newest packages have been installed you’ll be prompted to remove the obsolete packages from the previous Ubuntu release.
You can choose to keep them, but by default it’s okay to click Remove to progress.
Despite the warning that removing packages can take several hours, this is extremely unlikely and after a minute or two you will be prompted to restart your system to complete the upgrade.
Click Restart Now to complete the upgrade
4. Enjoy your shiny new Ubuntu!
That’s it! Your machine may be slower to reboot during this final step as it completes the initial configuration but after that you’ll be up and running with the latest release of Ubuntu. We hope you enjoy all the new features and functionality it has to offer!
Help is always at hand.
If you have any issues with your upgrade process, or get stuck along the way, you can always reach out to our community.
5. (Optional) Upgrading to interim releases
Ubuntu 22.04 LTS is a Long Term Supported release and recommended for users looking for a stable development environment. Interim releases give users a chance to preview new features and updates ahead of the next LTS release. Interim releases are supported for 9 months and designed for users who want access to the lasted and greatest in Ubuntu.
If you want to be prompted to upgrade to the next interim release — Ubuntu 22.10 — which will be available later this year then you can enable it in the ‘Software & Updates’ app.
Navigate to the ‘Updates’ tab and change the menu option titled ‘Notify me of a new Ubuntu version’ to For any new version.
With this setting applied you will receive the same upgrade prompt for Ubuntu 22.10 as we saw at the beginning of this tutorial, once it has been officially released.