Re: Comments on upgrade steps from one version of Debian to another

2022-08-21 Thread tomas
On Sun, Aug 21, 2022 at 06:34:10PM -0400, John Boxall wrote:

[...]

> Chuck,
> I found the DebianUpgrade wiki page and all of the commands use "apt". When
> I have used "apt-get" it regularly pumps out a disclaimer that it doesn't
> have a good/reliable cli for scripting.

No, it's the other way around. Apt is the one doing this warning:

 - apt-get is the "older" interface. Many things are missing or confusing
   for newbies (why "apt-get install foo" but "apt-file search bar"?).
   It has been embedded in many scripts (e.g. "apt-get ... | sed -e 
's/foo/bar'),
   thus changing its output format is out (those scripts would break)

 - apt is the "newer" interface ("apt install foo", "apt install bar"). Its
   authors don't want yet to commit to a fixed interface, thus the warning.
  
> I'm going to look at aptitude a little more.

Yet another interface. Its conflict resolution algorithm is way more 
sophisticated.
Personally, I've perceived this sometimes as an advantage, sometimes as a
disadvantage.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Comments on upgrade steps from one version of Debian to another

2022-08-21 Thread John Boxall

On 2022-08-20 19:27, Chuck Zmudzinski wrote:


You can use apt, apt-get, or aptitude to run the commands that do most of the work, and in your script you chose apt for that task. I recall reading that they do not all use the same algorithm to determine which packages to upgrade and in what order, at each stage of the upgrade. I think I read somewhere that aptitude has the best algorithm, but apt-get is more suitable for a script. 




Chuck,
I found the DebianUpgrade wiki page and all of the commands use "apt". 
When I have used "apt-get" it regularly pumps out a disclaimer that it 
doesn't have a good/reliable cli for scripting.


I'm going to look at aptitude a little more.

--
Regards,

John Boxall



Re: Comments on upgrade steps from one version of Debian to another

2022-08-21 Thread John Boxall

On 2022-08-21 10:19, Andrew M.A. Cater wrote:


apt-get autoremove



I will definitely be adding this step.



apt-get is definitely recommended for this at the moment, I think, and it >


When I have seen other discussions about update/upgrade/etc, it was 
"apt" that people tended to recommend versus "apt-get". I was using 
apt-get in the original version, and switched to apt after reading those 
posts. I'll be creating several versions to see what works best.



All the very best, as ever,

Andy Cater
  



Thanks and likewise!

--
Regards,

John Boxall



Re: Comments on upgrade steps from one version of Debian to another

2022-08-21 Thread John Boxall

On 2022-08-21 10:04, john doe wrote:


The lines for the security mirror has changed on Bullseye.



Thank you! I will be sure to add that check in.



The script does not bail out on command failure, you might want to
takecare of that if you automate this process by way of a script.
That is all I can say on the cmds.



Yes, there is a bail out at each step. "pipefail" was a good thing to 
learn about.



If I may, for a fiew servers I would do it manually instead of blindly
using a bunch of commands.

I have one file/NFS server, a laptop and a desktop, so not a lot to 
worry aboutand at my leisure.



If you need to automate this process, you should familiorize yourself
with something like Ansible or in anycase a more robust solution.



Thanks, I will look at ansible.

--
Regards,

John Boxall



Re: Comments on upgrade steps from one version of Debian to another

2022-08-21 Thread Andrew M.A. Cater
On Sun, Aug 21, 2022 at 04:04:02PM +0200, john doe wrote:
> On 8/20/2022 9:48 PM, John Boxall wrote:
> > I created an upgrade script based on something I found a few years ago
> > that indicated the steps to follow to upgrade from one version of Debian
> > to another (e.g. Buster 10 to Bullseye 11). As I am going to need to run
> > this script at some point (I am still running Buster/10 on my systems),
> > I thought I'd ask the Debian user brain trust to comment/critique the
> > scripted steps. So here they are:
> > 
> > 
> > ### Start
> 
> 
> 
> > (I don't even have this part started yetdidn't know I needed it the
> > last time I ran it)
> > #
> 
> The lines for the security mirror has changed on Bullseye.
> 
> 
> 
> > ### End
> > 
> > Thoughts/critique/criticism/flames/etc
> > 
> 
> The script does not bail out on command failure, you might want to
> takecare of that if you automate this process by way of a script.
> That is all I can say on the cmds.
> 
> If I may, for a fiew servers I would do it manually instead of blindly
> using a bunch of commands.
> 
> If you need to automate this process, you should familiorize yourself
> with something like Ansible or in anycase a more robust solution.
> 
> For upgrading Buster to Bullseye, I used:
> 
> $ apt-get update
> $ apt-get upgrade
> $ apt-get full-upgrade
> 
> 
> For better or worse, Debian let you upgrade or reinstall from scratch.
> 
> --
> John Doe
>

