List pacman upgradable packages without "-version" [closed] - linux

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 19 hours ago.
Improve this question
How could I list all packages that need upgrading without the -version postfix in pacman so I can copy paste a portion for pacman -S.
Current output : acl-2.3.1-3 akonadi-22.12.2-1...etc
Required output : acl akonadi...etc
Thanks.
pacman -Qu & garuda-update; Both list versions in some form.
SOLVED:
The following command produces the required output.
checkupdates | cut -d ' ' -f1 | xargs
ps. Partial upgrades aren't recommended, use on your own discretion.

The following command produces the required output.
checkupdates | cut -d ' ' -f1 | xargs
ps. Partial upgrades aren't recommended, use on your own discretion.

Related

cat not numbering lines of version output [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 months ago.
Improve this question
When I type echo Hello$'\n'world | cat -n I get the output as expected:
1 Hello
2 world
But if I want to number line of g++ -v | cat -n I get an unnumbered result.
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
...
What's wrong with my command?
The output of g++ -v goes to the standard error, not standard output. Redirect stderr to stdout to process it in a pipeline:
g++ -v 2>&1 | cat -n

Using linux pipe output as partial input [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Running a grep command on my file gives me the following output:
15-5-65
52-5-93
51-4-82
21-0-86
54-6-09
63-2-68
26-7-85
24-9-46
16-7-59
81-5-42
31-7-63
54-0-84
69-8-80
74-1-27
19-9-86
41-8-74
13-2-03
21-3-61
56-7-60
81-9-47
I want to use each of these as a partial input to another grep command, such as grep '02729-AS-27' maps/projects.dat | grep '...-...' circuit_(pipe input).dat How do I properly format this command?
If this isn't clear, the files I want to search are called for example circuit_81-5-42.dat with numbers corresponding to the output of the first grep command above.
I hope this is what you want:
while IFS= read -r line; do
grep "...-..." "circuit_${line}.dat"
done < <(grep "02729-AS-27" "maps/projects.dat")
Or:
grep "02729-AS-27" "maps/projects.dat" | xargs -i grep "...-..." "circuit_""{}"".dat"
Please replace the pattern ...-... with the appropriate one.
Hope this helps.

yum list installed | wc -l Vs. rpm -qa | wc -l [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
This goes back to very basics, however I am confused on how.
We know yum is a repository manager that is based on rpm the package manager in RPM based systems, like Fedora.
Having said that, I thought these two commands can be used to produce the same output (in that sense I guess yum commands are the wrapper for rpm commands), however I was just proved to be wrong. Please consider the following example:
[myuser#localhost ~] yum list installed | wc -l
1627
[myuser#localhost ~] rpm -qa | wc -l
1640
These two commands produce different result, that I believed should not. I would be grateful if anyone can explain the scenario behind it.
PS: I am on Fedora 28
they don't produce exactly the same output... yum list installed also prints some headers:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: ftp.nluug.nl
epel
Installed Packages
furthermore some packages can be printed on multiple lines with their version number and repository.
If you start counting those lines, then the count won't be correct. Note that the output of yum list installed also reprints output on the same line; not sure how wc deals with that...
The count of rpm -qa | wc -l however is biased also; because it contains the pubkey entries; which are not real packages.
Take a look at this answer where there are many details on these outputs: https://unix.stackexchange.com/a/330599/64031

Detect linux version 5 or 6 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am new to shell script as I do to detect the version of linux?
with shell script would detect if the version is 5 or 6 Linux with IF if possible
to execute a block of installation.
Use lsb_release -r | cut -f2 to get your distribution release version? (and cut again with a different delimiter to extract the major number of the release)
For instance:
version=`lsb_release -r | cut -f2 | cut -d. -f1`
if [ ${version} = 5 ]; then
echo "This is version 5"
elif [ ${version} = 6 ]; then
echo "This is version 6"
fi
Linux distributions and the updates people apply as well as the software they install or configure to use in place of distribution defaults vary so greatly that testing for a Linux version number is far too brittle a dependency on which to rely for an installation script. Instead, test directly for the features on which you depend and be prepared to report or install what is missing. Also, give serious thought to statically linking many of the libraries on which your code depends if you are installing compiled executables. Not every "bug fix" or "enhancement" will be compatible with your code and none of them will have been tested with it.

Shuf - To Shuffle the contents of a file in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am using some tcsh code that uses a command called shuf:
shuf $file_name > out.txt
http://tuxthink.blogspot.ca/2012/06/shuf-to-shuffle-contents-of-file.html
but seems my linux/bash version does not have it. Does anyone knows a way to install it?
My linux/tcsh is:
$ echo $version
tcsh 6.14.00 (Astron) 2005-03-25 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
$ uname -mrs
Linux 2.6.18-194.8.1.el5 x86_64
Also, I am a user of the server but I do not have super user permission, can only perform local installations in my user folder.
Thanks!
Try your package manager or sudo apt-get install shuf

Resources