Recreate an RPM from an installed RPM on linux [closed] - linux

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 7 years ago.
Improve this question
How do I recreate an rpm which is already installed on a system on linux?

What version of RPM are you using? If you're using a newer one, I have a trick that might work for you.
Newer versions of RPM have a transaction safe rollback option; simply use the --repackage command, and it'll generate a package that includes all the idiosyncratic crap of the original install. Mind you, you'll have to actually DO something (e.g rpm -e --repackage rpm_goes_here which will ERASE the original, while making a package which you SHOULD be able to restore (after you've made a copy), but if you expect this to work perfectly, I have a BRIDGE you might want to buy), so it's a bit of a leap of faith if you don't have a full backup.
There is some configuration involved, and you need to test test test before you try this on something critical, but this may work.

Basically you will have to do the following:
1] Create a .spec file with all the headers [ http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html ]
You will have to use the rpm -q --queryformat "" to get the header from the already installed rpm.
Eg. rpm -q --queryformat "Release: %{RELEASE}\n" installed_rpm
For getting the files to fill the %files Section use the rpm -ql command.
2] run rpmbuild -bb specfile to generate the rpm file.

Best way to recreate an RPM, is to do it from the source RPM. Great tutorial here.

The deltarpm package can do that:
A deltarpm contains the difference between an old and a new version of
a rpm, which makes it possible to recreate the new rpm from the
deltarpm and the old one. You don't have to have a copy of the old
rpm, deltarpms can also work with installed rpms.

Related

Instaling yum with dependencies on an embedded 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 3 years ago.
Improve this question
I am fairly new to Linux, and am more familiar with use of rpm and yum, the latter of course resolves dependencies and installs the whole package. I have primarily used CentOs.
I am now trying to use an embedded Linux which is quite basic and only has rpm, no dnf or yum. I wanted to install yum, so I could have some flexibility with managing packages, but using rpm, all I get is a whole bunch of dependencies, some of which I try and resolve, like dnf and python-dnf, before it becomes a never ending list.
Is there an easier way to get yum installed on my system?
To do this is sample, straight (and boring) process.
First you find where is located package for your distribution and architecture and get the URL. For example for x86_64, CentOS 8 is (one of the mirrors):
http://centos.telecoms.bg/8/BaseOS/x86_64/os/Packages/yum-4.0.9.2-5.el8.noarch.rpm
Next you need to get dependencies of this package (based on what you have already installed) (to be run as root)
# rpm -q -R http://centos.telecoms.bg/8/AppStream/x86_64/os/Packages/anaconda-29.19.0.40-1.el8.x86_64.rpm
/bin/sh
/bin/sh
anaconda-core = 29.19.0.40-1.el8
anaconda-gui = 29.19.0.40-1.el8
anaconda-install-env-deps = 29.19.0.40-1.el8
anaconda-tui = 29.19.0.40-1.el8
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1
(in above example I use different package)
So you have already /bin/sh but need anaconda-core anaconda-gui anaconda-install-env-deps anaconda-tui rpmlib
Next you search for the URL of those packages in the repo. And check them one by one for dependencies. After getting all the URLs you create one long line to install all of them. Or install first the prerequisites and then the package.
rpm -i http://centos.telecoms.bg/8/AppStream/x86_64/os/Packages/anaconda-29.19.0.40-1.el8.x86_64.rpm \
http://centos.telecoms.bg/8/AppStream/x86_64/os/Packages/anaconda-core-29.19.0.40-1.el8.x86_64.rpm \
http://centos.telecoms.bg/8/AppStream/x86_64/os/Packages/anaconda-gui-29.19.0.40-1.el8.x86_64.rpm \
http://centos.telecoms.bg/8/AppStream/x86_64/os/Packages/anaconda-install-env-deps-29.19.0.40-1.el8.x86_64.rpm \
.....

Can I Run docker on linux mint 13? [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 7 years ago.
Improve this question
I've tried to install docker on my machine, following the instructions for Precise 12.04 found here.
When I try:
curl -sSL https://get.docker.com/ | sh
I get the result:
Either your platform is not easily detectable, is not supported by this
installer script (yet - PRs welcome! [hack/install.sh]), or does not yet have
a package for Docker. Please visit the following URL for more detailed
installation instructions:
https://docs.docker.com/en/latest/installation/
My kernel:
$ uname -r
3.13.0-61-generic
You can download the short installer script to take a look at why it is giving you this message:
curl -sSL https://get.docker.com/ >install-docker.sh
$EDITOR install-docker.sh
Doing that, I see several checks for lsb_release. Is your system missing that command? If so, see this to install it. Or maybe it’s not returning “ubuntu”. If you fix this, the docker installer script may work fine.
If that doesn’t work, you can hard-code a case for your OS (Mint?) in the ubuntu|debian case (line 243), like:
ubuntu|debian|linuxmint) # or maybe you’ll need here: *)
When done editing (or installing lsb_release), run the script to see if it will complete:
sudo ./install-docker.sh

