Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
315
rated 0 times [  315] [ 0]  / answers: 1 / hits: 493375  / 3 Years ago, mon, october 18, 2021, 6:45:22

I want to setup a new virtual machine with some specified packages (name and version), that are provided.



For example apache2 in version 2.2.20-1ubuntu1 with all dependencies. Even if there is a new version of this package on the servers this one should be installed.



The solution has to work/scale with multiple (n) "setups". Another virtual machine might need an older version of apache2.



I currently know of some possibilities that install the exact packages, but do not scale that good:




  1. Copy all required *.deb to every virtual machine manually and enter: dpkg -i ... -> Could work, but it is very error prone. (Manual scripts etc.)

  2. Create and use a new Ubuntu repository for each setup. -> Does not work because I would need n repositories.

  3. Setup the machine once and copy the VM / create a snapshot. -> Does not work because I would need to store n VMs.



My problem could be labeled as patch management, but I do not want to update my packages to the current version. My goal is to install old packages.


More From » repository

 Answers
6

You can use apt-get to install a specific version of the package a long as it is in an archive that apt knows about. From the apt-get manpage:




A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, frozen, unstable).




For example, you could do:



sudo apt-get install apache2=2.2.20-1ubuntu1


Note that you may need to do some dependency resolution on your own in this case, but if there are any problems apt-get will tell you what is causing them. On my 11.10 system I would need to do the following to get this to work:



sudo apt-get install apache2=2.2.20-1ubuntu1 
apache2.2-common=2.2.20-1ubuntu1
apache2.2-bin=2.2.20-1ubuntu1
apache2-mpm-worker=2.2.20-1ubuntu1


You can display available package versions as follows:



sudo apt list -a apache2

[#41189] Wednesday, October 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rinstracte

Total Points: 221
Total Questions: 114
Total Answers: 120

Location: France
Member since Fri, Jan 28, 2022
2 Years ago
rinstracte questions
Wed, Jun 15, 22, 02:09, 2 Years ago
Tue, Jan 24, 23, 01:39, 1 Year ago
Wed, Jun 9, 21, 04:34, 3 Years ago
Sun, Apr 17, 22, 11:38, 2 Years ago
;