Linux

Linux


How to upgrade a single package using apt-get? 


apt-get install --only-upgrade <packagename>


How to prevent updating of a specific package?


Hold a package:


sudo apt-mark hold <package-name>


Remove the hold:


sudo apt-mark unhold <package-name>


Show all packages on hold:


sudo apt-mark showhold


### To downgrade you have to do a command like


sudo apt-get install pkg_name=version



175 down vote favorite


How do I check if a package is installed on my server?


Apt list - list of all installed packages


apt list <package> -specific package


If installed it'll print something like (with [installed] at the end of the line):


$ apt -qq list awscli awscli/stable,now 1.4.2-1 all [installed]


If not installed the output will be:


$ apt -qq list awscli awscli/stable 1.4.2-1 all


Dpkg -l | less



Report Page