Score:0

How to list dependencies shown from the output of apt install across multiple lines?

ru flag
uk1

I am trying to use apt to install a new package and the confirmation screen shows all dependencies in a single line.

Example Output: screenshot showing output of apt install postgresql

Please ignore the -y flag in the screenshot. I don't usually use the -y flag but didn't have any other screenshot to share hence used the one with the -y flag present.

(base) uk@uk-Latitude-7280:~$ sudo apt-get -y install postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 libcommon-sense-perl libjson-perl libjson-xs-perl libpq5 libtypes-serialiser-perl >pgdg-keyring postgresql-14 postgresql-client-14 postgresql-client-common >postgresql->common sysstat
Suggested packages:
 postgresql-doc postgresql-doc-14 isag
The following NEW packages will be installed:
 libcommon-sense-perl libjson-perl libjson-xs-perl libtypes-serialiser-perl >pgdg->keyring postgresql postgresql-14 postgresql-client-14 postgresql-client-common >postgresql-common
 sysstat
The following packages will be upgraded:
 libpq5

Expected output:

(base) uk@uk-Latitude-7280:~$ sudo apt-get -y install postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 libcommon-sense-perl 
 libjson-perl 
 libjson-xs-perl 
 libpq5 
 libtypes-serialiser-perl
 pgdg-keyring
 postgresql-14
 postgresql-client-14
 postgresql-client-common
 postgresql-common
 sysstat
Suggested packages:
 postgresql-doc
 postgresql-doc-14
 isag
The following NEW packages will be installed:
 libcommon-sense-perl
 libjson-perl
 libjson-xs-perl
 libtypes-serialiser-perl
 pgdg-keyring
 postgresql
 postgresql-14
 postgresql-client-14
 postgresql-client-common
 postgresql-common
 sysstat
The following packages will be upgraded:
 libpq5

Edit: Added clarity around the -y flag used within the screenshot.

guiverc avatar
cn flag
What does it matter; you've used `-y` which means you're not reading that output & have given permission for it to be operated on regards of any provided output. Your use case makes no sense (*multiple lines also creates problems for those that read the output of installed packages as it can exceed the lines of display rather easily; but in your case you're not even reading that output*)
Bodo avatar
pt flag
You could try the interactive mode of `aptitude`. It will show the planned actions one per line before starting the installation/removal process.
uk1 avatar
ru flag
uk1
@guiverc Well in this particular instance I used the `-y` flag because I knew the list of dependencies that would be installed but I seldom use that flag. Just that I didn't have any other screenshot to upload to show as a reference to what I am after hence I had to use the one that I had while installing this particular package. I understand the repercussions of multiple lines but still for smaller set of dependencies, multiple lines makes them easier to read.
user535733 avatar
cn flag
Hmmm. In 16 years of using Debian and Ubuntu, I've not seen such an option to format apt output (there are a couple options, but not multi-line). So if it's there at all, it's well hidden.
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.