Hi @kirannbishwa01,
It should work as you are doing but it for some reason it does not work with this BSgenome. karyoploteR ultimately relies on the function getBSgenome from BSgenome to load the necessary BSgenomes on the fly. As an example I tried downloading and installing "BSgenome.Vvinifera.URGI.IGGP12Xv2" and loading with getBSgenome("BSgenome.Vvinifera.URGI.IGGP12Xv2") and it worked perfectly. However, doing the same with your genome results in an error:
getBSgenome("BSgenome.Alyrata.JGI.v1")
Error in .getBSgenomeObjectFromInstalledPkgname(genome) :
BSgenome.Alyrata.JGI.v1 doesn't look like a valid BSgenome data package
All this to tell you that there seems to be an error in the genome package you are using and the problem is not in your code or karyoploteR's code,
Now, is there a workaround? Absolutely. The genome parameter of plotKaryotype also accepts GRanges and BSgenome objects.
Therefore, you can simply load the BSgenome with library and use the object it creates to start your plot:
library(BSgenome.Alyrata.JGI.v1)
kp <- plotKaryotype(genome=Alyrata)
Note that Alyrata is not quoted, since you are passing in the actual BSgenome object.
This would be useful too for your second question. As far as I know, GTF files are not suposed to contain the genome information but features mapped onto a genome. In any case, If you are able to get the names and lengths of your chromosomes into a BED file (simply a tab separated file with three columns, chr.name, start and end) then you can load it into R (for example using toGRanges("file.name")) and use it in the genome parameter of plotKaryotype.
As @VHahaut said, you can find more information at https://bernatgel.github.io/karyoploter_tutorial//Tutorial/CustomGenomes/CustomGenomes.html.
PS: I'm copying the answer to the question you have posted in the bioconductor support site. In general is better if you do not post the same question in both sites.