port selfupdate: "macPorts sources: command execution failed" - macports

I am trying to selfupdate my Macports, but I am getting the following message:
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing
MacPorts sources: command execution failed
I checked my /opt/local/bin/macports and the directory does not exist. Instead, it is in /opt/local/var. Could that be the issue?
Running with -dt, I get the following:
[Users/user] > selfupdate
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/base
---> Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Connection refused (61)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/base/ /opt/local/var/macports/sources/rsync.macports.org/release/base
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed
What is error 61? Any ideas how I can fix that?

I had this same problem recently, and I forgot to run the command under root. If anyone else is having the problem, be sure to run command as so:
sudo port selfupdate

I was behind a firewall. Tried on a different network and it worked.

There is no /opt/local/bin/macports. The executable you need is /opt/local/bin/port. (Port files are in /opt/local/var/..., which is correct.)
Based on the command execution failed:
you might have forgotten to run as root.
port forks the following programs: rsync, tclsh, openssl, tar, chmod, chown.
Are these executable and in the PATH? (Is /opt/local/bin in your PATH as well?)
If that doesn't help, run port with -dt to get all sorts of debug info. That might help with finding the problem. Append the interesting parts to your question, maybe.

I faced the same issue.But I used to this method in the after.
Go to:
$prefix/etc/macports/sources.conf
(my path is like this):
/opt/local/etc/macports/sources.conf
comment out the rsync entry, and add a new entry as follows:
#rsync://rsync.macports.org/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
After that you can run:
sudo port -d sync
It's also explained on MacPorts.com.

Update for Mavericks: to ensure the XCode command line tools are installed, open a terminal and run xcode-select –-install, then follow the instructions in the resulting pop-up window:
accept license
Of course, this is in addition to the other tips such as making sure to run sudo port selfupdate.

If anybody else is having this issue and they've recently updated XCode, the root of my problem was that Command Line Tools had been omitted from the latest build.
Opening XCode and installing Command Line Tools via the XCode preference panel fixed this error being thrown by MacPorts.

If your company block the access via rsync you can use the http tarball. Explained here
Hope this helps.
EDIT: Now prefer to use homebrew

I too had the same error. It is because the network connection is rejected. If you are using University/Company WiFi or public connection, firewall would be refusing the connection.
As you can see from the output of -dt "rsync: failed to connect to rsync.macports.org: Connection refused (61)"
There are workarounds available which are provided on the macports site:
1) Using svn.
2) If svn fails too, you can try using Daily tarball.
You can test the changes by running "sudo port -d sync"
Note: If the https fails, you can replace it with http. But doing so is not recommended, as you will be fetching from insecure connection.

I faced the same issue.
The main problem was my network. Because the NETWORK Port was blocked for;
rsync://rsync.macports.org/release/tarballs/ports.tar
Try to use use another network.

for someone who's problem still exists, maybe you've forgot agree the Xcode license:
# sudo xcodebuild license
remember to look through and type 'agree' in the end.

In my case, the problem was internal to Macports! I updated rsync (the one delivered by Apple is old) with Macports and then Macports failed to use it (/opt/local/bin/rsync) but asked instead to use /usr/bin/rsync which does not exist (or has been erased to force using Macports rsync ?). I created a soft link between the two and now it works again.

Related

opam init fails - unable to create temp file

