Linux

Install all updates besides select few Ubuntu Server

Install all updates besides select few Ubuntu Server

Recently, in working on updating an Ubuntu server for a client that was running a customized version of Nginx compiled with Google Pagespeed and other mods, we wanted to install all the updates besides any that touched Nginx as we did not want any changes to Nginx to be implemented on the server. ย The client had made the mistake before of just running a blanketย apt-get updateย andย apt-get upgrade before checking to see what the updates affected and essentially broke the webserver running nginx that was working before the updates as the updates replaced many of the critical files and configs of the compiled nginx instance.

Below is a couple of very useful commands that administrators can use to essentially see what updates are going to be installed when running the update and upgrade commands as well as the command that you can use to place certain updatesย on hold which tells the updater and installer that you don’t want to install those particular updates.

ubuntuupdates

See which updates are going to be installed:

apt-get -s dist-upgrade | grep "^Inst"

 

Mark certain updates to be on hold to keep from installing:

sudo apt-mark hold <package>

With the above command for instance you can place nginx update from installing:

sudo apt-mark hold nginx

You can effectively use the above command via the shell to see which updates are going to be installed and then place on hold those updates that you do not want to install. ย It is an effective and easy way to control your Ubuntu server environment without breaking critical services with updates modifying configs, etc.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.