For more than one version - since Debian doesn't allow you to skip versions 
well - here is a process that may single step you through two or more
versions..

Read the release notes :)

apt-get update ; apt-get dist-upgrade [on old version].

[Just to make absolutely sure you're completely up to date.]

apt-get autoremove

[To remove any cruft.]

Change /etc/apt/sources.list stanzas to the next version [buster->bullseye]

apt-get update ; apt-get upgrade

[Safe upgrade - resolve all errors.]

Reboot.

apt-get dist-upgrade

[Reboot - check to see new kernel comes up, for example]

apt-get autoremove 

You _will_ need to modify this if there are major changes between versions
if there's a breakage / if sources list changes.

apt-get is definitely recommended for this at the moment, I think, and it
should really be a process you check over manually because there's a lot
of scope for things to go wrong.

Downgrades / backgrades are NOT supported - so it's worth stepping through
in single steps and checking output, IMHO.

All the very best, as ever,

Andy Cater
 



Re: Comments on upgrade steps from one version of Debian to another

2022-08-21 Thread john doe

On 8/20/2022 9:48 PM, John Boxall wrote:

I created an upgrade script based on something I found a few years ago
that indicated the steps to follow to upgrade from one version of Debian
to another (e.g. Buster 10 to Bullseye 11). As I am going to need to run
this script at some point (I am still running Buster/10 on my systems),
I thought I'd ask the Debian user brain trust to comment/critique the
scripted steps. So here they are:


### Start





(I don't even have this part started yetdidn't know I needed it the
last time I ran it)
#


The lines for the security mirror has changed on Bullseye.




### End

Thoughts/critique/criticism/flames/etc



The script does not bail out on command failure, you might want to
takecare of that if you automate this process by way of a script.
That is all I can say on the cmds.

If I may, for a fiew servers I would do it manually instead of blindly
using a bunch of commands.

If you need to automate this process, you should familiorize yourself
with something like Ansible or in anycase a more robust solution.

For upgrading Buster to Bullseye, I used:

$ apt-get update
$ apt-get upgrade
$ apt-get full-upgrade


For better or worse, Debian let you upgrade or reinstall from scratch.

--
John Doe



Re: Comments on upgrade steps from one version of Debian to another

2022-08-20 Thread John Boxall

On 2022-08-20 16:24, Charles Curley wrote:


I would not do that as a script. You have a good recipe there, but I
would run each step manually so I could correct errors, adjust
configuration files, and otherwise shoot trouble as it appears.



I did a lot of testing the first time I ran the script and feel that I 
can get away with it. I do have a complete log of all command output.



You should probably run 'apt auto-remove' from time to time in there as
needed.

That is a good point. I'll probably through at least one in before 
updating the sources.list files. Maybe one at the end as well.


--
Regards,

John Boxall



Re: Comments on upgrade steps from one version of Debian to another

2022-08-20 Thread John Boxall

On 2022-08-20 19:27, Chuck Zmudzinski wrote:

On 8/20/2022 3:48 PM, John Boxall wrote:

I created an upgrade script based on something I found a few years ago
that indicated the steps to follow to upgrade from one version of Debian
to another (e.g. Buster 10 to Bullseye 11). As I am going to need to run
this script at some point (I am still running Buster/10 on my systems),
I thought I'd ask the Debian user brain trust to comment/critique the
scripted steps. So here they are:


### Start
apt -y install aptitude
aptitude search \'~o\'
apt update
apt -y upgrade
apt -y full-upgrade
dpkg -C
apt-mark showhold
#
Update sources.list
#
Update files in sources.list.d
(I don't even have this part started yetdidn't know I needed it the
last time I ran it)
#
apt-get check
apt update
apt list --upgradable
apt-get check
apt -y upgrade
apt -y full-upgrade
aptitude search \'~o\'
### End

Thoughts/critique/criticism/flames/etc



Hi John, here are my suggestions:

You can use apt, apt-get, or aptitude to run the commands that do most of the 
work, and in your script you chose apt for that task. I recall reading that 
they do not all use the same algorithm to determine which packages to upgrade 
and in what order, at each stage of the upgrade. I think I read somewhere that 
aptitude has the best algorithm, but apt-get is more suitable for a script. I 
don't remember if there are advantages or disadvantages to using apt. So you 
should do a little research to try to find the most up-to-date information 
about the pros and cons of the different apt related tools. The Debian wiki has 
a page on that, I think. Also, you might want to make sure you record the 
upgrade session in a logfile so you can examine what the script actually did in 
case there are problems. And of course, backup or take a snapshot beforehand so 
you can restore the system back to a working state in case things get broken 
badly.

HTH,

Chuck



Thanks Chuck, very good points.

apt always tells you that it isn't reliable in a script, which I am 
aware of, however, I'll check the wiki. I "think" that applies to 
apt-get as well. I've never used aptitude for anything but the one 
command (it was one of those recommended on the web page I saw), but 
will investigate it further.


I use "tee" extensively in the script and record all of the command output.

As for a backup, I will be cloning the drive to a backup and performing 
a test update to that drive first.


My only real concern is the non-Debian software that I've installed over 
the years. We'll see how it goes.


--
Regards,

John Boxall



Re: Comments on upgrade steps from one version of Debian to another

2022-08-20 Thread Chuck Zmudzinski
On 8/20/2022 3:48 PM, John Boxall wrote:
> I created an upgrade script based on something I found a few years ago 
> that indicated the steps to follow to upgrade from one version of Debian 
> to another (e.g. Buster 10 to Bullseye 11). As I am going to need to run 
> this script at some point (I am still running Buster/10 on my systems), 
> I thought I'd ask the Debian user brain trust to comment/critique the 
> scripted steps. So here they are:
>
>
> ### Start
> apt -y install aptitude
> aptitude search \'~o\'
> apt update
> apt -y upgrade
> apt -y full-upgrade
> dpkg -C
> apt-mark showhold
> #
> Update sources.list
> #
> Update files in sources.list.d
> (I don't even have this part started yetdidn't know I needed it the 
> last time I ran it)
> #
> apt-get check
> apt update
> apt list --upgradable
> apt-get check
> apt -y upgrade
> apt -y full-upgrade
> aptitude search \'~o\'
> ### End
>
> Thoughts/critique/criticism/flames/etc
>

Hi John, here are my suggestions:

You can use apt, apt-get, or aptitude to run the commands that do most of the 
work, and in your script you chose apt for that task. I recall reading that 
they do not all use the same algorithm to determine which packages to upgrade 
and in what order, at each stage of the upgrade. I think I read somewhere that 
aptitude has the best algorithm, but apt-get is more suitable for a script. I 
don't remember if there are advantages or disadvantages to using apt. So you 
should do a little research to try to find the most up-to-date information 
about the pros and cons of the different apt related tools. The Debian wiki has 
a page on that, I think. Also, you might want to make sure you record the 
upgrade session in a logfile so you can examine what the script actually did in 
case there are problems. And of course, backup or take a snapshot beforehand so 
you can restore the system back to a working state in case things get broken 
badly.

HTH,

Chuck



Re: Comments on upgrade steps from one version of Debian to another

2022-08-20 Thread Charles Curley
On Sat, 20 Aug 2022 15:48:53 -0400
John Boxall  wrote:

> Thoughts/critique/criticism/flames/etc

I would not do that as a script. You have a good recipe there, but I
would run each step manually so I could correct errors, adjust
configuration files, and otherwise shoot trouble as it appears.

You should probably run 'apt auto-remove' from time to time in there as
needed.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/



Comments on upgrade steps from one version of Debian to another

2022-08-20 Thread John Boxall
I created an upgrade script based on something I found a few years ago 
that indicated the steps to follow to upgrade from one version of Debian 
to another (e.g. Buster 10 to Bullseye 11). As I am going to need to run 
this script at some point (I am still running Buster/10 on my systems), 
I thought I'd ask the Debian user brain trust to comment/critique the 
scripted steps. So here they are:



### Start
apt -y install aptitude
aptitude search \'~o\'
apt update
apt -y upgrade
apt -y full-upgrade
dpkg -C
apt-mark showhold
#
Update sources.list
#
Update files in sources.list.d
(I don't even have this part started yetdidn't know I needed it the 
last time I ran it)

#
apt-get check
apt update
apt list --upgradable
apt-get check
apt -y upgrade
apt -y full-upgrade
aptitude search \'~o\'
### End

Thoughts/critique/criticism/flames/etc

--
Regards,

John Boxall