How to list just one repo with yum. First I disable all repo, second I enable just the repo that I want to list.
Replace 'more' command with any command which is in your PATH. Show Sample Output
This command could seem pretty pointless especially when you can get the same result more easily using the rpm builtin queryformat, like:
rpm -qa --qf "%{NAME} %{VERSION} %{RELEASE}.%{ARCH}\n" | sort | column -t
but nonetheless I've learned that sometimes it can be quite interesting trying to explore alternative ways to accomplish the same task (as Perl folks like to say: There's more than one way to do it!)
Show Sample Output
You can use wildcard with rpm search but you have to do 2 things:
1. use "-a" switch (means "all") with query ("-q") switch - argument is a pattern to use while searching for package names of all installed packages
2. protect wildcards, so that shell could not eat them - escape it with backslash ("\") or enclose all pattern between apostrophes ("'"):
rpm -qa 'co*de'
As you can see above it is possible to insert wildcards into middle of the pattern.
If you want, you can add "-i" or another rpm query options, "-i" will print package information for all installed packages matching pattern.
Show Sample Output
rpm, sometimes, is not wildcard friendly. To search files installed from package this could be useful. change PACKAGENAME to any package do you want to search Show Sample Output
This should be an option to rpm, but isn't. I wind up using it a lot because I always forget the full name of the packages I want to delete.
\n Separates out the architectures on different lines. Show Sample Output
I use this as an alias to get all .service files related a single installed file/conf (if it has services, of course). For rpm based systems ;) Show Sample Output
The queryformat option can be used in a number of ways to find things like duplicate packages, wrong arch, or the exact package to pass to rpm -e, yum remove, etc. Show Sample Output
This will create the file /tmp/pkgdetails, which will contain a listing of all the files installed on your RPM-based system (RedHat, Fedora, CentOS, etc). Useful should the RPM system/database become corrupted to find which package installed which files.
parse_rpm xorg-x11-fonts-ISO8859-1-75dpi-7.1-2.1.el5.noarch.rpm
xorg-x11-fonts-ISO8859-1-75dpi 7.1 2.1.el5 noarch
It's a little tricky because RPM names can contain '-' and the name, version and release number can contain '.' This is one or two orders of magnitude faster than using rpm itself:
rpm -qp --queryformat '%{N} %{V} %{R} %{ARCH}\n' $RPM
Find information about the rpm package which owns a certain file. Show Sample Output
Find the package a file belongs to on an rpm-based distro. Show Sample Output
It is not the installed size in files, but the size of RPM packages. Show Sample Output
This will list all the gpg keys that were accepted and installed for yum. Show Sample Output
This will remove the gpg-pubkey-1aa043b8-53b2e946 from rpm/yum and you'll be prompted to add it back from the given repo. Show Sample Output
Needs rpmorphan installed Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: