rpm install use current timestamp - time

rpm install ko module.
need run depmod -A to update module.dep, but the timestamp of ko files isn't current timestamp.
so can use current time stamp of installed file during rpm installing

You are confusing build time with install time: they are different time stamps.

Related

Update go using go install

How can the existing version of go be updated using the go install command?
I've done the following
$ go install golang.org/dl/go1.19.4#latest
go: downloading golang.org/dl v0.0.0-20221207214018-bd7282711064
$ go1.19.4 download
Downloaded 0.0% ( 16384 / 148931745 bytes) ...
Downloaded 9.2% ( 13647776 / 148931745 bytes) ...
Downloaded 36.2% ( 53870192 / 148931745 bytes) ...
Downloaded 61.8% ( 92028240 / 148931745 bytes) ...
Downloaded 87.4% (130137120 / 148931745 bytes) ...
Downloaded 100.0% (148931745 / 148931745 bytes)
Unpacking /home/gameveloster/sdk/go1.19.4/go1.19.4.linux-amd64.tar.gz ...
Success. You may now run 'go1.19.4'
$ which go1.19.4
/home/gameveloster/go/bin/go1.19.4
$ which go
/home/gameveloster/.go/bin/go
Is the final step to copy the newly downloaded go binary ~/go/bin/go1.19.4 to replace the existing ~/.go/bin/go?
Is there a special way to then clean up ~/go/bin/go1.19.4, or is simply deleting this binary sufficient?
The short answer is No you can't update the existing version of go.
First, you have to uninstall the currently installed version and then install a newer version.
Here is an easy solution,
To find the installation address run
where go
To uninstall, delete the given address of above,
sudo rm -rf [output of above command]
To check if you already remove go, run the below command; the system will prompt "command go not found"
go --version
Now install a newer version of go
wget https://go.dev/dl/go1.19.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
Make sure that your PATH contains /usr/local/go/bin
export PATH=$PATH:/usr/local/go/bin
After that, you will need to restart your terminal for the change to take effect.
To check if you have installed Go successfully, run the below command.
go --version
Enjoy!
How can the existing version of go be updated using the go install command?
Not. That's simply not the way to manage the installation of Go. Being able to "go install" a certain version is a nice shortcut to get a certain version of Go up and running but it's not the intended way to manage "the" Go installation on your machine.

list all downloaded packages - repotrack / rpm

I am downloading packages using repotrack, doing something like this -
repotrack -a x86_64 -p $PACKAGE_LOCATION/Packages $pckg
where it gets $pckg from a text file. Now I want to verify signatures of all packages (and dependencies) before installing.
rpm --checksig <package_name>
Here I need package_name of all packages and dependencies downloaded. One way to do this will be ls over $PACKAGE_LOCATION/Packages location. But I am using bash script and looping over ls content is fragile. Other mechanism I thought of trying is using rpm -qa but this queries all installed (and not downloaded) packages.
Is there anything I can do to get list of all downloaded packages.
Hope if you are looking for what package you have installed that use below command.
rpm -qa | grep packagename
As well as you can use rpm --help to get more flags info.
hope it will help...!!!

How to install libquicktime on CentOS 7 in one (or two) line of command?

For some reason, I need support of QuickTime on my CentOS 7. So I searched the internet and found that something called "libquicktime" can provide that support. So I download the rpm file from http://rpmfind.net/linux/rpm2html/search.php?query=libquicktime%28x86-64%29. Then I ran command rpm -i libquicktime-1.2.4-31.el7.x86_64.rpm and got the following errors:
warning: libquicktime-1.2.4-31.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 66534c2b: NOKEY
error: Failed dependencies:
libfaac.so.0()(64bit) is needed by libquicktime-1.2.4-31.el7.x86_64
libfaad.so.2()(64bit) is needed by libquicktime-1.2.4-31.el7.x86_64
libmp3lame.so.0()(64bit) is needed by libquicktime-1.2.4-31.el7.x86_64
libquicktime.so.0()(64bit) is needed by libquicktime-1.2.4-31.el7.x86_64
libschroedinger-1.0.so.0()(64bit) is needed by libquicktime-1.2.4-31.el7.x86_64
libx264.so.142()(64bit) is needed by libquicktime-1.2.4-31.el7.x86_64
I can install these missing dependencies by querying for their package name and install them one by one manually. But this is so tedious and time consuming, so I am wondering if there is any one-strike single-line (or two) command that can automatically install all dependencies, as well as the target rpm file. I hear that yum has a similar function but I don't know how to use yum to install libquicktime because it complains "No package libquicktime available."
Thanks for any (working) answer.
PS: I'm using CentOS 7, so please don't point me to those too old CentOS 6 links. I've read them, they are only a waste of time on 7. Thanks.
(aside)
Some versions of rpm (but not you on Centos 7) can add missing dependencies when given a database of "everything" including paths to download the package from.
On Centos 7, yum is the best answer. You would need to configure a local repository in /etc/yum.repos.d/something pointing to a local repository.
The local repository (i.e. a local directory somewhere) should contain the libquicktime package, and you need to run createrepo in that directory to generate the repository metadata that yum uses to build a transaction.

