diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index a4c1831..05a06ca 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -51,6 +51,7 @@ class Rbpkg::Repo
sh_ci_dir = sh_quote(ci_dir)
sh_ci_profile = sh_quote(ci_dir + '/etc/profile')
if File.directory?(ci_dir)
+ cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg upgrade"
Rbpkg::Log.add("rbpkg_ci.#{name}.upgrade")
cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg checkout #{sh_quote(commit)} #{sh_name}"
cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg upgrade #{sh_name}"