paapereira.xyz

Install a specific package version

Yesterday, after a partial upgrade in my Ubuntu 12.10 installation, git was uninstalled.

After the upgrade I tried to re-install it and got the following error:

1sudo apt-get install git
 1Reading package lists... Done
 2Building dependency tree   
 3Reading state information... Done
 4Some packages could not be installed. This may mean that you have
 5requested an impossible situation or if you are using the unstable
 6distribution that some required packages have not yet been created
 7or been moved out of Incoming.
 8The following information may help to resolve the situation:
 9The following packages have unmet dependencies:
10**git : Depends: git-man (< 1:1.8.0.3-.) but 1:1.8.1.1-1~ppa0~quantal2 is to be installed**
11E: Unable to correct problems, you have held broken packages.

Basically git depended on git-man version 1.8.0.3, but the APT package handling utility was trying to install the newer version 1.8.1.1.

But how to install a specific version?

After some digging I found this tip.

I prefer the terminal option.

1sudo apt-cache showpkg git-man
 1Package: git-man
 2Versions:
 3**1:1.8.1.1-1~ppa0~quantal2** (/var/lib/apt/lists/ppa.launchpad.net_git-core_ppa_ubuntu_dists_quantal_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 4 Description Language:
 5         File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary-amd64_Packages
 6         MD5: 0c79f507738c0cb72351c8ae551ee47d
 7 Description Language: en
 8         File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_i18n_Translation-en
 9         MD5: 0c79f507738c0cb72351c8ae551ee47d
10**1:1.8.0.3-0ppa1~quantal1** (/var/lib/apt/lists/ppa.launchpad.net_git-core_ppa_ubuntu_dists_quantal_main_binary-amd64_Packages)
11 Description Language:
12         File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary-amd64_Packages
13         MD5: 0c79f507738c0cb72351c8ae551ee47d
14 Description Language: en
15         File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_i18n_Translation-en
16         MD5: 0c79f507738c0cb72351c8ae551ee47d
17(...)
1sudo apt-get install git-man=1:1.8.0.3-0ppa1~quantal1
1sudo apt-get install git

#Linux #Ubuntu #Ubuntu 12.10 #Quantal Quetzal #Tags/APT #Git