Discussion:
Modifying DNF's output
Francisco Tissera
2021-06-01 13:32:57 UTC
Permalink
Hello everyone,


I am currently using Fedora_linux 34, and I'd like to know, since I have
been using this OS for over a month and a half, and I find DNF's output
a bit... too much, if I could modify it somehow.

I'd like to modify how it outputs the installation of software.

For example, when  the dnf install package name command is issued,  the
first thing that will appear on the terminal is how long ago the last
dependency check was done.

Can that line of output be suppressed in any way?

If not, that's fine, I'll get used to it, but still, it would be cool if
it could.

Any help would be apriciated.

Best regards.

Francisco.
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://
Ed Greshko
2021-06-01 13:43:19 UTC
Permalink
I am currently using Fedora_linux 34, and I'd like to know, since I have been using this OS for over a month and a half, and I find DNF's output a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when  the dnf install package name command is issued,  the first thing that will appear on the terminal is how long ago the last dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if it could.
Any help would be apriciated.
does adding -q (quiet) help?

man dnf

--
Remind me to ignore comments which aren't germane to the thread.
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagure.io/fedo
Patrick O'Callaghan
2021-06-01 16:06:23 UTC
Permalink
Post by Francisco Tissera
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have
been using this OS for over a month and a half, and I find DNF's output
a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when  the dnf install package name command is issued,  the
dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if
it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be
filtered on whatever criteria you like, typically using grep, e.g.:

$ sudo dnf update|grep -v "Last metadata"
Dependencies resolved.
Nothing to do.
Complete!

poc
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
Francisco Tissera
2021-06-02 07:54:38 UTC
Permalink
Hello everyone,


I'd like to thank both Ed and Poc for their input.


Ed, adding the -q option makes it... Too quiet, LOL!


Poc, what you suggested, is really useful, thanks, since you wrote that
any output can be customized to what I like.

How ever, I have another question:

Is there a way to make that grep permanent? or would I have to type the
command including grep every time?

Thanks again.

Best regards.

Francisco.
Post by Patrick O'Callaghan
Post by Francisco Tissera
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have
been using this OS for over a month and a half, and I find DNF's output
a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when  the dnf install package name command is issued,
the
dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if
it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be
$ sudo dnf update|grep -v "Last metadata"
Dependencies resolved.
Nothing to do.
Complete!
poc
_______________________________________________
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagure.i
Joachim Backes
2021-06-02 08:22:38 UTC
Permalink
Post by Francisco Tissera
Hello everyone,
I'd like to thank both Ed and Poc for their input.
Ed, adding the -q option makes it... Too quiet, LOL!
that any output can be customized to what I like.
Is there a way to make that grep permanent? or would I have to type
the command including grep every time?
Thanks again.
Best regards.
Francisco.
Hi Francsisco,

1. I would defiine an own Shell script piping the dnf output to grep
2. Or define an own alias or a bash function in your ~/.bashrc file or
similar which pipes the bash output to grep or
  simillar, if you are using another shell

Regards

Joachim Backes
Post by Francisco Tissera
Post by Patrick O'Callaghan
Post by Francisco Tissera
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have
been using this OS for over a month and a half, and I find DNF's output
a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when  the dnf install package name command is issued,
the
dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if
it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be
$ sudo dnf update|grep -v "Last metadata"
Dependencies resolved.
Nothing to do.
Complete!
poc
_______________________________________________
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
https://pagure.io/fedora-infrastructure
_______________________________________________
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
https://pagure.io/fedora-infrastructure
--

Fedora release 34 (Thirty Four)
Kernel-5.12.8-300.fc34.x86_64


Joachim Backes <***@rhrk.uni-kl.de>
https://www-user.rhrk.uni-kl.de/~backes/
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infras
Patrick O'Callaghan
2021-06-02 09:40:59 UTC
Permalink
Post by Francisco Tissera
Poc, what you suggested, is really useful, thanks, since you wrote that
any output can be customized to what I like.
Is there a way to make that grep permanent? or would I have to type the
command including grep every time?
Create your own script called (for example) mygrep:

#!/bin/bash
grep -v insert-patterns-here $*

(note that grep can read the patterns from a file, so that might also
be an option if you want - read 'man grep')

Make that executable (chmod +x mygrep) and put it in your ~/bin
directory.

poc

