7fh3498f
Posts: 28
Joined: Sat Apr 14, 2018 10:09 am

Simple question about updating Raspbian after new version released...

Mon Apr 23, 2018 4:57 pm

Hi guys.

i started my journey with linux when Raspbian was released on 2018-03-13. Now we have 2018-04-18 available. My question is...

To get all the functionalities from new image do i have to reflash my SD card and configure everything from scratch?

To update my Pi i use:

Code: Select all

sudo apt update
sudo apt full-upgrade -y
sudo apt-get dist-upgrade
sudo apt autoremove
sudo apt autoclean
That will do that for me or something might be missing? I am no asking in particular for 2018-04-18 release as this seems to be small update but would like to know in future if my way of updating will provide every single function/fix as new would do... Thank guys.

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Simple question about updating Raspbian after new version released...

Mon Apr 23, 2018 5:11 pm

7fh3498f wrote:
Mon Apr 23, 2018 4:57 pm
Hi guys.

i started my journey with linux when Raspbian was released on 2018-03-13. Now we have 2018-04-18 available. My question is...

To get all the functionalities from new image do i have to reflash my SD card and configure everything from scratch?

To update my Pi i use:

Code: Select all

sudo apt update
sudo apt full-upgrade -y
sudo apt-get dist-upgrade
sudo apt autoremove
sudo apt autoclean
In most cases that will be sufficient. In fact you don't need to do all of those. The minimum required is

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade -y
You can add

Code: Select all

sudo apt-get clean
to get rid of the downloaded package files once they have been installed, and

Code: Select all

sudo apt-get --purge autoremove
to get rid of anything that is no longer required, if you want.

The main difference between doing an upgrade and installing a new image is that if an extra package has been included in the new image, and isn't referenced by any existing (updated) packages in the old image, then it won't get installed.

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Simple question about updating Raspbian after new version released...

Mon Apr 23, 2018 5:17 pm

The main difference between doing an upgrade and installing a new image is that if an extra package has been included in the new image, and isn't referenced by any existing (updated) packages in the old image, then it won't get installed.
(For the benefit of the readers, including me)

Can you give a real life scenario where this would present?

(And, does this scenario explain why people recommend the clean install - is this the sort of thing that people run into when they do an upgrade-to-latest-Toy-story-character?)
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
rpdom
Posts: 14722
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Simple question about updating Raspbian after new version released...

Mon Apr 23, 2018 6:26 pm

n67 wrote:
Mon Apr 23, 2018 5:17 pm
The main difference between doing an upgrade and installing a new image is that if an extra package has been included in the new image, and isn't referenced by any existing (updated) packages in the old image, then it won't get installed.
(For the benefit of the readers, including me)

Can you give a real life scenario where this would present?

(And, does this scenario explain why people recommend the clean install - is this the sort of thing that people run into when they do an upgrade-to-latest-Toy-story-character?)
It's not so likely to happen now, but the early images didn't have the "raspberrypi-*" packages installed, or they weren't quite settled in what they depended on, and upgrading from them did not cause them to be installed. (net-mods, gui, bootloaded etc).

They are in all the recent images and should pull in the new dependencies as required.

It could still happen that a new image has a completely new package with dependencies that the previous image didn't, but I think the RPF have better control over that now.

User avatar
HawaiianPi
Posts: 4453
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Simple question about updating Raspbian after new version released...

Mon Apr 23, 2018 6:35 pm

You don't need both apt full-upgrade and apt-get dist-upgrade, as they do the same thing.

So either use:

Code: Select all

sudo apt update && sudo apt full-upgrade -y
or if you prefer apt-get,

Code: Select all

sudo apt-get update && sudo apt-get dist-upgrade -y
but don't use both (it's redundant).

Also, the autoclean option only removes older, obsolete cached packages. If you want to really clean up the cruft, then use clean.
  • clean: clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
  • autoclean: clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to be maintained over a long period without it growing out of control.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
davidcoton
Posts: 3940
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Simple question about updating Raspbian after new version released...

Mon Apr 23, 2018 6:58 pm

7fh3498f wrote:
Mon Apr 23, 2018 4:57 pm
Hi guys.

i started my journey with linux when Raspbian was released on 2018-03-13. Now we have 2018-04-18 available. My question is...

To get all the functionalities from new image do i have to reflash my SD card and configure everything from scratch?
It is possible to upgrade Wheezy to Jessie, and/or Jessie to Stretch, but it is not recommended. There are instructions in the release announcements (blog, IIRC).
A new install is recommended to ensure that no unusual config can cause problems.
Note that the normal apt (or apt-get) commands alone are not sufficient, the source of the lists must also be changed.
7fh3498f wrote:
Mon Apr 23, 2018 4:57 pm
To update my Pi i use:

Code: Select all

sudo apt update
sudo apt full-upgrade -y
sudo apt-get dist-upgrade
sudo apt autoremove
sudo apt autoclean
That will do that for me or something might be missing? I am no asking in particular for 2018-04-18 release as this seems to be small update but would like to know in future if my way of updating will provide every single function/fix as new would do... Thank guys.
apt functions are the newer, CLI-orientated functions. The older apt-get equivalents are retained mainly for use in scripts (and therefore have different optimisations).
One recent upgrade changed the source lists, so a full upgrade (within a major release, eg Stretch) requires a repeat of

Code: Select all

sudo apt update
sudo apt upgrade
"full-upgrade" should only be required when "upgrade" alone shows some held-back packages. There are circumstances (beyond my full understanding) in which it can cause more problems than it solves.
Signature retired

Return to “Beginners”