It is very often use case, after apt-get update / upgrade, facing this message: "The following packages have been kept back:"
Calculating upgrade... Done
The following packages have been kept back:
libchromaprint1 htop vim
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
I know, what it is and what to do, to fix it.
My question is: How to get the whole list of those packages?
e.g.: "apt-get magic" ---> libchromaprint1 htop vim
Please, no awk or similar regex things, if possible. Where is this info located? Or is it dynamically created on apt-get running?
Thanks.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
packages have been kept back: How to get pkg list for it?
Re: packages have been kept back: How to get pkg list for it
Code: Select all
dpkg -l | grep '^h' | awk '{print $2}'
Code: Select all
aptitude search '~ahold'
Re: packages have been kept back: How to get pkg list for it
not working
root@p:/var/lib# apt-get -s upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
XXX-pkg1 XXX-pkg2
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@p:/var/lib# dpkg -l | grep '^h' | awk '{print $2}'
and aptitude not available.
It is an embedded dev. Only limited apt + dpkg available.
Any ideas?
root@p:/var/lib# apt-get -s upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
XXX-pkg1 XXX-pkg2
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@p:/var/lib# dpkg -l | grep '^h' | awk '{print $2}'
and aptitude not available.
It is an embedded dev. Only limited apt + dpkg available.
Any ideas?
Re: packages have been kept back: How to get pkg list for it
to see, output of
Code: Select all
dpkg -l | grep XXX-pkg1 XXX-pkg2
Re: packages have been kept back: How to get pkg list for it
a little bit background, I write a little c++ wrapper for apt, needed by an update-manager. So, I should be able to handle some simple use/error states. If after an apt-get update / upgrade, some kept back pkgs are detected (this works already, I just parse the std:out of apt-get), I wanna report the list with of those pkg (with kept back state) to the main side.
I just thought, it would be possible to find it with apt tools, intead of parsing/determine pgk list from std:out.
the point is, this behavior is created and prepared by me (XXX-pkg1 XXX-pkg2 are dummy pkgs, with some unmet deps), with a reason: get some kept back packages.
So, and my really issue now, to get this pkg list only...
I just thought, it would be possible to find it with apt tools, intead of parsing/determine pgk list from std:out.
the point is, this behavior is created and prepared by me (XXX-pkg1 XXX-pkg2 are dummy pkgs, with some unmet deps), with a reason: get some kept back packages.
So, and my really issue now, to get this pkg list only...
Re: packages have been kept back: How to get pkg list for it
If dpkg returns nothing, check this:
Code: Select all
which -a dpkg
Re: packages have been kept back: How to get pkg list for it
no
got it (more or less) with:
but c++ parsing is terrible
any improvements are welcome
Code: Select all
root@p:/var/lib# which -a dpkg
/usr/bin/dpkg
root@p:/var/lib# ls -l /usr/bin/dpkg
-rwxr-xr-x 1 root root 194240 Aug 7 20:03 /usr/bin/dpkg
root@p:/var/lib# /usr/bin/dpkg -l | grep '^h' | awk '{print $2}'
Code: Select all
apt-get -s --no-show-upgraded upgrade
any improvements are welcome
Re: packages have been kept back: How to get pkg list for it
If this returns nothing, you should investigate why
This is the package names you gave. If wrong, of course replace by real names.....
If these packages are installed, dpkg will give the exact status.
Don't look for complexity before this clarification.
Code: Select all
dpkg -l | grep XXX-pkg1 XXX-pkg2
If these packages are installed, dpkg will give the exact status.
Don't look for complexity before this clarification.