_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagu
George N. White III
2021-06-02 11:17:25 UTC
Permalink
Post by Francisco Tissera
Is there a way to make that grep permanent? or would I have to type the
command including grep every time?
I seeTh some terse responses, but you will find that a few hours learning
some basics
of the linux command-line well worth the effort. It will also help you
avoid some of the
poor or even malicious examples posted on internet sites that can damage
your system.

Good starting place are linuxcommand.org and Nemeth et al (many of us have
several editions):

Title: UNIX and Linux System Administration Handbook, 5th Edition, 2017
Authors: Evi Nemeth, Garth Snyder, Trent R. Hein, Ben Whaley, Dan Mackin
Publisher: Addison-Wesley Professional
ISBN: 9780134278308

Linux follows the outline of UNIX, which was created at a time when
terminals
were text only so all interactive work was done with a command line. One
guiding principle was that programming is mostly text processing. The
grep, sed, and awk programs were available from the early days and are still
widely used. Another innovation was "pipes" that allow you to chain
together
a series of programs, typically starting with a program (e.g., "dnf") that
generates
text and piping ("|") the output text to another program (e.g., "grep").
Yet another
innovation was regular expressions which provide compact (important when
you
were working on an terminal with only 80 characters on a line and 24 or 25
lines)
patterns to match text strings.

Command-line processing is quite similar across linux distros and macOS. I
find Apple's command-line documentation
<
https://developer.apple.com/library/archive/documentation/OpenSource/Conceptual/ShellScripting>

quite useful for users starting out with the linux command line. One
keystroke
saving measure in UNIX is the use of the "PATH" to list directories that
are
searched for a command. Today, many users end up with multiple versions
of
programs (python is one that often exists in multiple versions) that are
used by the system as well as for applications. Apple recommends
reserving the PATH for "system" programs, and that user scripts and programs
be run using the full path. In your case, you might create a "dnf" script
like one
of the examples posted here. If you put it in a directory on the "PATH",
such as
"$HOME/bin", it could mask the real dnf, but if you put it in a directory
that is not
in the PATH, say "$HOME/my" you can run it as "~/my/dnf" and avoid
conflicts. You can also name the script "mydnf" and put it in $HOME/bin,
but
getting in the habit of using a full path with non-system programs avoids
problems
that are often tricky to recognize on forum posts.
--
George N. White III
Tim via users
2021-06-03 03:28:35 UTC
Permalink
One keystroke saving measure in UNIX is the use of the "PATH" to list
directories that are searched for a command.
Always remember that paths are a common cause for scripting to fail.

Someone does some experimenting with a command line, and works out
something that works for them. Then they put the command line into a
script, or other automation, and it doesn't work. It's because the
path was different in their command line interface than elsewhere.

It's *often* best to use the full path when you're not typing commands
directly into a command line.

--

uname -rsvp
Linux 3.10.0-1160.25.1.el7.x86_64 #1 SMP Wed Apr 28 21:49:45 UTC 2021 x86_64

Boilerplate: All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.

_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pa

Jon LaBadie
2021-06-02 20:27:18 UTC
Permalink
Post by Patrick O'Callaghan
Post by Francisco Tissera
Hello everyone,
I am currently using Fedora_linux 34, and I'd like to know, since I have
been using this OS for over a month and a half, and I find DNF's output
a bit... too much, if I could modify it somehow.
I'd like to modify how it outputs the installation of software.
For example, when  the dnf install package name command is issued,  the
dependency check was done.
Can that line of output be suppressed in any way?
If not, that's fine, I'll get used to it, but still, it would be cool if
it could.
Any help would be apriciated.
Anything that writes to standard output (or even standard error) can be
$ sudo dnf update|grep -v "Last metadata"
Dependencies resolved.
Nothing to do.
Complete!
You may find the Prompt "Is this ok [y/N]: " is not output
from the pipeline until after it is blindly responded to.

Jon
--
Jon H. LaBadie ***@jgcomp.com
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it:
Joe Zeff
2021-06-02 21:22:45 UTC
Permalink
Post by Jon LaBadie
You may find the Prompt "Is this ok [y/N]: " is not output
from the pipeline until after it is blindly responded to.
Unless, of course, you've put -y on the command line to avoid that issue.
_______________________________________________
users mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to users-***@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/***@lists.fedoraproject.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructu
Loading...