sudo dkms add command issue - ubuntu-20.04

I am trying to setup my WIFI adapter settings. I have already run command
sudo apt install git build-essential dkms
when i try to do this
sudo dkms add ./rtlwifi_new
that shows me following error
Error! Could not find module source directory.
Directory: /usr/src/.-rtlwifi_new does not exist.
how I can fix this?

don't run this command in "rtlwifi_new" directory
so back one directory
cd ..

Related

Problem with installing Go on Ubuntu 20.04 server

I am new to Ubuntu and am trying to install Go onto my server, however I get an error when trying to use Go.
Command 'go' not found, but can be installed with:
sudo apt install golang-go # version 2:1.13~1ubuntu2, or
sudo apt install gccgo-go # version 2:1.13~1ubuntu2
The commands I used to install Go are below.
$ wget https://dl.google.com/go/go1.15.10.linux-amd64.tar.gz
$ sudo tar -xvf go1.15.10.linux-amd64.tar.gz
$ sudo mv go /usr/local
Then I appended the following to the bash_aliases file.
$ vi ~/.bash_aliases
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
What am I doing wrong here?
I will give you some suggest.
check your path var
echo $PATH
Since you edit ~/.bash_aliases, I think you maybe not source this file.
please try source ~/.bash_aliases.
or try
export $PATH=$PATH:/usr/local/go/bin
beside ~/.bash_aliases may not be load by default. see if . ~/.bash_aliases is in your ~/.bashrc file.
Check if bin can run
/usr/local/go/bin/go version
if have error, maybe is the package you download is wrong. checksum the tar package(for example: md5sum xxxx.tar.gz).
check the default path of go
which go
if go bin not in /usr/local/go/bin/go, you should delete the go bin that shown by which go
Using APT, there is an official package you can install using Ubuntu
Open a terminal and run:
sudo apt update
sudo apt install golang-go
Depending on your version of Ubuntu, you may have to run:
sudo apt install golang
Hope this helps! Its my first answer!

Accidentaly deleted some files in var/lib

I accidentally deleted some files in var/lib. I don't know what I have deleted. Terminal too then disappeared since I messed up with Gnome-Purge. I then reinstalled terminal using TTY. But then when I try to install some package, Unmet dependencies 'Try apt-fix broken install' with no package name. I do not want to reinstall Ubuntu.
Also I tried `sudo apt-get install -f. It returned:
I was able to find what packages are corrupt by doing sudo dpkg -C. The result is:
Try to reinstall ubuntu-desktop metapackage:
sudo apt-get install –reinstall ubuntu-desktop
sudo apt-get build-dep ubuntu-desktop
This will install again all the base system and dependencies without needing to format your computer. If you're using a flavor such as Xubuntu, just replace ubuntu-desktop with the corresponding metapackage, like xubuntu-desktop, kubuntu-desktop, etc.

Installing MongoDB

I get this error when installing MongoDB on OSX, even though the second time I tried it with sudo command. Any thought?
==> Checking out tag r3.0.3
==> ./build.sh
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/3.0.3 -j4 --osx-version-min=10.9 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --use-new-tools
Error: Permission denied - /usr/local/var/mongodb
Monas-MacBook-Pro:meanio mona$ sudo brew install mongodb
Password:
Error: Cowardly refusing to `sudo brew install`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
It's a permissions problem. The solution being:
sudo chown -R `whoami` /usr/local/var/mongodb
Per the comment:
Try creating the directory, prior to setting ownership:
sudo mkdir /usr/local/var/mongodb && sudo chown -R `whoami` /usr/local/var/mongodb
I just open /usr/local/ via finder and manually create folder with name var. Mac asked for a password. After that I successfully install MongoDB.
You shouldn't use brew with sudo. To check the overall brew sanity, run:
$ brew doctor
It will pinpoint potencial problems and it's corresponding solutions. If it really is a permission problem, as pointed by #hd1, you should fix the permissions of /usr/local/var/, where brew is trying to create the /mongodb folder.

Installing osm2pgsql from source not actually installing?

I'm trying to install osm2pgsql from source on a Mac using Terminal.
I ran these commands:
git clone git://github.com/openstreetmap/osm2pgsql.git
cd osm2pgsql
./autogen.sh && ./configure && make
And it runs, but then if I try to run an osm2pgsql command, it says:
-bash: osm2pgsql: command not found
There are no further instructions online about how to install from source, so I'm not sure what I'm missing here.
Anyone help me?
Thanks
You might need to install the build-essential and automake packages.
Type the following in the terminal (before trying to install osm2pgsql):
sudo apt-get install build-essential
sudo apt-get install automake
sudo apt-get install checkinstall
You need to add it to your path! To "install" something is really just to let the OS know where it is, because it's too dumb to figure that out on its own, even if you're in the same directory with it. In Unix, every command is a program; when you enter a command, the OS checks the "path" which is just a list of directories where that command might live.
First of all, to test that it's compiled and working properly in its own directory:
./osm2pgsql
If that works, add the current directory to the path variable:
export PATH=$PATH:`pwd`
Now you can execute the command from anywhere.

Permissions error for homebrew 'brew update' on linux

I've got a permission error with Homebrew ported to linux via this handy how-to:
http://blog.frameos.org/2010/11/10/mac-homebrew-ported-to-linux/comment-page-1/#comment-2208
I’ve got the same problem:
> $ brew update –verbose
>
> git checkout -q master fatal: Unable to create
> ‘/opt/homebrew/.git/index.lock’: Permission denied Error: Failure
> while executing: git checkout -q master
Tried changing the file permission on the ‘index’ file, no luck. My final goal is to be able to install freetds and tinytds on my Ubuntu server (brew install freetds) so if there's another way to do so please lemme know!
Sorry, the small tutorial was horribly broken...
In a nutshell:
sudo apt-get install build-essential
sudo mkdir /opt/homebrew
sudo chown `whoami` -R /opt/homebrew
git clone git://github.com/rubiojr/homebrew.git /opt/homebrew
Looks like you need to fix permissions when running with an unprivileged user?
chown -R `whoami` /opt/homebrew
Let me know if that helps.

Resources