opam install Curl failed - ocaml

newbie question:
I have opam version 2.0.5 installed on windows 10 (using cygwin).
I tried to opam install utop
all but 3 out of the 22 packages installed fine, so i don't think it is network issues.
What can I do about the 3 that don't install, and why is this happening? (I have tried on two seperate days).
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[camomile.1.0.2] found in cache
[charInfo_width.1.1.0] found in cache
[cppo.1.6.6] found in cache
[dune.2.1.2] found in cache
[dune-configurator.2.1.2] found in cache
[dune-private-libs.2.1.2] found in cache
[lambda-term.2.0.3] found in cache
[lwt.5.1.1] found in cache
[lwt_log.1.1.1] found in cache
[lwt_react.1.1.3] found in cache
[mmap.1.1.0] found in cache
[ocamlbuild.0.14.0] found in cache
[ocplib-endian.1.0] found in cache
[result.1.4] found in cache
[WARNING] ocamlfind.1.8.1: download of
http://download.camlcity.org/download/findlib-1.8.1.tar.gz failed
(http://download.camlcity.org/download/findlib-1.8.1.tar.gz (Curl
failed: "D:\\cygwin64\\bin\\curl.exe --write-out %{http_code}\\n
--retry 3 --retry-delay 2 --user-agent opam/2.0.5 -L -o
D:/cygwin64/home/ysg4206/.opam/ocaml-variants.4.07.1+mingw64c/.opam-sw
itch/sources/ocamlfind.1.8.1/findlib-1.8.1.tar.gz.part
http://download.camlcity.org/download/findlib-1.8.1.tar.gz" exited
with code 28)), trying mirror
[utop.2.4.3] found in cachep] [topkg.1.0.1: http]
Processing 21/22: [ocamlfind.1.8.1: http] [topkg.1.0.1: htt
[zed.2.0.4] found in cache
[ERROR] The sources of the following couldn't be obtained, aborting:
- ocamlfind.1.8.1: Curl failed
- react.1.2.1: Curl failed
- topkg.1.0.1: Curl failed
ysg4206#YSG4206 ~
$ opam --version
2.0.5

Related

Failure to "opam init", how to manually specify index.tar.gz?

I cannot opam init:
$ opam init --verbose
[NOTE] Will configure from built-in defaults.
Checking for available remotes: rsync and local, git, mercurial.
- you won't be able to use darcs repositories unless you install the darcs command on your system.
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Could not update repository "default": OpamDownload.Download_fail(_, "Curl failed: \"/usr/bin/curl --write-out %{http_code}\\\\n --retry 3 --retry-delay 2
--user-agent opam/2.0.7 -L -o /tmp/opam-1697-6d07ae/index.tar.gz.part https://opam.ocaml.org/index.tar.gz\" exited with code 28")
[ERROR] Initial download of repository failed
However, I've manually downloaded index.tar.gz. How to manually specify index.tar.gz to opam init?
System info:
$ uname -a
CYGWIN_NT-10.0-19043 xxx 3.4.5-1.x86_64 2023-01-19 19:09 UTC x86_64 Cygwin
P.S. I'm trying to build one project using OCaml, but it turned out that it is very tricky: either OCaml complains about compatibility (is not a compiled interface for this version of OCaml followed by It seems to be for an older version of OCaml; does it mean that OCaml is not backward compatible?), either opam init fails, either <whatever>.
Your error message indicates that you either have network problems or very poor connection. Also, you opam version is very old, so it might not handle bad networks very well, I would suggest your installing a newer version of opam (at least 2.1.x), or, if it is possible, switching to docker or a virtual machine.
Answering your original question: I don't think there is a way (at least officially supported to specify your own downloaded index). Also, if you have trouble with downloading the index it most likely means that you will have more trouble in the future with your network when opam will start downloading actual packages.

I don't know how to fix this error when installing homebrew and mingw

I was trying to install mingw-w64 with homebrew to use C++ on my Macbook (intel chip).
I followed a tutorial I found on youtube: https://www.youtube.com/watch?v=KhGnYWplLVo&t=310s
Everything was going well until the terminal won't show up anything about the installation. It was at this specific point when I was installing homebrew:
==> Tapping homebrew/core
remote: Enumerating objects: 1148169, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 1148169 (delta 2), reused 3 (delta 0), pack-reused 1148162
Receiving objects: 100% (1148169/1148169), 455.12 MiB | 5.71 MiB/s, done.
Resolving deltas: 100% (793326/793326), done.
I tried typing something but it didn't seem to response. So I pressed Control+C and it worked normal again.
I wasn't sure if the installation was successful or not (later on I found that when the installation is done then it will appear this line: ==> Installation successful!)
I then used this command brew install MinGW-w64 to instal MinGW and got this error
Tapped 3967 casks (4,038 files, 309.3MB).
Warning: No available formula with the name "mingw-w64".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
I tried uninstalling homebrew and then installed it again but nothing worked.
I also used brew config and brew doctor and these are the inputs
Macs-MacBook-Air:~ mac$ brew config
HOMEBREW_VERSION: 3.3.16-55-g377ac64
ORIGIN: https://github.com/Homebrew/brew
HEAD: 377ac6475c8785dc80d50df3c6b173065d32183d
Last commit: 13 hours ago
Core tap ORIGIN: https://github.com/Homebrew/brew
Core tap HEAD: 377ac6475c8785dc80d50df3c6b173065d32183d
Core tap last commit: 13 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.8 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/bin/ruby
CPU: quad-core 64-bit broadwell
Clang: 10.0.1 build 1001
Git: 2.20.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.14.6-x86_64
CLT: 10.3.0.0.1.1562985497
Xcode: N/A
Macs-MacBook-Air:~ mac$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 11.3.1.
Warning: Homebrew/homebrew-core was not tapped properly! Run:
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Warning: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

Script cache:clear returned with error code 255 Fatal error: Uncaught Error: Class 'Doctrine\Bundle\DoctrineCacheBundle\DoctrineC

I have a Symfony project that works very well locally but when I put it on the server and I make the command composer install --prefer-dist --no-interaction --no-dev --optimize-autoloader I have every time this error
[c1131570c#web44 falah]$ rm -rf vendor && composer install --prefer-dist --no-interaction --no-dev --optimize-autoloader
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 78 installs, 0 updates, 0 removals
- Installing symfony/flex (v1.4.5): Loading from cache
- Installing doctrine/cache (v1.8.0): Loading from cache
- Installing doctrine/collections (v1.6.2): Loading from cache
- Installing doctrine/event-manager (v1.0.0): Loading from cache
- Installing doctrine/lexer (1.1.0): Loading from cache
- Installing doctrine/annotations (v1.7.0): Loading from cache
- Installing doctrine/reflection (v1.0.0): Loading from cache
- Installing egulias/email-validator (2.1.10): Loading from cache
- Installing symfony/polyfill-mbstring (v1.12.0): Loading from cache
- Installing twig/twig (v2.11.3): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing psr/cache (1.0.1): Loading from cache
Script cache:clear returned with error code 255
!!
!! Fatal error: Uncaught Error: Class 'Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle' not found in /home/c1131570c/public_html/falah/src/Kernel.php:23
!! Stack trace:
!! #0 /home/c1131570c/public_html/falah/vendor/symfony/http-kernel/Kernel.php(424): App\Kernel->registerBundles()
!! #1 /home/c1131570c/public_html/falah/vendor/symfony/http-kernel/Kernel.php(130): Symfony\Component\HttpKernel\Kernel->initializeBundles()
!! #2 /home/c1131570c/public_html/falah/vendor/symfony/framework-bundle/Console/Application.php(65): Symfony\Component\HttpKernel\Kernel->boot()
!! #3 /home/c1131570c/public_html/falah/vendor/symfony/console/Application.php(145): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
!! #4 /home/c1131570c/public_html/falah/bin/console(42): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
!! #5 {main}
!! thrown in /home/c1131570c/public_html/falah/src/Kernel.php on line 23
!!
Script #auto-scripts was called via post-install-cmd
I try to put on a server with php 7.3

Can't install php imap extension on centos 7

Running command
sudo yum install php56w-imap
gives me the output:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
* webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php56w-imap.x86_64 0:5.6.22-1.w7 will be installed
--> Processing Dependency: libc-client.so.2007()(64bit) for package: php56w-imap-5.6.22-1.w7.x86_64
--> Finished Dependency Resolution
Error: Package: php56w-imap-5.6.22-1.w7.x86_64 (webtatic)
**Requires: libc-client.so.2007()(64bit)**
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I'm avoiding any compilation, so the --libdir=/usr/lib64 option for compiling php is not what I'm looking for.
Also, I couldn't find any valid download link for this library.
Please help!
I found it:
https://www.rpmfind.net/linux/rpm2html/search.php?query=libc-client.so.2007()(64bit)
What I tried to install is libc-client-devel but it failed for dependency. with this libc-client, everything works well
just install first with command:
yum install php-imap*
I was getting an SE_UID not found error.
I just stumbled on https://centos.pkgs.org/7/ius-x86_64/php72u-imap-7.2.17-1.ius.centos7.x86_64.rpm.html
and then I ran:
yum install php72u-imap
I also created a php file with echo phpinfo() and saw that IMAP now shows up as a separate section in the display.

Installing Camomile via opam fails due to missing patch file. How can I fix this?

While installing utop via opam on my ArchLinux laptop, I got the following message:
$ opam install utop
The following actions will be performed:
- install camomile.0.8.5 [required by utop]
- install zed.1.3 [required by utop]
- install lambda-term.1.6 [required by utop]
- install utop.1.14
4 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n]
=-=-= Installing camomile.0.8.5 =-=-=
Applying cmxs.patch.
[ERROR] Due to some errors while processing camomile.0.8.5, the following actions will NOT proceed:
- install utop.1.14
- install lambda-term.1.6
- install zed.1.3
===== ERROR while installing camomile.0.8.5 =====
Could not get the source for camomile.0.8.5:
# opam-version 1.1.1
# os linux
Patch file "/home/sinan/.opam/system/build/camomile.0.8.5/cmxs.patch" not found.
'opam install utop' failed.
Trying to install camomile by itself also gives the same error. This seems to be related to commit 672e44e which carried over to the opam repository as cmxs.patch. I am not sure where things break so that opam tries to build without the patch file.
I tried downloading, and putting cmxs.patch in the reported location, but, of course, that directory gets clobbered the next time I try to install via opam.
How should I proceed?
I would have preferred to have been able to fix the underlying problem, but, in the end, downloading the contents of the cmxs.patch file, adding it to the already downloaded ~/.opam/archives/camomile.0.8.5+opam.tar.gz archive, and then issuing
$ opam install camomile
worked.
After that, opam install utop went without a hitch as well.
For your reference, I have:
$ opam --version
1.1.1
$ cat .opam/repo/default/repo
upstream: "https://github.com/ocaml/opam-repository/tree/master/"
browse: "https://opam.ocaml.org/pkg/"