# Screwed Up Installation Trying to Upgrade to 10.1



## AntumDeluge (Dec 21, 2014)

So, I foolishly went ahead and tried to upgrade from 10.0 to 10.1 without backing up. I'm not concerned about that though because it is not an important install. If worse comes to worst I grab my files off the machine and do a fresh install.

My machine is hardwired to my router which has the default gateway of 192.168.0.1. I use the LXDE desktop with GDM login manager.

I successfully upgraded the kernel to 10.1 (binary download, did not build from source). The machine would boot up fine and into my desktop environment. The command `uname -a` would display "FreeBSD 10.1-RELEASE". I then decided to upgrade my ports. While doing so I decided that I would upgrade and rebuild ALL of them, even though documentation says it's only necessary to do so after upgrading to a major release version. I wanted to upgrade them all because I knew there were some errors on my system and I hoped the upgrades would fix them.

I tried a few methods to upgrade which returned with failure. One method was ports-mgmt/portmaster. Unfortunately I made a mistake with portmaster that uninstalled and cleaned perhaps 4 or more ports, the names of which I do not know. I stopped it before it uninstalled any more. I'm not sure if this has to do with the problems that I am having now, but possibly.

The last method I tried, which seemed to work best, was with ports-mgmt/portupgrade. The command I used was `$ sudo portupgrade -GBafn` followed by `$ sudo portupgrade -GBaf` (I'm going off of memory, but I'm pretty sure those are the exact commands I used). The first command I used to preview what would happen without actually making any changes. It seemed to finish okay so I went ahead with the actual upgrade.

Many of the ports failed to upgrade. After repeating the command a few times without any success I issued the command `$ sudo freebsd-update install` then rebooted the system: `sudo shutdown -r now`.

After restarting the machine it could not load my X environment (GDM). There was no output displayed, just a black screen. I tried rebooting a couple times without success. So, I booted into single user mode as root and mounted the filesystem as rewritable: `$ mount -f -o rw /dev/ada0p2 /` (not sure if that is the correct way to do it). It gave the output "WARNING: / not properly dismounted" but it seemed to work okay as I was able to write to the filesystem.

So I logged in to my account (`$ login`) and began the upgrade process again (`$ sudo portupgrade -GBa`). I can't remember if I used the "force" switch (-f) this time as I think I was just trying to upgrade the ones that were out of date at this point, but I don't remember for sure. It seemed to be working fine but said that many of the ports failed to upgrade at the end. It may have even said that all ports had failed, I can't remember.

So, I rebooted again and mounted the filesystem as read-write. But now I could not connect to the FreeBSD mirrors nor the internet. I tested an internet connection with wget:

```
$ wget http://debreate.sourceforge.net/index.php
converted 'http://debreate.sourceforge.net/index.php' (US-ASCII) -> 'http://debreate.sourceforge.net/index.php' (UTF-8)
--2014-12-20 08:43:21-- http://debreate.sourceforge.net/index.php
Resolving debreate.sourceforge.net (debreate.sourceforge.net)... failed: hostname nor servname provided, or not known.
wget: unable to resolve host address 'debreate.sourceforge.net'
```
Sorry if there are any typos in that code, I did not copy and paste.

Here is some network information from my system. Please let me know if there is anything else I should provide:

