port selfupdate: “macPorts sources: command execution failed”

后端 未结 11 1877
梦毁少年i
梦毁少年i 2021-01-30 19:29

I am trying to selfupdate my Macports, but I am getting the following message:

Error: /opt/local/bin/port: port selfupdate failed: Error synchronizi         


        
相关标签:
11条回答
  • 2021-01-30 20:06

    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.

    0 讨论(0)
  • 2021-01-30 20:09

    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.

    0 讨论(0)
  • 2021-01-30 20:12

    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.

    0 讨论(0)
  • 2021-01-30 20:19

    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.

    0 讨论(0)
  • 2021-01-30 20:24

    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

    0 讨论(0)
  • 2021-01-30 20:26

    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
    
    0 讨论(0)
提交回复
热议问题