try:
apt search libxml2
this command show search from any evidence: repositories and installed packages.
so if you will see for example for trusty:
libxml2/trusty-updates,trusty-security,now 2.9.1+dfsg1-3ubuntu4.3 amd64
[installed]
GNOME XML library
libxml2-dbg/trusty-updates,trusty-security 2.9.1+dfsg1-3ubuntu4.3 amd64
Debugging symbols for the GNOME XML library
libxml2-dev/trusty-updates,trusty-security,now 2.9.1+dfsg1-3ubuntu4.3 amd64
[installed,automatic]
Development files for the GNOME XML library
so, obviously, if you see this output you are have alot of chances to install version.
However if you need the package strictly by version, try indicate the version alike this:
sudo apt-get install libxml2=2.9.1+dfsg1-3ubuntu4.3
sudo apt-get install libxml2-dbg=2.9.1+dfsg1-3ubuntu4.3
sudo apt-get install libxml2-dev=2.9.1+dfsg1-3ubuntu4.3
OR by indicating target repository:
sudo apt-get install libxml2/precise libxml2-dbg/precise libxml2-dev/precise
After it’s installed, run the following command to hold your installed version, preventing the package manager from automatically updating it in the future:
sudo echo "libxml2 hold" | sudo dpkg –set-selections
With --no-remove
option apt-get
will exit installation process anytime without any prompts if any packages are to be removed:
sudo apt-get install --no-remove libxml2=2.7.8.dfsg-5.1ubuntu4.9
Other goody: --no-install-recommends
which claim the apt-get
do not consider recommended packages as a dependency for installing.
Read apt-get precise pangolin manpages
Hope it help you.