Michael Lange wrote on 10/05/16 11:19: > Hello, > > I use the following line (borrowed from apticron) in a script to generate > a list of upgradable packages: > > PKGNAMES=`apt-get -q -y -s --ignore-hold --allow-unauthenticated dist-upgrade > | \ > /bin/grep ^Inst | /usr/bin/cut -d\ -f2 | /usr/bin/sort` > > Now I would like to do the same with aptitude, so the user may pick which > program they prefer to install the available updates. > The aptitude equivalent I have come up with so far is: > > PKGNAMES=`aptitude -v -y -s --allow-untrusted full-upgrade | \ > /bin/grep ^Inst | /usr/bin/cut -d\ -f2 | /usr/bin/sort` > > I figure that probably --allow-untrusted does the same for aptitude as > --allow-unauthenticated does for apt-get (?) , however from man aptitude I > cannot see anything like apt-get's --ignore-hold option. > > So my question is: is there a way to include updates to packages put on > hold to the output of "aptitude full-upgrade" as in apt-get, that I have > been missing, or is this simply not possible? >
Your aptitude variant will also list new packages to be installed (e.g., a package with a version number in its name like libperl5.24). Otherwise you could try a search pattern of aptitude. This ability of aptitude is one of the advantages of aptitude IMO. Wouldn't PKGNAMES=$(aptitude -F '%p' --allow-untrusted search '~U' | sort) just do what you want? Also, it seems to be faster. Regards, jvp. > Regards > > Michael