How to force debian linux apt-get installer to install unstable/specific version of packages?
Add the testing repos to your sources.list:
deb http://ftp.debian.org/debian testing main contrib
Now do 'apt-get install gcc-4.4' ; it turns out that 4.4 is packaged so it can be installed alongside the straight 'gcc' package.
Related videos on Youtube
therobyouknow
I enjoy making software and applying technology to help myself and friends and family achieve things as well as earning a living doing it. github.com/therobyouknow linkedin.com/in/therobyouknow twitter.com/therobyouknow
Updated on September 17, 2022Comments
-
therobyouknow over 1 year
I want to force the install system on debian linux, apt-get, to install unstable (i.e. a later version) of a package, later than the stable one recognised by the debian package maintainer.
This because I want to take advantage of new features in the later release.
I have tried the combinations of the following but none force a later version of what I want:
- the apt-get -t unstable option
- editing /etc/apt/apt.conf APT::Default-Release "unstable";
- editing /etc/apt/source.list ftp.uk.debian.org/debian unstable main
Please advise.
The following is optional, if you are interested (!): I have given some specific background as to what I am trying to achieve below.
My Specific situation in detail
I want gcc 4.4 on my Debian 4 Etch system but apt-get reports latest as being 4.1.
It reports 4.1 as this is the latest stable release supported by the central Debian package maintainer.
Later versions are regarded as unstable.
I need 4.4 because it I need to install the PerlMagick module required by some graphical features in my bugzilla-3.4.4 installation.
Without 4.4 I get an error during a make/compile stage in the Perl module install for the PerlMagick module: "unrecognised command line option "-fopenmp"" - this error is about multi-processor support and is available in the latest 4.4 version of gcc but not in 4.1 which is what the debian package maintainer regards as the latest stable.
I'm hoping that if I can get gcc 4.4 on my machine then this error will not appear if I re-run the Perl install for the PerlMagick module and the graphical features will be enabled.
-
therobyouknow over 14 yearsCan you give an example of the entry in sources.list looks exactly? I added the line: deb ftp.uk.debian.org/debian testing main to the end of sources.list but I get the error W: "Couldn't stat source package list ftp.uk.debian.org testing/main Packages (/val/lib/apt/lists/ftp.uk.debian.org_debian_dists_testing_main_binary-i386_Packages) - stat (2 No such file or directory) W: You may want to run apt-get update to correct these problems E: Couldn't find package gcc-4.4 continued in next comment...
-
therobyouknow over 14 yearsI ran apt-get update, then had to add APT::CacheLimit "16777216" in /etc/apt/apt.conf.d/70debconf to cure a problem with not enough "cache" memory during the update. continued in next comment...
-
therobyouknow over 14 yearsBut I can't fix these errors. How do I get these dependencies to install. # apt-get install gcc-4.4 <snip> The following packages have unmet dependencies. gcc-4.4: Depends: gcc-4.4-base (= 4.4.2-3) but 4.4.2-5 is to be installed Depends: cpp-4.4 (= 4.4.2-3) but it is not going to be installed Depends: libgcc1 (>= 1:4.4.2-3) but 1:4.1.1-21 is to be installed Depends: libgomp1 (>= 4.4.2-3) but it is not going to be installed E: Broken packages Thanks so far for your help.
-
therobyouknow over 14 yearsSo I think I solved the "Couldn't stat source package list ftp.uk.debian.org testing/main Package" error, I think my sources.list is correct but I can't get apt-get to install the dependencies mentioned in last comment above.
-
therobyouknow over 13 years+1 and accepted answer, sorry it took so long, for your approach to use testing repos to control which versions are used.