Outils pour utilisateurs

Outils du site


issue133:tutoriel1

Ceci est une ancienne révision du document !


Ah, that time of year is here again. A new Ubuntu release. There are typically two thoughts on updating; fresh and upgrade. This article will focus on the upgrade. The rolling upgrade can be time consuming though, downloading all those new packages. What if I told you that we can speed up our upgrade to 18.04.

Well we can; using apt-fast we can make your updates go about 30% faster. While I am thinking about it, here is a link to the github page: https://github.com/ilikenwf/apt-fast. But for those just reading on, what is apt-fast?

In short, apt-fast (ppa:apt-fast/stable) is a wrapper around apt-get or apt, and that uses aria2c to perform a multithreaded download of the needed updates. But what if we could use apt-fast to assist in a release upgrade - to upgrade to 18.04. Many user’s might be upgrading from 16.04 or 17.10, heck there might even be some upgrading from 14.04. Either way, guess what, you can use apt-fast to speed up your release upgrades.

While it’s possible to use this even with the upgrade GUI. I’ll focus on the command line tool; do-release-upgrade. So what do we need to do to perform such a miracle? Multiple terminals, that’s what. Or some tmux/screen knowledge**.

Let’s get started

First off, you’ll need two terminals. But may I suggest three. Consider it a safety thing. I’ll explain as we go.

Step 1: In Terminal 1, execute the do-release-upgrade command as in figure 1. One may notice I am passing a “-d” switch. This is to check the beta channels for an update. Use this switch at your own risk. Otherwise you’ll need to wait until after the final release.

Step 2: After you launch the command, your repository information will be updated to pull the new release. If you use PPAs on your system, you will see something like the image shown above, alerting you that they will be disabled. If you do not use PPAs, you may move on to Step 3.

When you see the prompt, acknowledge it by pressing the “enter” key. The update will now refresh to the new release repos.

Step 3: This is very important if you are going to speed up the release upgrade. When you see what is shown in the image below, DO NOTHING.

When you see this prompt, it is time to move to a new terminal. Proceed to Step 4.

Step 4: In a new terminal window. Enter the dist-upgrade command as shown above.

NOTE: Do not add the “-y” flag to this command.

When you hit enter, all the required packages for the release upgrade will be downloaded using the aria2c multithreaded download manager. Your terminal will look like the image below.

Step 5: This is a good time to open a third terminal and keep it in focus. It’s really easy to mess this up, and this helps to prevent other issues. Off jog the window a bit so you can see when the dist-upgrade command is done running. When it looks like the image top right, proceed to the next step. Remember DO NOTHING…

Step 6: When the dist-upgrade command is finished downloading, you may close your safety terminal. In the terminal representative of Figure 7, enter “n”. That’s right, we do not want to continue. Why?

Other things happen in the do-release-upgrade command; such as removing obsolete packages. We want to take advantage of this. So enter “n” and close the terminal. Now we come “full circle” to terminal 1.

That’s right, we are now ready to proceed with the upgrade. Enter “y”. Here’s what will happen next. The system will attempt to download the required packages and notice that they are already downloaded. So then it will commence with the upgrade and start installing packages.

This is where your system will dictate when you will finish upgrading as CPU, RAM, drive speed, all come into play. At the end of the package installation, you will be prompted to remove obsolete packages. Then you will be prompted to reboot the system to finish the upgrade.

Congratulations, not only have you now learned how to speed-up the release upgrade. But you have also made it through my first article. So thanks for reading. My hope is that you like the extra bump in speed, and add this process to your 6-month or 3-year update plans. A couple of notes before I let you go.

Notes

• Try this in a VM before a physical system, remember snapshots. Get familiar with the flow. • Remember your PPAs are disabled. • This works with the upgrade GUI. Follow the prompts to know when to perform the dist-upgrade.

Thanks for reading, and enjoy the following flow as a cheat-sheet.

Cheat Sheet

Terminal 1: • Execute the do-release-upgrade command: • sudo do-release-upgrade • If you’re bold, you may also do this with the do-release-upgrade -d, but I suggest you try this first in a VM to get comfortable with the process. • If you do not use PPAs, continue to the next bullet. If you do use PPAs, you’ll eventually see a prompt that they will be disabled. Hit yes and let the process continue.

• ALERT. Had to get your attention. You’ll eventually see a large prompt saying: • X number of packages are obsolete • Y number of packages are new • Z number of packages will be updated. • STOP STOP, just read. • Then a prompt saying “press y to continue”.

• DON’T do anything, Move on to the next section.

Terminal 2:

• Execute the apt-fast command: • sudo apt-fast dist-upgrade • DO NOT use the “-y”. But go ahead and hit enter once.

• This is where I suggest a third terminal and put it in focus. It’s far too easy to mess things up. And I’m here to say this is safe.

Terminal 3:

• When you open the third terminal, move it a bit out of the way so that you can SEE terminal 2.

• Just wait, since terminal 2 is downloading multithread style, it should only take a few minutes.

• When you notice Terminal 2 finished, it will be prompting you to continue. The ANSWER is no.

Terminal 2:

• Return to terminal 2 and enter ‘n’ to leave the apt-fast command. That was easy. Let’s go back to terminal 1.

Terminal 1:

• Now we’re ready to continue with the release upgrade.

• Enter ‘y’ to continue.

• Here’s what will happen: • The next step for do-release-upgrade is to download all required packages. But we just did that using apt-fast. • So, when do-release-upgrade notices the cache is up-to-date, it will casually move on to the next step; Installing the packages… • This is where apt-fast may not seem like a winner. But it is. While installing the updates, this part of the process is plagued by your hardware: RAM, CPU, drive speed. • At the end of this, you;ll be prompted to remove obsolete software, go ahead and enter “y”. • At the end of this, you’ll be prompted to reboot the system, go ahead and enter “y”

issue133/tutoriel1.1527323546.txt.gz · Dernière modification : 2018/05/26 10:32 de auntiee