Saturday, 12 January 2013

cli ways to prevent certain package upgrade and get repository package version

i stumbled upon 2 things which i am going to share with you. These i got from google search.

1st) I was looking for ways to make the ubuntu not to upgrade the thunderbird package. In previous post we saw how to achive this in GUI mode. The problem with GUI mode is that it works only in GUI , if you use command line tools then GUI rules wont apply. So i tried

# apt-get upgrade

and it lists thunderbird in it and i looked for option to disable thunderbird even through cli tools. So below describes that procedure.

# echo hold | sudo dpkg --set-selections

The above line does the job. So i did my thunderbird stop upgrade as follows:

#dpkg-query -W \*thunderbird\* | cut -f1 > 1.lst
# for i in $(cat 1.lst)
echo $i hold | dpkg --set-selections

#apt-get update

Now thunderbird package does not appear even in cli (apt-get) upgrade list.

2nd) The other thing i wanted to see was a way to get the package version in

apt-get upgrade

When you issue the above command then it only list the packages that are going to be upgraded and not the version number it is upgrading to, that way yum does the job. But there is a way to see the package version in repos and package version currently. The good part is that it need not be a package in upgrade list . It can used to compare the latest version in each branch in repository and your PC.

To see package version in your PC:

dpkg-query -W package

To see package version in the repository:

apt-cache madison package

This madison option is awesome.

No comments:

Post a Comment