Dear Erik,
Next time you post here, please provide the link to the given demo you are modifying (or post the code here.
I am guessing you are referring to: https://fenicsproject.org/pub/tutorial/sphinx1/._ftut1006.html
The issue you have in the demo can be fixed by:
prm = LinearVariationalSolver.default_parameters()
if linear_solver == 'Krylov':
prm["linear_solver"] = 'gmres'
prm["preconditioner"] = 'ilu'
prm["krylov_solver.absolute_tolerance"] = abs_tol
prm["krylov_solver.relative_tolerance"] = rel_tol
prm["krylov_solver.maximum_iterations"] = max_iter
else:
prm["linear_solver"] = 'lu'
These has been quite a few changes since the demos were released, and many of the changes are listed in the Changelog