LoginSignup
1
2

More than 5 years have passed since last update.

macportsでパッケージがインストールができない時の対処法

Posted at

macportsでパッケージをインストールしようとしたら、突然出来なくなった。
のでそんな時の対処法。

エラー

portをsyncするとエラーが出る。
ちなみに、指示されたselfupdateをしてもダメ。

$ port search gcc
Warning: Can't open index file for source: rsync://rsync.macports.org/macports/release/tarballs/ports.tar 
Error: search for name gcc failed: No index(es) found! Have you synced your port definitions? Try running 'port selfupdate'. 
No match for gcc found

対処法

1.sources.confを書き換える

端的に言えばportを持ってくるurlを変更する。

$sudo vi /opt/local/etc/macports/sources.conf 
#rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]←コメントアウト
 http://www.macports.org/files/ports.tar.gz [default]

2.portをアップデートする

Portをアップデートする。
下記のように上手くsync出来ていたらOK。

$ sudo port -d sync 
DEBUG: Copying /Users/XXXXXX/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences 
--->  Updating the ports tree 
Synchronizing local ports tree from http://www.macports.org/files/ports.tar.gz 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
                                 Dload  Upload   Total   Spent    Left  Speed 
100   178  100   178    0     0    679      0 --:--:-- --:--:-- --:--:--   679 
100 32.7M  100 32.7M    0     0  3239k      0  0:00:10  0:00:10 --:--:-- 4352k 
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2