Is there a way to install the package openjdk8 and to prevent perl to update on FreeBSD 9.2 ? - freebsd

I am currently trying to find a way to install the package openjdk8 on a FreeBSD 9.2.
To do that I used :
sudo pkg install openjdk8
It worked without any problem. However, this has also updated the perl package to the version 5.24. We have many scripts that work only with perl 5.16.3 so I would like to keep this version of perl.
I already tried to uninstall the perl 5.24 package and to reinstall perl 5.16.3 and it worked. So I am convinced openjdk doesn't really need to update this package. I already tried to lock the package perl 5.16.3 but openjdk8 refuse to install himself. I have this message :
perl 5.16.3 is locked and may not be modified
The installation ends and my package is not installed. Also, for specific reasons I don't want to use the port method. I absolutely want to use the pkg method.
So my question is this one : Is there a way to complete my installation of openjdk8 and to prohibit perl to update ?
Thanks for your help.

I finally found an answer to my question. By installing my package offline, it installs the minimum of dependencies. It's not a very popular way to install packages on FreeBSD but it works very well.
Just follow this :
sudo pkg install -F openjdk8
This command allow you to just fetch your packages and its dependencies. Once it's done, you have to find the location of the packages you just fetched.
sudo find / -n *.txz -print
For me the result was
/var/cache/pkg/openjdk8-8.112.16_1-1baeb24a94.txz
Then I go to this directory with :
cd /var/cache/pkg
Now you just have to use :
sudo pkg-static add openjdk8
That's all. It will extract the package and the minimum of dependencies.

Probably you are updating other packages and therefore is updating Perl, when installing openjdk8 no other dependencies are fetched also there is no perl dependency in the port Makefile.
This is the output when installing only openjdk8:
# pkg install openjdk8
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
openjdk8: 8.152.16
Number of packages to be installed: 1
The process will require 165 MiB more space.
Indeed you can install the package without having Perl.
What you can do is install openjdk8 and then install the version of Perl that you require, at the end, it should not modify/affect the openjdk8 package.
Also, this could be useful,
pkg install --dry openjdk8
This will check what will be installed.
And in case there is a dependency (let's say you don't have perl) this you could try this:
pkg install --ignore-missing openjdk8

Related

How do I uninstall Erlang R16B-03.18.el7 so I can install Erlang 25.0.3?

The R16B version isn't working with the latest version of RabbitMQ I'm trying to install on my VM (needs 23.3 or later) and I already tried to install 25.0.3 but it won't install because it's conflicting with the R16B files that exist.
file /usr/bin/typer from install of esl-erlang-25.0.3-1.x86_64 conflicts with file from package erlang-typer-R16B-03.18.el7.x86_64
That's the error I get. I tried rm -r erlang*.rpm and it asks for a reboot after completing but still gives the same errors.
With this command you just delete the rpm. What you want is to deinstall the rpm. You could use
dnf uninstall PACKAGENAME
where, in your case, PACKAGENAME whould be something like erlang-typer-R16B-03.18.el7.

Pacman upgrade causes conflict with not present packages

