#!/usr/bin/env python # coding: utf-8 # # Table of Contents #

1  Demonstration of running a Jupyter notebook with sudo rights
1.1  Without sudo rights
1.2  With sudo rights
1.3  Conclusion
# # Demonstration of running a Jupyter notebook with sudo rights # ## Without sudo rights # # The next cells were first ran when Jupyter was not running with sudo rights. # In[5]: get_ipython().system('apt update') # In[6]: get_ipython().system('sudo apt update') # As we see here, using `sudo ...` asks for a password, but it doesn't work from Jupyter. # ## With sudo rights # The next cells were then ran when Jupyter was running with sudo rights. # In[6]: get_ipython().system('apt update') # It works! # ## Conclusion # # It works!