The first command you ran "sourced" a file - it basically read a file and set some environment variables - because that is what was in that file. The second one ran a command to install stuff and it referenced a variable - that variable was not mentioned in the sourced file.
In general, when you install a package in Ubuntu or Debian you should not do anything more fancy than:
$ sudo apt install <package>
Don't put -y - you can then read any messages and make up your own mind what to do. If you know what you are doing then obviously use -y.
You may find this handy:
$ apt-cache search cockpit
There are loads of web site scrapes these days relating to Linux stuff, just as Windows pioneered them years ago.
Sign up to the forums for say Debian, Ubuntu, Arch and Gentoo and Mint, Fedora too. Don't rely on a general search unless you really know what you are looking for.
The first command you ran "sourced" a file - it basically read a file and set some environment variables - because that is what was in that file. The second one ran a command to install stuff and it referenced a variable - that variable was not mentioned in the sourced file.
In general, when you install a package in Ubuntu or Debian you should not do anything more fancy than:
$ sudo apt install <package>
Don't put -y - you can then read any messages and make up your own mind what to do. If you know what you are doing then obviously use -y.
You may find this handy:
$ apt-cache search cockpit
There are loads of web site scrapes these days relating to Linux stuff, just as Windows pioneered them years ago.
Sign up to the forums for say Debian, Ubuntu, Arch and Gentoo and Mint, Fedora too. Don't rely on a general search unless you really know what you are looking for.