#!/usr/bin/env python # coding: utf-8 # # Table of Contents #
# # 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!