# WHy does PKG want to downgrade the version of the GNU c compiler when I try to install something?



## mrredeyeflight (Jun 3, 2018)

Hello
I was trying to install some package with pkg and it wanted to downgrade the GNU c compile to a earlier version? I don't want to do that? I was also wondering why the Versions of software packages in the ports is not the same version that pkg installs? The pkg install gdb installs 6.1.1 and the ports version is gdb 8.1.2. When I tried to install darkable with pkg it  wanted to uninstall the gnome-terminal? Why would I ever want that?
How do I get pkg install to install the latest version?

Thanks


----------



## talsamon (Jun 3, 2018)

I guess you have no /usr/local/etc/pkg/repos/FreeBSD.conf and pkg tries to install the "quarterly" branch.

If it is so, create this file and put in:

```
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  enabled: yes
  signature_type : "FINGERPRINTS",
  fingerprints : "/usr/share/keys/pkg"
}
```


----------



## mrredeyeflight (Jun 3, 2018)

Thank you


----------



## ShelLuser (Jun 3, 2018)

Just wondering: have you ever mixed ports with packages?  So; installed software using `make install` as well as with using `pkg install`?

I'm kind of convinced that you have and if so then that's your answer. Mixing those two concepts is generally speaking a bad thing.

The reason I'm thinking in this direction is because the used repository shouldn't matter. I mean: you may have installed software using the quarterly repository but that doesn't mean that you'd suddenly be looking at package inconsistencies. Those do not happen just because you started using FreeBSD and relied on quarterly. It can't: because everything else you grabbed came from that same quarterly as well.

As such my theory: you mixed ports and packages, or you messed with package repositories yourself. And I'm thinking the first.

In case you're wondering why mixing this is a bad thing(tm) then this might be useful:

https://forums.freebsd.org/threads/guide-about-ports-and-binary-packages.62126/


----------



## Phishfry (Jun 3, 2018)

Similar question here, hope I am not threadjacking.
I was suprised when yesterday I downloaded net-mgmt/kismet while exploring wireless tools in ports.
It had only one dependency.
gcc6
I was trying to figure out why a compiler would be required for a binary package. I don't get it.
No big deal but made me scratch my head. I only use packages.

Note: Kismet may not be the actual offender, I installed  3 or 4 packages yesterday and it was one of those programs.


----------



## rigoletto@ (Jun 3, 2018)

Phishfry 

I give a kick look on net-mgmt/kismet port and it does not ask for gcc anywhere in there.


----------



## Phishfry (Jun 3, 2018)

Then it was one of these then:
mail/claws-mail-clamd
net-mgmt/aircrack-ng
net/wireshark

I see it is aircrack that has runtime dependancy on gcc7 ?


----------



## rigoletto@ (Jun 3, 2018)

What `pkg info -r gcc6` give you?


----------



## Phishfry (Jun 3, 2018)

I could have sworn it had one dependency--gcc6.

```
toot@E6420:~ #  pkg info -r gcc6
pkg: No package(s) matching gcc6
toot@E6420:~ # pkg info -r gcc7
gcc7-7.3.0_4:
    aircrack-ng-1.2
```


----------



## Phishfry (Jun 3, 2018)

No big deal, I just remember thinking how odd, no dependencies but a compiler needed.


----------



## rigoletto@ (Jun 3, 2018)

Yep, aircrack-ng have `USE_GCC=7+` set.

The interesting fact is, as far I am concerned, that would just add `gcc` as buildtime dependency and not at runtime. Have you built aircrack-ng manually and do not have used `pkg autoremove` later?

Btw, the maintainer is lme@ who can eventually pop-up in here.


----------



## ShelLuser (Jun 3, 2018)

Even so, all of this does not explain a possible downgrade. Sorry Phishfry but in a way you are "thread jacking" I think because your problem doesn't appear to be related to the OP at all. Yours is about pulling in GCC while the OP wondered about downgrading GCC.


----------



## rigoletto@ (Jun 3, 2018)

Without more information from OP it is hard to say. Some package may need a specific gcc version and the others can use a range of versions, or something like that.


----------



## Phishfry (Jun 3, 2018)

lebarondemerde said:


> Have you built aircrack-ng manually and do not have used  pkg autoremove later?


No. All packages. I am working on a port right now on another dedicated machine to avoid problems.
Lets drop this topic. I don't wanna threadjack.


----------



## shkhln (Jun 3, 2018)

At least with gdb there is no downgrade: 6.1.1 is a part of the base system. I assume the gcc bit is the result of a similar confusion.


----------



## mrredeyeflight (Jun 7, 2018)

ShelLuser said:


> Just wondering: have you ever mixed ports with packages?  So; installed software using `make install` as well as with using `pkg install`?
> 
> I'm kind of convinced that you have and if so then that's your answer. Mixing those two concepts is generally speaking a bad thing.
> 
> ...


I will read the article, thanks


----------



## mrredeyeflight (Jun 8, 2018)

Phishfry said:


> Then it was one of these then:
> mail/claws-mail-clamd
> net-mgmt/aircrack-ng
> net/wireshark
> ...


I installed net/wireshark


----------

