LoginSignup
0
1

More than 5 years have passed since last update.

Vulsのアップデートが失敗する場合の対処法

Posted at

概要

Vulsをアップデートしようとした際に、失敗する場合がある。
知っていれば「あぁ、、そんなことか」と分かるけど、知らないと「?」となるので、メモ書きを残しておきます。

エラーになる?

git pullして、make install仕様とした際に、以下のような状況になる場合があります。

  • GNUmakefile:27: ターゲット 'dep' のレシピで失敗しましたmake: *** [dep] エラー 1 になる
vuls:~/go/src/github.com/future-architect/vuls$ git pull
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 78 (delta 59), reused 66 (delta 56), pack-reused 5
Unpacking objects: 100% (78/78), done.
From https://github.com/future-architect/vuls
   c002f01..8ebb663  master     -> origin/master
 * [new branch]      fix-redhat-deep-scan -> origin/fix-redhat-deep-scan
 * [new branch]      fix-redhat-false-positive -> origin/fix-redhat-false-positive
 * [new branch]      fix-yum-changelog-option -> origin/fix-yum-changelog-option
 + f5dad86...20e623f redhat-changelog-cache -> origin/redhat-changelog-cache  (forced update)
   ab35944..642b4c3  v0.5.0     -> origin/v0.5.0
Updating c002f01..8ebb663
Fast-forward
 README.fr.md          | 224 ----------------------------------
 README.ja.md          |   5 +-
 README.md             |   8 +-
 commands/tui.go       |   1 +
 oval/redhat.go        |  29 +++++
 oval/util.go          |  39 +++++-
 oval/util_test.go     | 705 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 scan/executil.go      |   1 -
 scan/executil_test.go |   2 +-
 scan/redhat.go        |  14 ++-
 10 files changed, 776 insertions(+), 252 deletions(-)
 delete mode 100644 README.fr.md
vuls@terra00:~/go/src/github.com/future-architect/vuls$ rm -rf vendor/
vuls@terra00:~/go/src/github.com/future-architect/vuls$ make install
go get -u github.com/golang/dep/...
package github.com/golang/dep/internal/gps: cannot find package "github.com/golang/dep/internal/gps" in any of:
        /usr/local/go/src/github.com/golang/dep/internal/gps (from $GOROOT)
        /opt/vuls/go/src/github.com/golang/dep/internal/gps (from $GOPATH)
package github.com/golang/dep/internal/gps/internal/pb: cannot find package "github.com/golang/dep/internal/gps/internal/pb" in any of:
        /usr/local/go/src/github.com/golang/dep/internal/gps/internal/pb (from $GOROOT)
        /opt/vuls/go/src/github.com/golang/dep/internal/gps/internal/pb (from $GOPATH)
package github.com/golang/dep/internal/gps/paths: cannot find package "github.com/golang/dep/internal/gps/paths" in any of:
        /usr/local/go/src/github.com/golang/dep/internal/gps/paths (from $GOROOT)
        /opt/vuls/go/src/github.com/golang/dep/internal/gps/paths (from $GOPATH)
package github.com/golang/dep/internal/gps/pkgtree: cannot find package "github.com/golang/dep/internal/gps/pkgtree" in any of:
        /usr/local/go/src/github.com/golang/dep/internal/gps/pkgtree (from $GOROOT)
        /opt/vuls/go/src/github.com/golang/dep/internal/gps/pkgtree (from $GOPATH)
GNUmakefile:27: ターゲット 'dep' のレシピで失敗しました
make: *** [dep] エラー 1
vuls:~/go/src/github.com/future-architect/vuls$ 

対処方法

エラー前に package github.com/golang/.. : cannot find package .. 等が出ているので、vulsの依存関係として導入された者の更新が必要そう、と推定できます。

/opt/vuls/go/src/
├── github.com
│   ├── Masterminds  <----こことか
│   │   └── glide
│   ├── future-architect
│   │   └── vuls
│   ├── golang  <----こことか(今回のエラーはここ)
│   │   ├── dep
│   │   └── lint
│   └── kotakanbe
│       ├── go-cpe-dictionary
│       ├── go-cve-dictionary
│       └── goval-dictionary
└── golang.org  <----こことか
    └── x
        └── tools

対象をここにアップデートするより、消して 最新版を自動で入れてしまった方が楽です。

  • rm -rf /opt/vuls/go/src/golang.org
  • rm -rf /opt/vuls/go/src/github.com/golang
    • 今回の場合は、こちらだけ削除すればよいですね
  • vulsのディレクトリに戻って、make install

以上です。

0
1
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
0
1