How to connect a package to a repository?

On Fedora 31 (fresh install, I’m a new Linux user), I installed Visual Studio Code. The Discover software gave an error when I opened the rpm file in it, so I installed Code using the dnf command in the terminal. The program installed great, but I notice that when I list it, it shows “@commandline” as the repository. I assume because that’s how I installed it.

Now I came across the Visual Code repository on their website, and I’ve added it. It shows on my dnf repolist properly. My Code package (dnf list code) still shows it “@commandline”. How do I connect the package to the repository now?

2 Likes

You don’t. When an update comes, the package will replace the one you installed via dnf command and then it will show that comes from the repository. You can use the command dnf info code to check if there is another version. Also other thing you can do is to reinstall dnf reinstall code but IMHO you don’t need that.

2 Likes

You can simple install VS Code as a flatpak from flathub: https://flathub.org/apps/details/com.visualstudio.code

flatpak install flathub com.visualstudio.code

1 Like

Thanks for the response, but how will dnf know that there is an update? I mean, when I do “dnf update”, it won’t even check the Code repository since it is not in my repolist. Do I have to run dnf info for it to check?

BTW, I did reinstall code and that also did the trick, but I’m curious about the above anyway.

How exactly did you install it? Did you download a .rpm file that you installed?

Yes, Discover didnt work for it, gives me a GPG bad signature, and a persistent warning about Appstream being set up (though I have that installed). That’s a separate issue.

I used dnf to install it directly from the terminal line. It worked find but showed commandline as the repository. I added the VS code repository afterward but I’m not sure if the Code package would ever be updated since dnf would not look for it since Code is not connected to it?

Though now that I think about it, dnf probably goes through all the installed packages and matches them against all the repositories, and would make the connection, changing “@commandline” —> “(code repository)”.

I’m just trying to understand Linux and packages/repositories. I think that last paragraph is correct?

Hi @sarovan

If dnf identifies a package as being from @commandline, it is not a problem. Its alright. dnf is only saying that the package was installed from a terminal (command line) and not from a repository. When an updated version of the package becomes available in one of your configured repositories, the package will still be updated. After that update, dnf will then indicate the new source repository.

Relax … you’ll understand it when there is an update

3 Likes

Perfect, thanks for the help, all of you. It’s great to be part of a friendly community!

2 Likes

Can you show us the output of

dnf repolist

Thanks

2 Likes

Which one is the Code Repository there?

1 Like

Oops, sorry, that was an old screenshot

1 Like

Looking at your screenshot, I can deduce that when I issue:
sudo dnf list code

I should get an output that looks like this:

Installed Packages
code.x86_64 <version-installed-from-terminal> @@commandline
Available Packages
code.x86_64 <version-available-in-repository> code

If the version installed is lower than the one in the repository, you can run the following:
sudo dnf update code

After that update, dnf will then list code as being from the repository (code) and no longer as being from the terminal (@@commandline)

2 Likes