With Pkg.gc, I often get errors regarding .directory file in the directory of a package. I guess the .directory file was generated by the system automatically. I have to manually remove the file for gc to continue.
(v1.1) pkg> gc
Active manifests at:
`/home/user/.julia/environments/v0.7/Manifest.toml`
`/home/user/.julia/environments/v1.1/Manifest.toml`
ERROR: SystemError: unable to read directory /home/user/.julia/packages/Plots/.directory: Not a directory
Stacktrace:
[1] #walkdir#14(::Bool, ::Bool, ::typeof(throw), ::Function, ::String) at ./file.jl:0
[2] walkdir at ./file.jl:679 [inlined]
[3] (::getfield(Pkg.API, Symbol("#recursive_dir_size#48")))(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:275
[4] #gc#45(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:314
[5] gc at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:273 [inlined]
[6] do_gc!(::Dict{Symbol,Any}, ::Array{String,1}, ::Dict{Symbol,Any}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:592
[7] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:686
[8] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:685
[9] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:542
[10] #do_cmd#30(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:507
[11] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:503 [inlined]
[12] (::getfield(Pkg.REPLMode, Symbol("##41#44")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:842
[13] #invokelatest#1 at ./essentials.jl:686 [inlined]
[14] invokelatest at ./essentials.jl:685 [inlined]
[15] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/LineEdit.jl:2261
[16] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:1029
[17] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:191
[18] (::getfield(Base, Symbol("##719#721")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
[19] #invokelatest#1 at ./essentials.jl:686 [inlined]
[20] invokelatest at ./essentials.jl:685 [inlined]
[21] macro expansion at ./logging.jl:308 [inlined]
[22] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:330
[23] exec_options(::Base.JLOptions) at ./client.jl:242
[24] _start() at ./client.jl:421