Zip and unzip a directory and its 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 4 years ago.
Improve this question
I am a newbie in Linux. Whats is the complete process to zip and unzip a directory and its files? Please mention if any installation has to be done.
To zip a folder and it's contents recursively:
zip -r archivefile foldername
To unzip a zip file:
unzip archivefile
I had alot of trouble using unzip giving me errors like
sql.zip has more than one entry--rest ignored
Etc.
Using php worked like a sharm. Oneliner:
php -r '$zip = new ZipArchive; $zip->open("db.sql.zip"); $zip->extractTo("./"); $zip->close(); echo "Yay!";'
Run in cmd / terminal after php is installed
Several options exist, the most common ones:
On CLI (command line interface) there are the two utilities zip and unzip which do the obvious thing. For example to compress a directory "my-folder" with all its content using the zip algorithm you would do a zip -r my-folder.zip myfolder. To uncompress it your would use unzip my-folder.zip. Paths are always relative to the current working directory, so where you execute the command. Take a look at the "man page" to find out about the usage: man zip.
There are also GUI utilities (so utilities with a graphical user interface), but it depends on what desktop environment you use, since they are typically integrated. There is ark for KDE and a differente service menus that can be used for example in the file manager dolphin. There certainly are similar solutions for desktop environments like GNOME or Unity.
The question what packages you have to install depends a bit on the Linux distribution you use. The package names may vary slightly, but in general you certainly should be able to find the "zip" package in your local package management system.

Completely uninstall openldap from Redhat Linux server [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 have performed the following steps to install OpenLdap on my Redhat Linux Server:
1. untar the tar file
2. ./configure <--this ran successfully without error
3. make depend
4. make
5. make test <-- couldn't find any error
6. make install
7. started slapd: /usr/local/sbin/slapd
But the service is not starting. I don't see any slapd process in the ps -lef | grep slapd output. Also I see this, when i run : ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
What could be the error and also How can I completely uninstall OPENLDAP
There are two questions here:
What could be the error?
It's possible that you haven't appropriately configured slapd. There are probably errors in your syslog (/var/log/messages) that will help you diagnose problems. You can also run slapd in debugging mode (slapd -d none) to see errors displayed on your terminal.
How can I completely uninstall OpenLDAP?
That's a little tricky, since you (a) elected to install it from source rather than using an existing package and (b) you didn't install it into a dedicated directory. To completely uninstall it, you would have to pay close attention to what files are installed by running make install and then remove them.
However, there's no harm in leaving the files installed on your system as long as you're not using them. You can remove anything that was installed into /usr/local/bin or /usr/local/sbin if you want to prevent them from conflicting with versions of those commands installed via system packages.
If OpenLDAP is the only thing you've installed in /usr/local you can just remove any files below that directory.
Generally, if you can use the pre-packaged versions of software available in your Linux distribution your life will be easier. For example, if you were to install the RedHat openldap-servers package, you would have a default configuration that would allow slapd to start and run correctly.
To uninstall. look through either the log output from the configure command, or type "configure --help" to see a list of directories that things are installed in by default. Most likely it populated files into /usr/local/bin, /usr/local/lib, and so forth, so you'll need to into those directories and remove the files by hand.

Linux rpm installs but cannot erase. Why? [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 4 years ago.
Improve this question
My Perl code installed several (4) rpm files as root. the next install removes them (rpm -e) before installing a newer version. One does not remove, with rpm -e giving the error that it is not installed. However, later when the updated file is installed, the message is given that it is already installed.
Manual attempts to remove give the same results. My questions are how to force removal something from the rpm database, and why does this contradication exist (not installed from rpm -e and already installed from rpm -Uvh and rpm -ivh)?
Once installed, use the package name, not the package filename.
You should not need to remove a package before upgrading it. Doing so means that one or both of the packages are broken.
The reason it is not erased is likely because one of the scriptlets is failing. Do it manually and watch for errors. If it mentions a failed scriptlet, try erasing it with rpm -e --noscripts
rpm -e --force will not forcibly remove a package, rpm -e --nodeps will by stopping it to check for other dependencies.
It's possible your RPM database is in some way bent out of shape, you may wish to try an rpm --rebuilddb

Resources