Question: For some reason I'm getting this error:

> 
> Uncaught ReferenceError: $stateProvider is not defined
> 
> 
> 

even though `angular-ui-router.js` is being loaded fine.

Here is my code 

```
(function () {
    var mod = angular.module('MyApp', ['ui.router']);
    debugger;
    mod.config(['$stateProvider', '$locationProvider', function ($stateProvider, $locationProvider) {
        $stateProvider.state('product', {
            url: "/home/product",
            views: {
                "view1": {
                    templateUrl: "/Angular/Components/Products/Products.html",
                    controller: "Ctr_Products",
                }
            }
        });

    $locationProvider.html5Mode({
        enabled: true, requireBase: false
    });
}]);

```

Answer: 
If you look at `/usr/bin/add-apt-repository` it says

```
#!/usr/bin/python3

```

at the top. If you updated with a newer python (e.g. dist had 3.5 but you installed 3.7) your `/usr/bin/python3` points to a python that does not have `apt_pkg`.

You can temporarily edit `/usr/bin/add-apt-repository` to point to

```
#!/usr/bin/python3.5

```

(insert your distro python version)
Install python-dev module for specific version of python:

```
sudo apt install python3.6-dev

```