# Pkg.add behaves very strongly for Julia version 0.7

**URL:** https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686
**Category:** Internals & Design
**Created:** [January 16, 2019, 9:33am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686 "2019-01-16T09:33:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 16, 2019, 9:33am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/1 "2019-01-16T09:33:32Z")

</div>

I’m using Julia version 0.7. and I’d like to add version 0.1.2 of the package “GDAL” and pin it. The following is the command I used.  
‘using Pkg  
Pkg.add(PackageSpec(name = “GDAL”, version = “0.1.2”))  
Pkg.pin(“GDAL”)  
Pkg.installed(“GDAL”)’

in the end, Pkg.installed(“GDAL”) still gives me v"0.2.0". It simply does not work in Julia 0.7. Or maybe I need to do this manually by my hand to delete the un-liked version and copy and paste the liked version. 😉

---

<div class="post-metadata">

### Author: ![Simon\_Bolland](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simon_bolland/32/8920_2.png) [@Simon\_Bolland](https://discourse.julialang.org/u/Simon_Bolland)
#### Post date: [January 16, 2019, 10:26am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/2 "2019-01-16T10:26:41Z")

</div>

The problem is  
`Pkg.pin(“GDAL”)`

From help:

```julia
help?> Pkg.pin
  Pkg.pin(pkg::Union{String, Vector{String}})
  Pkg.pin(pkgs::Union{Packagespec, Vector{Packagespec}})

  Pin a package to the current version (or the one given in the packagespec or a certain git revision. A pinned package is never updated.

```

Try:

```julia
Pkg.pin(PackageSpec(name = "GDAL", version = "0.1.2"))

```

---

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 16, 2019, 10:39am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/3 "2019-01-16T10:39:12Z")

</div>

Hi, Simon, thank you for the quick reply. I tried and got the following error message.

> Julia\> Pkg.pin(PackageSpec(name = “GDAL”, version = “0.1.2”))
> 
> Error: the following package names could not be resolved: \* GDAL(add… in manifest but not in project) Please specify by known ‘name=uuid’.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [January 16, 2019, 11:17am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/4 "2019-01-16T11:17:56Z")

</div>

If possible, I would try with 1.0.3. Pkg has gotten numerous bugfixes since 0.7.

---

<div class="post-metadata">

### Author: ![Simon\_Bolland](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simon_bolland/32/8920_2.png) [@Simon\_Bolland](https://discourse.julialang.org/u/Simon_Bolland)
#### Post date: [January 16, 2019, 11:39am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/5 "2019-01-16T11:39:23Z")

</div>

I’m puzzled as it works for me, both on Windows and Linux.  
You may need someone who knows Pkg internals better than I do.

For reference, the exact sequence of steps that works for me and related output:

```julia
julia> using Pkg

julia> Pkg.add(PackageSpec(name = "GDAL", version = "0.1.2"))
  Updating registry at `C:\Users\simon\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed GDAL ─ v0.1.2
  Updating `C:\Users\simon\.julia\environments\v0.7\Project.toml`
  [add2ef01] + GDAL v0.1.2
  Updating `C:\Users\simon\.julia\environments\v0.7\Manifest.toml`
  [add2ef01] + GDAL v0.1.2
  Building GDAL → `C:\Users\simon\.julia\packages\GDAL\1n3nf\deps\build.log`

julia> Pkg.pin(PackageSpec(name = "GDAL", version = "0.1.2"))
 Resolving package versions...
  Updating `C:\Users\simon\.julia\environments\v0.7\Project.toml`
  [add2ef01] ~ GDAL v0.1.2 ⇒ v0.1.2 ⚲
  Updating `C:\Users\simon\.julia\environments\v0.7\Manifest.toml`
  [add2ef01] ~ GDAL v0.1.2 ⇒ v0.1.2 ⚲

julia> Pkg.installed()["GDAL"]
v"0.1.2"

```

---

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 16, 2019, 11:50am UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/6 "2019-01-16T11:50:50Z")

</div>

I’m using Julia 0.7 on Linux. I will attach a picture of the screenshot soon.

---

<div class="post-metadata">

### Author: ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)
#### Post date: [January 16, 2019, 1:39pm UTC](https://discourse.julialang.org/t/pkg-add-behaves-very-strongly-for-julia-version-0-7/19686/8 "2019-01-16T13:39:21Z")

</div>

after I remove several other “related” packages and tried again, it’s working this time.

> julia\> Pkg.installed()  
> Dict{String,Union{Nothing, VersionNumber}} with 5 entries:  
> “Juno” =\> v"0.5.3"  
> “OpenStreetMapX” =\> v"0.1.1"  
> “Plots” =\> v"0.19.3"  
> “Atom” =\> v"0.7.12"  
> “OpenStreetMapXPlot” =\> v"0.1.0"
> 
> julia\> Pkg.add(PackageSpec(name = “GDAL”, version = “0.1.2”))  
> Resolving package versions…  
> Updating `~/.julia/environments/v0.7/Project.toml`  
> [add2ef01] + GDAL v0.1.2  
> Updating `~/.julia/environments/v0.7/Manifest.toml`  
> [add2ef01] + GDAL v0.1.2
> 
> julia\> Pkg.pin(PackageSpec(name = “GDAL”, version = “0.1.2”))  
> Resolving package versions…  
> Updating `~/.julia/environments/v0.7/Project.toml`  
> [add2ef01] ~ GDAL v0.1.2 ⇒ v0.1.2 ⚲  
> Updating `~/.julia/environments/v0.7/Manifest.toml`  
> [add2ef01] ~ GDAL v0.1.2 ⇒ v0.1.2 ⚲
> 
> julia\> Pkg.installed()  
> Dict{String,Union{Nothing, VersionNumber}} with 6 entries:  
> “Juno” =\> v"0.5.3"  
> “OpenStreetMapX” =\> v"0.1.1"  
> “GDAL” =\> v"0.1.2"  
> “Plots” =\> v"0.19.3"  
> “Atom” =\> v"0.7.12"  
> “OpenStreetMapXPlot” =\> v"0.1.0"