golang and godep : Build\install after a golang dependency update when using godep?

I have followed the instructions # https://github.com/tools/godep regarding updating a dependency but when I go to build\install using the altered version it has not been updated within Godeps/_workspace/pkg
So I have
go get github.com/golang/glog
godep save
godep go install
and I can see
The modification timestamp in Godeps/_workspace/pkg/linux_amd64/github.com/golang/glog.a
The rev commit value in Godeps/Godeps.json
but now when I want to update I follow the instructions
go get github.com/golang/glog
godep update github.com/golang/glog
godep go install
I observe the following
The Godeps/Godeps.json rev commit has been updated
Godeps/_workspace/src/github.com/golang/ source is updated
But the file timestamp for odeps/_workspace/pkg/linux_amd64/github.com/golang/glog.a is not updated hence we are using the previous version
I believe I should add a .gitignore entry for pkg and bin, which means we would do a clean build on a fresh git clone
I know I could do a rm -r on both the pkg and bin directories before the godep go install command
Is this expected behavior ?
Thanks in advance
Pat
FYI
Since golang v1.4 I can now use the -a flag for the go install command, since it now longer tries to rebuild the standard library, see the v1.4 release notes section on the change to the build -a flag
Obviously this does not apply in pre v1.4 as it will attempt to rebuild the standard library packages

What files did `make install` copy, and where?

Is there a way to get a list of filenames/paths that make install copies to the filesystem? Some packages come with a MANIFEST file, but not the ones that I am working with.
I was just investigating this myself while compiling a custom version of QEMU. I used the following method to work out what was installed and where (as well as using it as a basis for a .deb file):
mkdir /tmp/installer
./configure --target-list=i386-softmmu
make
sudo make install DESTDIR=/tmp/installer
cd /tmp/installer
tree .
Tree is a utility that recursively displays the contents of a directory in a visually appealing manner - sudo apt-get install tree for Debian / Ubuntu users
Hope that helps someone... it took me a bit of poking around to nut it out, but I found it quite a useful way of visualising what was going on.
The most fool-proof way is to use chroot: have "make install" run inside a chroot jail; compute a list of the files that you had before the installation, and compare that to the list of files after the installation.
Many installations will support either a --prefix configuration option, and/or a DESTDIR environment variable. You can use those for a lighter-wait version of chroot (trusting that the installation will fail if it tries to write to a location outside these if you run installation as a fairly unprivileged user).
Another approach is to replace the install program. Many packages support an INSTALL environment variable that, well, is the install program to use; there are tracing versions of install around.
make uninstall might show the files as it removes them if the author of the compiling instructions provides the information to allow an uninstall (it has been awhile since I have done one so I can't say for sure).
Also make -n install will do a "dry run" of the install process and it may be reasonable to extract the information from its results.
It differs for every project that you run 'make install' on. The files which are installed are controlled by the install target in the Makefile being used. Your best bet is to open the Makefile and search for 'install:' - from there you can see what files will be copied out to your system.
Take a snapshot of the contents of the install location before installing
Install
Compare the current contents with the old contents.
Example:
./configure --prefix /usr/local
make -j`nproc`
find /usr/local | sort -u > /tmp/snapshot1
make install
find /usr/local | sort -u > /tmp/snapshot2
comm -3 /tmp/snapshot{1,2} # this prints the files added by `make install` to stdout
If the install program you're using doesn't support DESTDIR or --prefix (or an equivalent), I have found that it may be possible to identify new files as follows:
Start with as clean a system as possible (a fresh VM image is preferable)
Compile the software, wait a few minutes.
Install the software package.
Find files modified within the past 5 minutes: sudo find / -mmin -5 -type f (the find command has a ton of parameters for querying based on file modification / creation times, but this worked pretty well for me; you just need to narrow the time span so that you pick up the files created by the installer but nothing else).

Resources