I have installed opam 2.1.0 on a Linux Virtualbox VM. When I try opam init, I get the following error:
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Could not update repository "default": OpamDownload.Download_fail(_, "Curl
failed: \"/snap/bin/curl --write-out %{http_code}\\\\n --retry 3
--retry-delay 2 --user-agent opam/2.1.0 -L -o
/tmp/opam-32196-d33843/index.tar.gz.part --
https://opam.ocaml.org/index.tar.gz\" exited with code 23")
[ERROR] Initial download of repository failed.
Running with --disable-sandboxing doesn't help. I know that its a problem creating/writing to /tmp/opam-... directory because if I replace that with my current directory or home directory the command by itself runs fine. It also runs fine with /tmp/opam-... if I use the --create-dirs option in curl but I don't have any way of getting opam init to use that option. Any ideas?
thanks
Update
The reason opam init failed for me was because curl was installed with snap on my system. This exactly what is going on with your VM.
Try to run opam init -verbose and that could reveal more about why you ran into an error.
In my case I needed to install other things with opam and it kept failing every time. So snap uninstall curl and then sudo apt install curl fixed things. (Was only able to figure this out with help from my professor)
Workaround
I ran into the same issue and I found a workaround on the OCaml forum: here. (Credits to UnixJunkie)
You can run:
opam init github git+https://github.com/ocaml/opam-repository.git
This should avoid the certificate issues. This worked for me.
I tried to fix the certificate issues using this answer as well. You could try doing that, but it seems complicated when the workaround is to simply point it to the github repo directly.
This question is similar to this one.

HTTP Server: Connection closed by foreign host

Attempting to get this HTTP webserver I found online running after downloading their source files (source: Webserver). [Files located at bottom of webpage.]
I attempted to compile it using their Makefile but there were some errors, where I just needed to #include some extra libraries. However, once I got that compiled and running (tested using telnet)
telnet localhost <port number>
I get the following:
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Then after 5 seconds or so it displays the following:
Connection closed by foreign host.
I'm not sure if the person who wrote it is still managing it so I figured I'd ask here. Any ideas as to why connection closes?
I'm running this on a Windows machine connected to a Unix server, so as the program site states, it should be running correctly on Unix machines.
in the file: reqhead.c
in the function: Get_Request()
There is a timed call to select()
You can change the timeout value (currently 5 seconds)
or replace the timeout parameter with a NULL parameter (although replacing with NULL would mean the code, once a connection is established would wait forever.)
First we will see ubuntu system log with this command
sudo gedit /var/log/syslog
and if you will see this error "execv( /usr/sbin/tcpd ) failed: No such file or directory"
then run this command
sudo apt-get install tcpd
It will solve your problem (if not then you need to search your system error on google)

MacPorts: install hangs/remains unusable

I've been trying to install MacPorts on a new Mac Pro with a fresh, fully updated Yosemite OS. The installer hangs on 'Running package scripts'. So I tried to build it from source. That works, with the installer stating:
Congratulations, you have successfully installed the MacPorts system.
However, it seems unusable. When I do sudo port install apache2 I get the message:
Error: Port apache2 not found
Simply trying to do a 'self update' (as root):
sh-3.2# port -d selfupdate
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync
receiving file list ... done
base.tar
...and then nothing... I've waited for half an hour, but it won't go any further. I can't find any logs either.
Again: there's nothing special about my setup, it's out-of-the-box Yosemite, only updated through the App store and, of course, I've installed Xcode with command line utilities and formally accepted the license, as is required according to the MacPorts site.
I've also tried uninstalling it, using the instructions from the MacPorts site, and reinstalling. But it does not make a difference.
I've read quite a few forum posts, but I can't find any post relating a problem like this. I hope someone can shed some light on this.
The installer hangs running package scripts because the last statement in these package scripts is exactly this "sudo port selfupdate" that you've been running manually afterwards.
Because this step did never run, your MacPorts installation lacks knowledge about the apache2 port (which is exactly why the installer runs selfupdate to give you a full-featured installation).
Unfortunately Apple's infrastructure (rsync.macports.org) seems to have connectivity problems at the moment, which is causing problems for quite a few people. You can try using one of the mirrors as outlined at https://trac.macports.org/wiki/Mirrors.

Opendaylight (odl) ovs-vsctl not found error

I am following this tutorial: https://wiki.opendaylight.org/view/Getting_started
I am trying to use the following code in opendaylight using karaf
ovs-vsctl show
But the command window says Command not found: ovs-vsctl
I have installed all the necessary libraries and the local host server (http://localhost:8181/dlux/index.html) is running fine. But somehow odl can't find ovs.
Can anyone tell me what's the error? I am running win 8.
Thank you
You need to run this command outside of karaf terminal.
Firstly, you should have ovs(Open Virtual Switch) or Mininet installed, and then create one or two open switches.
Basically, you started the SDN controller in karaf, and now in the step you are encountering problem, the switches need to be assigned ODL controller as their manager.
You must check also that ovsdb is already installed in karaf.
For that, try to execute the next command:
feature:list | grep ovsdb
That command will display all the ovsdb components/features that are available in your karaf distribution. The third column will indicate you if a given component is already installed or not (if you see an X, that means that the component is installed). If you want to install a component/feature:
feature:install <name_of_the_feature>
After that, try to execute it outside of karaf, as Sidhant01 has indicated you before.
Try to do it with sudo:
sudo ovs-vsctl show.
If you want to configure ovsdb in an active mode:
tools-vm:~$ sudo ovs-vsctl set-manager tcp:127.0.0.1:6640
tools-vm:~$ sudo ovs-vsctl show
98d8cf7a-44b1-4b02-a60c-7d832409d06f
Manager "tcp:127.0.0.1:6640"
is_connected: true
ovs_version: "2.0.2"
Cheers

MacPorts failed install port

I have trouble installing PHP, MySQL and Apache2 using MacPorts. Currently my OS is Mavericks and i'm downloading the official binary package for mavericks (also tried compile from source and running selfupdate) but I got this error message:
---> Building readline
Error: org.macports.build for port readline returned: command execution failed
Error: Failed to install readline
Please see the log file for port readline for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_readline/readline/main.log
Error: The following dependencies were not installed: apache2 apr-util mysql5 readline tcp_wrappers sqlite3 libedit pcre bzip2 autoconf213 gawk xz m4 gsed libtool libxml2 mhash pkgconfig
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port php5 failed
How can I solve this?
Thanks
Can you please check the error message block within the log file:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_readline/readline/main.log
Also make sure xcode command line tools are installed.
FYI: I faced similar error in Mavericks. My case was:
opt is a different partition which is mounted in /Volumes/opt
/opt is a symbolic link to /Volumes/opt.
It has been solved after editing /opt/local/etc/macports/macports.conf by replacing /opt with /Volumes/opt. Note sure this can help your case.

Resources