Score:2

apt list upgradable only package names

pl flag

I can list packages for update with apt list --upgradable. But that gives a list of packages, with other details, one line per package. I want as an output a single line with the package names, so I can eventually copy-paste (parts of) that line to a sudo apt install line.

I did this with

apt list --upgradable | grep -v Listing | awk -F '/' '{ printf "%s ",$1 }'

(and I still have to remove the WARNING..., probably redirecting stderr, but it is in a separate line so it is less of a nuisance). I wonder if the same can be achieved natively with apt, or some other command (apt-cache, etc.)

ChanganAuto avatar
us flag
It seems there's a misunderstanding here. `apt list --upgradable` should show already installed packages that can be upgraded and that can be done with `apt upgrade` or `apt full-upgrade`. Not with `apt install` because they're already installed.
Score:3
ca flag

I don't believe apt or apt-get has an option to list only package names. Unless there is something to make it with apt-get -o...

Here:
$ apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing

... is another way to put it.

Sad3ng avatar
vn flag
+1 for Cool, it's works.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.