Last active
December 15, 2022 20:20
-
-
Save remlapmot/38648d5339253324504ecba8449c3039 to your computer and use it in GitHub Desktop.
Update packages on a Debian based Linux distro, e.g. Ubuntu, using apt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # update Ubuntu packages as root | |
| sudo apt-get update && sudo apt-get --with-new-pkgs upgrade -y | |
| # Ensure /usr/lib/R/site-library is writeable | |
| sudo chmod 777 -R /usr/lib/R/site-library | |
| # Update R packages as root | |
| sudo R -q -e "update.packages(ask = FALSE)" | |
| # Update R packages as user | |
| sudo -u tom R -q -e "update.packages(ask = FALSE)" | |
| # Update Stata MP 17 | |
| echo -e "update all\n" > update-stata.do | |
| sudo /usr/local/stata17/stata-mp < update-stata.do | |
| # Run -ado update- as user | |
| echo -e "ado update, update\n" > ado-update.do | |
| stata-mp < ado-update.do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Equivalent script on macOS.