How to install older package version on Ubuntu 18.04?

Hello, I'm running Ubuntu 18.04 and I would like to install libboost-python version 1.46. Currently I have installed version 1.65:

wakatana@local-machine:~$ dpkg -l | grep libboost-python
ii  libboost-python-dev                        1.65.1.0ubuntu1                              amd64        Boost.Python Library development files (default version)
ii  libboost-python1.65-dev                    1.65.1+dfsg-0ubuntu5                         amd64        Boost.Python Library development files
ii  libboost-python1.65.1                      1.65.1+dfsg-0ubuntu5                         amd64        Boost.Python Library

If I search for available libboost-python packages there is 1.46 version available:

wakatana@local-machine:~$ apt-cache policy libboost-python*
libboost-python1.58-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.62-dev:
  Installed: (none)
  Candidate: 1.62.0+dfsg-5
  Version table:
     1.62.0+dfsg-5 500
        500 http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
libboost-python1.60-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.54-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.48-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.52-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.46-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.50-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.42-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.65-dev:
  Installed: 1.65.1+dfsg-0ubuntu5
  Candidate: 1.65.1+dfsg-0ubuntu5
  Version table:
 *** 1.65.1+dfsg-0ubuntu5 500
        500 http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
libboost-python1.63-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.57-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.61-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.55-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.49-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python1.53-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
libboost-python-dev:
  Installed: 1.65.1.0ubuntu1
  Candidate: 1.65.1.0ubuntu1
  Version table:
 *** 1.65.1.0ubuntu1 500
        500 http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
libboost-python1.62.0:
  Installed: (none)
  Candidate: 1.62.0+dfsg-5
  Version table:
     1.62.0+dfsg-5 500
        500 http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
libboost-python1.65.1:
  Installed: 1.65.1+dfsg-0ubuntu5
  Candidate: 1.65.1+dfsg-0ubuntu5
  Version table:
 *** 1.65.1+dfsg-0ubuntu5 500
        500 http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
 ###############################################################
wakatana@local-machine:~$ apt-cache policy libboost-python-dev
libboost-python-dev:
  Installed: 1.65.1.0ubuntu1
  Candidate: 1.65.1.0ubuntu1
  Version table:
 *** 1.65.1.0ubuntu1 500
        500 http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

wakatana@local-machine:~$ apt-cache madison libboost-python-dev
libboost-python-dev | 1.65.1.0ubuntu1 | http://sk.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
 ###############################################################
wakatana@local-machine:~$ apt-cache search libboost-python-dev
libboost-python-dev - Boost.Python Library development files (default version)
wakatana@local-machine:~$ apt list libboost-python-dev
Listing... Done
libboost-python-dev/bionic,now 1.65.1.0ubuntu1 amd64 [installed,automatic]
 ###############################################################
wakatana@local-machine:~$ apt search libboost-python-dev
Sorting... Done
Full Text Search... Done
libboost-python-dev/bionic,now 1.65.1.0ubuntu1 amd64 [installed,automatic]
  Boost.Python Library development files (default version)

Problem is that I'm unable to install older version. I've tried various ways:

sudo apt-get install libboost-python=1.46-dev
sudo apt-get install libboost-python1.46-dev
sudo apt-get install libboost-python1-dev=1.46
sudo apt-get install libboost-python1-dev=1.46-dev
sudo apt-get install libboost-python-dev=1.46
sudo apt install libboost-python=1.46-dev
sudo apt install libboost-python1.46-dev
sudo apt install libboost-python1.46-dev:
sudo apt install libboost-python1-dev=1.46
sudo apt install libboost-python-dev=1.46
sudo apt install libboost-python-dev=1.46-dev

But with no luck:

wakatana@local-machine:~$ sudo apt-get install libboost-python=1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libboost-python
###############################################################
wakatana@local-machine:~$ sudo apt-get install libboost-python1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
Package libboost-python1.46-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libboost-python1.46-dev' has no installation candidate
###############################################################
wakatana@local-machine:~$ sudo apt-get install libboost-python1-dev=1.46
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libboost-python1-dev
###############################################################
wakatana@local-machine:~$ sudo apt-get install libboost-python1-dev=1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libboost-python1-dev
###############################################################
wakatana@local-machine:~$ sudo apt-get install libboost-python-dev=1.46
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.46' for 'libboost-python-dev' was not found
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python=1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libboost-python
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
Package libboost-python1.46-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libboost-python1.46-dev' has no installation candidate
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
Package libboost-python1.46-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libboost-python1.46-dev' has no installation candidate
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python1-dev=1.46
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libboost-python1-dev
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python-dev=1.46
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.46' for 'libboost-python-dev' was not found
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python-dev=1.46-dev
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.46-dev' for 'libboost-python-dev' was not found
###############################################################

I guess following format is OK because it prints the message that libboost is already installed

wakatana@local-machine:~$  sudo apt install libboost-python-dev=1.65.1.0ubuntu1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libboost-python-dev is already the newest version (1.65.1.0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  

But 1.46 equivalent did not worked for me:

wakatana@local-machine:~$ sudo apt install libboost-python-dev=1.46.1.0ubuntu1
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.46.1.0ubuntu1' for 'libboost-python-dev' was not found
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python-dev=1.46.0.0ubuntu1
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.46.0.0ubuntu1' for 'libboost-python-dev' was not found
###############################################################
wakatana@local-machine:~$ sudo apt install libboost-python-dev=1.46.0ubuntu1
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.46.0ubuntu1' for 'libboost-python-dev' was not found
###############################################################

I was also searching for *.deb package to install it using

dpkg -i

but I've not found version 1.46 on those sites
Ubuntu - Package Search Results -- libboost-python
Search Ubuntu's packages : Ubuntu

How can I install version 1.46 and do not break existing package manager configuration?
Why there is no version 1.46 on mentioned sites?
Thanks

See this page for complete instructions:

Boost Getting Started on Unix Variants - 1.46.1

1 Like