Updating a Specific Package in Linux Mint or Ubuntu

Have you ever tried to update a particular package looking for bug fix. Here’s how to update a particular package in any Linux Debian derivative like Ubuntu or Mint

sudo apt-get install package

this will install any dependencies. Or you could use this little script that checks wheather the package is installed or not and does the update (you need to runn as sudo): sudo script package

#!/bin/bash
#updating package
#script should run with sudo priviliges
 
if [ -z "$1" ]; then
	echo USAGE: $(basename $0) packageName
	exit 1
fi
 
#check if package is installed
dpkg -s "$1" | grep installed 2>/dev/null
 
if [ $? -eq 0 ]; then
	apt-get install -y --force-yes "$1"
else
	echo package "$1" not installed
fi
Share This!

Leave a Reply

Your email address will not be published.