Trouble with package management after using apt-mark

silver.bullet at silver.bullet at
Sat Sep 5 16:00:34 UTC 2015

On Sat, 5 Sep 2015 16:10:45 +0100, Colin Law wrote:
>On 5 September 2015 at 16:00,  <silver.bullet at> wrote:
>> ...
>> After I apt-mark hold the grub packages, apt-get upgrade kept back
>> the kernel packages, so I unhold the packages, but linux-lowlatency
>> packages are still kept back. Before I hold and unhold the packages
>> they were not kept back.
>I don't fully understand what you want to do, but the reason the
>packages are held back may be because you are using apt-get upgrade
>instead of apt-get dist-upgrade.  dist-upgrade will install new
>packages needed to install the held back packages, but upgrade will

My wording might be hard to understand, but now the below command line
quotes should explain the issue.

Is there no way, excepted of installing dummy packages, to prevent some
recommended packages from getting installed by an upgrade, while other
recommended packages should be installed?

FWIW before I run apt-mark hold to hold packages that were not
installed, to prevent them from being installed, apt-get upgrade didn't
kept back a package. I guess I didn't accidentally typed dist-upgrade.
This happened after I run apt-mark hold. It wasn't fixed by apt-mark
unhold, the unhold operation claims that the packages were already

Synaptic didn't show a "!" for the kernel packages, before I apt-mark
grub packages. Why does this happen?


[root at moonstudio weremouse]# apt-get dist-upgrade

would do the job, but also install the unwanted grub packages.

[root at moonstudio weremouse]# apt-get dist-upgrade --no-install-recommends

would install the linux packages, without installing grub, but then
recommended packages for other packages would be ignored too.

If I try to hold the grub packages (and gvfs and pulseaudio), IOW
packages that aren't installed, then dist-upgrade will install grub too,
ignore that I hold it.

[root at moonstudio weremouse]# apt-mark hold grub-common
grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common os-prober gvfs
pulseaudio grub-common set on hold. grub-gfxpayload-lists set on hold.
grub-pc set on hold.
grub-pc-bin set on hold.
grub2-common set on hold.
os-prober set on hold.
gvfs set on hold.
pulseaudio set on hold.
[root at moonstudio weremouse]# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... The following packages were automatically
installed and are no longer required: linux-headers-4.1.0-3
linux-headers-4.1.0-3-lowlatency linux-image-4.1.0-3-lowlatency Use
'apt-get autoremove' to remove them. Done
The following NEW packages will be installed:
  grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common
linux-headers-4.2.0-7 linux-headers-4.2.0-7-lowlatency
linux-image-4.2.0-7-lowlatency os-prober The following packages will be
upgraded: build-essential cpp-5 g++-5 gcc-5 gcc-5-base libapparmor1
libasan2 libatomic1 libcc1-0 libcilkrts5 libgcc-5-dev libgcc1
libgfortran3 libgomp1 libgstreamer1.0-0 libitm1 liblsan0 libmpx0
libquadmath0 libstdc++-5-dev libstdc++6 libtsan0 libubsan0
linux-headers-lowlatency linux-image-lowlatency linux-libc-dev
linux-lowlatency python-characteristic 28 upgraded, 9 newly installed,
0 to remove and 0 not upgraded. Need to get 158 MB of archives. After
this operation, 302 MB of additional disk space will be used. Do you
want to continue? [Y/n]

As you can see, unhold claims that the packages wer not hold:

[root at moonstudio weremouse]# apt-mark unhold grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common os-prober gvfs pulseaudio
grub-common was already not hold.
grub-gfxpayload-lists was already not hold.
grub-pc was already not hold.
grub-pc-bin was already not hold.
grub2-common was already not hold.
os-prober was already not hold.
gvfs was already not hold.
pulseaudio was already not hold.

Likely because they are not installed.

Again, I don't want that those packages ever get installed, while other
recommended packages should be installed.

More information about the ubuntu-users mailing list