New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run automatic updates in non-interactive mode #410

Merged
merged 3 commits into from Dec 3, 2018

Conversation

Projects
None yet
2 participants
@Yvan-Masson
Contributor

Yvan-Masson commented Nov 14, 2018

When running automatic updates, this prevents debconf to ask things to the user
and to wait endlessly (because it is not possible for the user to answer).

When this happened, some package were left unconfigured and user had to open a
terminal to type "sudo dpkg --configure -a" to be able to install/update
software again.

See #376

Run automatic updates in non-interactive mode
When running automatic updates, this prevents debconf to ask things to the user
and to wait endlessly (because it is not possible for the user to answer).

When this happened, some package were left unconfigured and user had to open a
terminal to type "sudo dpkg --configure -a" to be able to install/update
software again.
@Yvan-Masson

This comment has been minimized.

Contributor

Yvan-Masson commented Nov 14, 2018

This code has been tested against grub-pc issue mentioned in #376

However, there is no instruction given to debconf about what to do with a new configuration file (my test shown that debconf seems conservative, it did not update /etc/grub/default). To be more precise about what should be done (be conservative or not), this code should use DPKG option --force-confhold or --force-confdef, but I don't know enough to do it myself.

@clefebvre

This comment has been minimized.

Member

clefebvre commented Nov 19, 2018

Hi @Yvan-Masson,

Well spotted. I think the intended purpose is to be non-interactive, in most cases.

Can you do following changes?

  • Whenever --yes is used, assume we're noninteractive and set DEBIAN_FRONTEND in the env.
  • In that case, also pass --force-confnew (we can't ask the user about this, and it's better to just use what comes with the new version by default. If something needs adjusting the OS takes care of it. If something was changed by the user itself, the old version is still available as .dpkg-old). The rationale here, is that in either case something bad can happen.... (and in both cases we've got timeshift of course)... with confnew, worst case scenario, we lose a user change in the configuration. With confold, worse case scenario, the new package doesn't work correctly.

If you want, you can add a --keep-configuration argument (and have it at False by default) that people can use for --force-confold to be used instead.

@Yvan-Masson

This comment has been minimized.

Contributor

Yvan-Masson commented Nov 21, 2018

Hi,

I can do those modifications, but:

  • It will not be done before next week at least;
  • If possible on your side, I would really appreciate a procedure to test --force-confnew (which file to modify, which package to upgrade): the tests I have done with this parameter were not satisfactory.

Regards,
Yvan

Yvan-Masson added some commits Nov 28, 2018

Merge pull request #1 from linuxmint/master
merging master code
Use dpkg option "--force-confnew" when running automatic updates.
Allow usage of dpkg option "--force-confold".
@Yvan-Masson

This comment has been minimized.

Contributor

Yvan-Masson commented Nov 29, 2018

Hi @clefebvre,

Here is another proposal. I did not have time to test it properly, I will let you know once it is done.

Regards,
Yvan

@Yvan-Masson

This comment has been minimized.

Contributor

Yvan-Masson commented Nov 30, 2018

Hi,

I can confirm that this works. How did i test this:

  1. Install Linux Mint from linuxmint-19-cinnamon-64bit-v2.iso (dated from 2018-10-01 on my filesystem)
  2. Apply my mintupdate modifications
  3. Modify line 69 in /etc/apparmor.d/usr.bin.firefox to anything
  4. Run automatic update (can be enforced by deleting /var/spool/anacron/cron.daily and then starting anacron.service)

firefox package is updated, new version of /etc/apparmor.d/usr.bin.firefox is installed and old version with my manual modification still exists in /etc/apparmor.d/usr.bin.firefox.dpkg-old (the exact suffix comes from my memory and might not be exact).

I also applied the same test but modifying the last step (4): run /usr/bin/mintupdate-cli upgrade --refresh-cache --yes --keep-configuration > /var/log/mintupdate.log 2>&1. This time /etc/apparmor.d/usr.bin.firefox still contains my manual modification and /etc/apparmor.d/usr.bin.firefox.dpkg-dist contains the new file.

Regards,
Yvan

@clefebvre

This comment has been minimized.

Member

clefebvre commented Dec 1, 2018

Thanks @Yvan-Masson

@clefebvre clefebvre merged commit aa92196 into linuxmint:master Dec 3, 2018

1 check failed

Codacy/PR Quality Review Not up to standards. This pull request quality could be better.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment