1

I have a server with Debian wheezy and kernel vmlinuz-3.2.0-4-amd64, hosted at OVH. I would like to upgrade the kernel. Normally at ovh, you can find some kernel already configured. but the files I have are not the same (ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production).

Can you please tell me what will happen if I run:

apt-get -t wheezy-backports install linux-image-amd64 

(apt/sources.list is OK)

Will it reinstall my Debian installation, so I lose my configuration (apache etc.)? Or will it just change the boot kernel (that's what I want)?

2
  • man apt-get can help you – c4f4t0r Sep 19 '14 at 22:49
  • 1
    If you only ask to install a package, that package and any necessary dependencies are installed. Why do you think it will reinstall your Debian installation? As c4f4t0r says, check the manpage; e.g. use --dry-run to let it show what it would do. – wurtel Sep 22 '14 at 10:20
0

By default, if you add another source as you have done, the packages will be used in preference to those from the wheezy repo, because the version numbers are greater. So there is no need to use the -t option.

If you want to prevent this and only use specific packages from the wheezy-backports repo, you'd have to add a package pin. Run man apt_preferences for more info, but see below for an example that would do this in the case you have described. Place it in a file called /etc/apt/preferences.d/wheezy-backports.pref.

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 200

Package: linux-image-amd64
Pin: release a=wheezy-backports
Pin-Priority: 600

The above will set the priority of all packages in this repo to 200, which is lower than the default of 500. The man page says that APT will "Install the highest priority version.", which means that the highest version only gets installed if the priorities are equal. But the example also sets the priority of the kernel package to higher than normal, so the one from wheezy-backports gets chosen over anything else. (Make sure you also add dependencies to the Package: line, otherwise the correct versions will not installed.)

Little known fact: apt-cache policy linux-image-amd64 will show you which versions are available and which will be installed by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.