How to identify build architecture from packages? - linux

I have a machine with Red Hat AS5. On it are installed two versions of a linux application called xmlsec. One is supposedly built for AS3 and the other, AS5. Is there any way to verify which is which? The file names provide this information but is there a way to look into the signature of the installed package to ensure accuracy?
In general, is there a way to determine the build architecture (OS) of a completed installation?
Let me know if I need to provide more information.
I'm still new to building and maintaining packages. Please direct me to some books or websites if my question doesn't make sense or I just need to gain more understanding.
Thanks.

How about it?
$rpm -q -a --queryformat='%{N}-%{V}-%{R}.%{arch}\n'
vsftpd-2.0.1-5.EL4.5.x86_64
hal-0.4.2-6.EL4.x86_64
Or Try this one
$rpm -q -a --queryformat '%{NAME}%{VERSION}%{RELEASE}\n'
xorg-x11-twm6.8.21.EL.18
hwbrowser0.190.EL4.4
Buildarch tag
$rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}.%{BUILDARCHS}\n' rpm
rpm-4.4.2.3-18.el5.x86_64.(none)
List of tags
$rpm --querytags
BUILDHOST
OS
POSTIN
POSTUN
FILELINKTOS
BUILDTIME
BUILDHOST
BUILDARCHS

Related

Where can I get libGLU.so.1 on Arch Linux?

I'm running arch linux and am making an attempt to run DaVinci Resolve. Initially startup said nothing, it just timed out and closed. Then I found a recommendation to run it with /opt/resolve/bin/resolve this got me an error saying
libGLU.so.1: cannot open shared object file: No such file or directory
This has sent me on a wild goose chase trying to install libGLU.so.1 on my system. I heard somewhere it is part of mesa so I sudo pacman -S mesa and I've tried to find a AUR package that might have it but no luck. Even trying variations of yay libGLU and yay libGLU-mesa, no luck so far.
Additionally find / -name 'libLGU*' returned nothing even when ran with sudo, meaning it isn't already on my system in the wrong directory.
This might unfortunately be an instance where I download the file and place it where it needs to go but that's probably not in the best interest of the long term longevity of my system.
I'm probably fairly novice when compared to most others on linux but I think I've gotten a lot of the basics down. Would love any insight you may have on this issue!
While an outdated forum post said that /usr/lib/libGLU.so.1 is owned by the mesa package, it is now currently owned by glu.
pacman -S glu ought to give you your needed library.
For future reference, you can reverse search filename->package using pkgfile, which works even if you don't have the respective files/packages locally.
https://wiki.archlinux.org/index.php/pkgfile
$ sudo pkgfile --update
$ pkgfile libGLU.so.1
extra/glu
Alternatively there's the built-in pacman -F, but it's generally slower than pkgfile.

On which Linux Distributions do the "stat" and "service" commands run?

On which Linux Distributions do the following commands run?
service $servicename status
stat -c \"%a\" /var/log/$filename
For example assuming $servicename="apache2" and $filename="syslog".
stat is part of coreutils and part of the GNU project. Any major GNU/Linux distribution will offer this package. Note that minimal environments like BusyBox may instead offer their own, limited version of stat.
service is part of sysvinit-tools and not part of GNU. Only distributions using System-V-style init scripts will offer it.
Distrowatch offers a comparison of different distributions and also tracks the versions of a selected set of packages.
Note that services may have different names accross distributions as well. For example apache2 may be called httpd instead.

install octave *no root*, missing BLAS and LAPACK

I am trying to install octave on my machine (Scientific Linux 6.4 based on red hat) without having root access. After running the following:
./configure CPPFLAGS="-I/some_stuff/user_name/bin/pcre-8.32/include" LDFLAGS="-L/some_stuff/user_name/bin/pcre-8.32/lib"
(I had to install pcre apriori; before I got errors re: pcre), I get a message along the lines:
configure: error: You are required to have BLAS and LAPACK libraries
Now LAPACK has just been made in $HOME/bin/lapack-3.4.2 yet the same error is still there. Also $HOME/bin is part of the path.
Any way to tell the configure tool for octave about this? (the obvious thing of adding another CPPFLAG/LDFLAG does not work). I'm assuming I'll encounter more such issues along the way, so any generic help/hint is greatly appreciated.
My level of linux is rudimentary to say the least, but I'm willing to work through it.
Thanks,
Dan
Does this site shed any light on the problem? It describes the configuration options.
http://www.gnu.org/software/octave/doc/interpreter/Installation.html
First, you should rather ./configure all your software with some common prefix, such as --prefix=$HOME/soft/
Unless you know well what you are doing, I recommend against having different prefix for each installed software. You could add $HOME/soft/bin to your $PATH
And you should configure and build all the dependencies before configuring octave (and that includes BLAS, LAPACK and their dependencies).
Then, you want to pass specific configuration options, perhaps like --with-blas=$HOME/soft
I think you should pass the prefix used when configuring BLAS; you may want to run ./configure --help first.
Read carefully each package's installation instructions. For Octave, they are here. Each package has their own.
Some software may require you to configure and build outside of their source tree!

find whether a library is installed using shell script

I'm complete noobs in shell script what i want is shell script that determine a list of library/package currently installed if not install them without user permission
What I want is to determine the library/package is currently installed or not in system
I'm aware of aptitude search command but I looking for a better solution
e.g I have define(in shell script) check for readline library/package now how can I from inside the shell script (I want to create) know that readline package is currently installed or not.
Any idea or suggestion would certainly help
What I want is to determine the library/package is currently installed or not in system
dpkg -s does not require root permission, and will display package status details.
Example shell script:
#!/bin/sh
for P; do
dpkg -s "$P" >/dev/null 2>&1 && {
echo "$P is installed."
} || {
echo "$P is not installed."
}
done
Usage is:
script.sh package1 package2 .... packageN
For simply doing the test, it would seem that you could grep the output of a command such as ldconfig -p for your library of interest.
Or you could supply a tiny test program linked against the desired library, try running it, and test for non-failure.
If you are trying to set up a dependency check, the proper solution is to create a dummy package which Depends: on the packages you need to have installed. There is a tool called equivs which somewhat helps with this. (However, it has been criticized as being "over-engineered"; certainly, if you are familiar with the format of Debian packages, you might not need a separate tool if your requirements are this simple.) Then you just install this package and it will pull in the packages which are specified as dependencies.
You still have to know that the library which provides libreadline.so is libreadline5-dev. Debian package search can help find the package names you need to put in Depends:
You can probably do what you want with dpkg

How to know system is currently installing ISO

I am creating an RPM. This RPM will be packed with the CentOS ISO and will install when CentOs is installed. This can also be installed using normal rpm installation method. But rpm installation need to behave differently if it is installed from ISO and installed by rpm normal installation method. So, the question is how do I know whether the system is currently installing the ISO.
Thanks in advance.
You could check if /dev/cdrom is mounted and if the /mnt/cdrom contains the installation disc in the %pre /%post scripts.
Strictly speaking, RPMs should be agnostic to how they are installed, so the chances are if you need this in the RPM it's probably a flawed design and what you are trying to do can be done in some other way.
I would suggest looking at anaconda / kickstart scripts.
Definitely a flawed design.
There should never be any user interaction with an RPM install which is what I bet you are trying to do.
If you are installing from a live OS, you can check the existence of /dev/live or liveimg in kernel command line,
i.e.
[[ $(grep -c liveimg /proc/cmdline) != 0 ]] || [ -b readlink -f /dev/live ]

Resources