Ad
Apt-get Update, Dist-upgrade, Autoremove, Autoclean In A Single Sudo Command
My usual command for keeping the machine up to date is rather verbose, and it can result in more than one password prompt if any command takes a long time:
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean
I'd like to shorten this down to one command (preferably without using a global alias).
Solution based on @amra's answer and another tip:
sudo sh -c 'apt-get update && apt-get upgrade --yes && if [ -f /var/run/reboot-required ]; then echo You should reboot; fi'
Ad
Answer
Try
sudo sh -c "apt-get -y update;apt-get -y dist-upgrade;apt-get -y autoremove;apt-get -y autoclean"
Ad
source: stackoverflow.com
Related Questions
- → OctoberCMS error in frontend - frontend is not accessible firing error "Default value for parameters with a class type hint can only be NULL"
- → Queue::push Unable to find Class
- → .composer/config file permission denied using laravel
- → Laravel 5 pages are not being displayed on live server
- → Laravel 5.2 not working with vagrant homestead php 7
- → Intellij plugin: AirBnB ESLint w/ React
- → Fatal error: Class 'MongoDate' not found when using mongodb php driver 1.1.2 and PHP 7.0.2 - Laravel 5.1
- → Composer could not find a composer.json file in /var/www/html
- → undefined method `react_component' on ubuntu server
- → An error occurred while installing pg (0.21.0), and Bundler cannot continue
- → How redirect from /file.php to /file on nginx?
- → Laravel uploading file Unable to write in directory
- → Application works less than 24 hours and alway throws an error
Ad