I'm on Arco Linux(the most basic one).
I have installed the nodejs package with pacman.
Now when I run sudo pacman -Su I am getting nodejs-lts-gallium and nodejs are in conflict. Remove nodejs? [y/N].
But when I run pacman -Qi nodejs-lts-gallium, it says error: package 'nodejs-lts-gallium' was not found
How do I remove the nodejs-lts-gallium artifacts causing the conflict?
What is happening is that an installed package had a new dependecy to nodejs-lts-gallium. Or a transitive dependency does. E.g. InstalledPackageA now depends on packageB that depends on nodejs-lts-gallium.
You can see what would be upgraded with the following command :
pacman -Su --print --print-format %n
From that you can check what package does explicitely depend on it, with for example (edited thanks to Harm's suggestion):
pacman -Si $(pacman -Su --print --print-format %n) | grep -B9 nodejs-lts-gallium
A package should appear Depends On [...] nodejs-lts-gallium, that's the package which requires it.

How to install older gcc package using APT from a repository?

I have GCC v9. But I'm trying to install a GCC 4.8.1 version to test a library compilation on that very old version of GCC.
The version is not available in the official Ubuntu repos,it is deprecated, but I've found it in other mirrors as told by the official GCC website. This one seems like popular one:
https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
I have very little knowledge of linux package systems except for the basic. I want to keep both versions. So I should do this:
sudo apt -y install gcc-4.8.1 gcc-9
The reason why I want to use this command and not install it from the file, apart from the difficulty of doing that for me, is that I'm following a guide in order to have several GCCs on my system:
https://www.fosslinux.com/39386/how-to-install-multiple-versions-of-gcc-and-g-on-ubuntu-20-04.htm
When I add the url to the sources.list file seems like it is working.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update -q
But when I try to call the install with gcc-4.8.1 or gcc-4.8 , or even gcc-4 the package doesn't exist.
Package gcc-4.8 is not available, but is referred to by another
package. This may mean that the package is missing, has been
obsoleted, or is only available from another source E: Package
'gcc-4.8' has no installation candidate
Also, I don't know if websites like these can be added to the repos list in order to find the package using APT:
http://www.netgull.com/gcc/releases/gcc-4.8.1/
[EDIT]
I downloaded the package from the website I linked. I have no idea how to install this by hand. If only I could find a repository that could help me with this... I have no idea how to make APT help me with the installation.
But I'm trying to install a GCC 4.8.1 version to test a library compilation on that very old version of GCC.
Developers have tools up their sleeve so they don't have to install dependencies and bloating their systems for every library (and every configuration of that library!) they want to try out and test.
Use docker. You could write for example a testing script, assuming your project uses make:
# test_my_lib_in_gcc-4.8.sh
#!/bin/sh
docker run -ti --rm -v $PWD:/project -w /project gcc:4.8 -u $UID:$GID sh <<EOF
make && make test
EOF
that will compile and test your application in using 4.8 gcc. Consider how easy it is to change gcc version - just change the number. You could test your library in gcc, in different versions, and using other compilers and on different distributions to make sure it works for others. If you're a developer of the library, write an automatized CI pipeline that would automatically test your application each commit in specific docker environment, using ex. https://docs.gitlab.com/ee/ci/README.html or https://travis-ci.org/ .

how to backup a installed rpm package in redhat?

I was install a package by rpm command in redhat, but the package is failure now.
I want create a new package from installed package.
what can I do?
This command would help you in that,
rpm -Fvh –repackage rpm-file-name.rpm
Here rpm-file-name.rpm is an existing package in Linux which will be repackage by using above option.
From man page of rpm;
–repackage Re-package the files before erasing.
–replacefiles Install the packages even if they replace files from
other, already installed, packages.
–replacepkgs Install the packages even if some of them are already
installed on this system.
rpmrebuild is built for re-creating RPM package files from already installed packages. There are options which allow you to tailor the packaging, but the most simple invocation just produces an RPM file from an installed package. Example: rpmrebuild coreutils

apt-get for Cygwin?

Is there any apt-get-like program for use with Cygwin?
I already tried cyg-apt but when I try I get this error:
cyg-apt: downloading: http://cygwin.mirrors.pair.com/setup-2.bz2
cyg-apt: downloading: http://cygwin.mirrors.pair.com/setup-2.ini
cyg-apt: bad URL http://cygwin.mirrors.pair.com/setup-2.ini, exiting.
Best I have ever used:
apt-cyg package manager
You can do this using Cygwin’s setup.exe from Windows command line. Example:
cd C:\cygwin64
setup-x86_64 -q -P wget,tar,gawk,bzip2,subversion,vim
For a more convenient installer, you may want to use the
apt-cyg package manager. Its syntax is
similar to apt-get, which is a plus. For this, follow the above steps and then
use Cygwin Bash for the following steps:
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
Now that apt-cyg is installed. Here are a few examples of installing some
packages:
apt-cyg install nano
apt-cyg install git
apt-cyg install ca-certificates
Update: you can read the more complex answer, which contains more methods and information.
There exists a couple of scripts, which can be used as simple package managers. But as far as I know, none of them allows you to upgrade packages, because it’s not an easy task on Windows since there is not possible to overwrite files in use. So you have to close all Cygwin instances first and then you can use Cygwin’s native setup.exe (which itself does the upgrade via “replace after reboot” method, when files are in use).
apt-cyg
The best one for me. Simply because it’s one of the most recent. It works correctly for both platforms - x86 and x86_64. There exists a lot of forks with some additional features. For example the kou1okada fork is one of improved versions.
Cygwin’s setup.exe
It has also command line mode. Moreover it allows you to upgrade all installed packages at once.
setup.exe-x86_64.exe -q --packages=bash,vim
Example use:
setup.exe-x86_64.exe -q --packages="bash,vim"
You can create an alias for easier use, for example:
alias cyg-get="/cygdrive/d/path/to/cygwin/setup-x86_64.exe -q -P"
Then you can for example install the Vim package with:
cyg-get vim
you can always make a bash alias to setup*.exe files in $home/.bashrc
cygwin 32bit
alias cyg-get="/cygdrive/c/cygwin/setup-x86.exe -q -P"
cygwin 64bit
alias cyg-get="/cygdrive/c/cygwin64/setup-x86_64.exe -q -P"
now you can install packages with
cyg-get <package>
This got it working for me:
curl https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg > \
apt-cyg && install apt-cyg /bin
No. The only officially supported tool for downloading and updating Cygwin packages is the setup.exe file you used for the initial install, although that can be invoked with command line arguments to help the process.
From that same page:
The basic reason for not having a more full-featured package manager is that such a program would need full access to all of Cygwin's POSIX functionality. That is, however, difficult to provide in a Cygwin-free environment, such as exists on first installation. Additionally, Windows does not easily allow overwriting of in-use executables so installing a new version of the Cygwin DLL while a package manager is using the DLL is problematic.
You can use Chocolatey to install cyg-get and then install your packages with it.
For example:
choco install cyg-get
Then:
cyg-get install my-package

Resources