/etc/resolv.conf (this matches my Linux installation's /etc/resolv.conf file, which is working on a different box):

```
# Generated by resolvconf
search PK5001Z
nameserver 192.168.0.1
nameserver 205.171.2.226
```
My working Linux's /etc/resolv.conf:

```
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#  DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.1
nameserver 205.171.2.226
search PK5001Z
```

ifconfig output:

```
$ ifconfig
bge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
            options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
            ether 00:19:b9:28:a5:2a
            nd6 options=21<PERFORNUD,AUTO_LINKLOCAL>
            media: Ethernet autoselect
lo0: flags=8008<LOOPBACK,MULTICAST> metric 0 mtu 16384
            options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
            n6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```
Again, I'm sorry if there are any typos. I will double check it.

I cannot run lspci as a linked object is missing:

```
$ lspci
Shared object "libpci.so" not found, required by "lspci"
```

I suppose a missing library could be part of my issue, but I would think that I would get a similar message to the above.

If dmesg output is needed I will try to get it though it will probably be difficult.

Thanks for any help and again, it is not super important that I get this fixed as I can do a fresh install (though I prefer not to). I tried to follow the upgrading instructions in the handbook but perhaps I didn't not follow it closely enough.


----------



## chrbr (Dec 21, 2014)

The output of ifconfig does not show any IP-adress. I guess the network needs to be configured first. See https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/config-network-setup.html for details.


----------



## gkbsd (Dec 21, 2014)

You could try, even if you manage your packages from ports, to execute `pkg-static upgrade -f` first, and then add `USE_PKGNG="YES"` to /etc/make.conf. Finally, try again a `portmaster -af`. Theses steps fixed some issues I had on a jail, but I cannot guarantee it will work for you (you need a working internet connection first).

Regards,
Guillaume


----------



## AntumDeluge (Dec 21, 2014)

I think that helped me make a little progress. After running `service netif restart`:

```
$ ifconfig
    bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
    ether 00:19:b9:28:a5:2a
    inet 192.168.2.121 netmask 0xffffff00 broadcast 192.168.2.255
    nd6 options=29<PERFORNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet 127.0.0.1 netmask 0xff000000
    n6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```
I can ping my router and machines on my local network, but I still cannot ping remote servers:

```
ping -c5 freebsd.org
ping: cannot resolve freebsd.org: Host name lookup failure
```
/etc/hosts:

```
...
::1                       localhost localhost.my.domain
127.0.0.1            localhost
192.168.2.121    FreeBSD.PK5001Z FreeBSD
```
/etc/rc.conf:

```
...
hostname="FreeBSD"
ifconfig_bge0="inet 192.168.2.121 netmask 255.255.255.0"
defaultrouter="192.168.2.1"
...
```


----------



## AntumDeluge (Dec 21, 2014)

I changed my /etc/resolv.conf file:

```
nameserver 192.168.2.1
nameserver 205.171.2.226
search PK5001Z
```
After `service netif restart`:

```
$ ping -c5 freebsd.org
PING freebsd.org (8.8.178.110): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host

--- freebsd.org ping statistics ---
5 packets transmitted, 0 packets received, 100.0% packet loss
```
It looks like it finds the IP address but cannot receive anything from it.

*--- Edit ---*

Running `service routing restart` fixed it. Now I can ping FreeBSD.org. The wget command works now too. Thank you. 

Hopefully, it will stay working after a restart.

*--- Edit ---*

Nope, I have to run both service commands after I restart.


----------



## chrbr (Dec 21, 2014)

Dear AntumDeluge ,
As far as I know the scripts you start by `service` are located in /etc/rc.d and should be started automatically if everything is in order. On my system the permissions are as the example below.

```
root@esprimo:/etc/rc.d # ls -l netif*
-r-xr-xr-x  1 root  wheel  5621 20 Mai  2014 netif
```
Maybe this is already of some help. If not it needs an more experienced person to help instead of myself.


----------



## AntumDeluge (Dec 21, 2014)

Everything appears to be okay in /etc/rc.d. On top of that my X server can't start. I reinstalled all 3rd party software via packages, but still not working. Whenever the X server tries to load the system freezes up. I can start SLiM display manager, but it freezes and I can't do anything.

Anyway, I'm getting tired of messing with it. If I don't get it figured out soon I'm doing a re-install.


----------



## AntumDeluge (Dec 21, 2014)

I think the last thing I will try (which is basically a re-install) is downloading all the release packages from http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.1-RELEASE/ and installing/extracting them to my system. Maybe this will overwrite some screwed up configurations.


----------



## gessel (Feb 16, 2015)

Did this work?  I have similar issues and suspect the libraries got munged.


----------



## AntumDeluge (Feb 16, 2015)

No, I ended up screwing things up more and finally did a fresh install. A more experienced person probably could have fixed it.


----------



## gessel (Feb 16, 2015)

Thanks for the update.  I was hoping there was an easy way out, but I have done exactly the same and am in the process of doing a fresh install myself.


----------

