MobaXterm apt-get permanently install packages - apt

I am using MobaXterm 10.8 portable.
Whenever I install any package with
$ apt-get install nano
I can use the package for the whole MobaXterm session.
But these packages vanish when closing MobaXterm.
On the other hand, plugins are persistent.
Is there any way to make apt-get packages also permanent?

The solution is setting a specific Settings -> General -> Persistent root (/) directory, instead of the default < Temp >:

Related

How to switch with SmartGit to non commercial version on Ubuntu 20.04

I use Ubuntu 20.04. After 30 days of using SmartGit, it wants to change to commercial version. I use it for personal purposes.
I tried this:
How to change SmartGit's licensing option after 30 days of commercial use on ubuntu?
and this:
https://www.syntevo.com/blog/?p=3669
but couldn't find such folders and files.
I also uninstalled and reinstalled it three times with these commands:
sudo apt remove smartgit
sudo apt autoclean && sudo apt autoremove
and
sudo apt install smartgit
but nothing changed.
So can anyone know a way how to change to non commercial version of SmartGit on Ubuntu 20.04?
Only applying "Delete the config files of SmartGit" part was enough for me.
So:
rm -rf ~/.config/smartgit
Then run smartgit and it asks for licensing options again like the first install.
Yes the other options for smartgit are lost removing the folder completely so a fine tuning may be done to this approach if needed.
Wow, I found the solution!
With the help of this:
https://askubuntu.com/questions/244754/how-to-completely-remove-application
So the process is
Remove SmartGit
sudo apt remove smartgit
sudo apt autoclean && sudo apt autoremove
Delete the config files of SmartGit
Navigate to the home directory,
Ctrl + H to show the hidden folders,
in the .config folder
delete the smartgit folder.
Install SmartGit
sudo apt install smartgit
Choose the free non-commercial option
Be careful. Choose not the default option but
the free non-commercial option.

nvm with yarn Yarn requires Node.js 4.0 or higher to be installed

I have nvm:
nvm ls
v8.11.3
v8.11.4
-> v11.1.0
default -> 8.11.4 (-> v8.11.4)
node -> stable (-> v11.1.0) (default)
stable -> 11.1 (-> v11.1.0) (default)
I installed yarn with:
sudo apt-get install --no-install-recommends yarn
I also added in .bashrc alias node=nodejs. But when I try yarn install I see:
Yarn requires Node.js 4.0 or higher to be installed.
How can I fix it?
This gist helped on this problem.
Run the following commands
echo "==> Installing Yarn package manager"
rm -rf ~/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
# Yarn configurations
export PATH="$HOME/.yarn/bin:$PATH"
yarn config set prefix ~/.yarn -g
And add the following in ~/.bashrc
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
It should then work properly without the warning after restarting the shell.
First uninstall the nodejs package:
sudo apt remove nodejs
Ubuntu 16.04 contains a version of Node.js in its default repositories that can be used to easily provide a consistent experience across multiple systems. At the time of writing, the version in the repositories is v4.2.6. This will not be the latest version, but it should be quite stable and sufficient for quick experimentation with the language.
In order to get this version, we just have to use the apt package manager. We should refresh our local package index first, and then install from the repositories:
sudo apt-get update
sudo apt-get install nodejs
If the package in the repositories suits your needs, this is all you need to do to get set up with Node.js. In most cases, you’ll also want to also install npm, which is the Node.js package manager. You can do this by typing:
sudo apt-get install npm
This will allow you to easily install modules and packages to use with Node.js.
Because of a conflict with another package, the executable from the Ubuntu repositories is called nodejs instead of node. Keep this in mind as you are running software.
To check which version of Node.js you have installed after these initial steps, type:
nodejs -v
Screenshot for nodejs version
I just want to mention that my configuration file looked something like that
export PATH=$PATH:`yarn global bin`
#NVM INITIALIZATION STUFF
(yarn docs recommended $PATH)
the export was before my nvm initialization. Which meant node was not available during the runtime of that line. So I just switched my configuration file to be
#NVM INITIALIZATION STUFF
export PATH=$PATH:`yarn global bin`
I had the same issue. by putting nvm path above yarn path didn't solve the issue then I looked up for a solution in man page and solve the issue by setting default node version on a shell.
Current lts version is v14.17.6 so i install it use it and set default node version on a shell.
nvm install --lts
nvm use --lts
nvm alias default <version>
Additional you can set always default to the latest available node version on a shell by running below command.
nvm alias node <version>

How to uninstall Go?

I tried the answer here Removed golang but go command still works?, but it didn't work (I can still run go)
Currently, when I run which go I see this output
/usr/local/go/bin/go
I think I had two installations of go as my GOPATH was pointing to another folder named gocode. I've now removed that folder, and the usr/local/go/bin/go folder.
I've also removed my GOPATH. However, I can still run go.
How do I uninstall go?
Update August 2019
Found the official uninstall docs worked as expected (on Mac OSX).
$ which go
/usr/local/go/bin/go
In summary, to uninstall:
$ sudo rm -rf /usr/local/go
$ sudo rm /etc/paths.d/go
Then, did a fresh install with homebrew using brew install go. Now, i have:
$ which go
/usr/local/bin/go
You might try
rm -rvf /usr/local/go/
then remove any mention of go in e.g. your ~/.bashrc; then you need at least to logout and login.
However, be careful when doing that. You might break your system badly if something is wrong.
PS. I am assuming a Linux or POSIX system.
I'm using Ubuntu. I spent a whole morning fixing this, tried all different solutions, when I type go version, it's still there, really annoying...
Finally this worked for me, hope this will help!
sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go
On a Mac-OS system
If you have used an installer, you can uninstall golang by using the same installer.
If you have installed from source
rm -rf /usr/local/go
rm -rf $(echo $GOPATH)
Then, remove all entries related to go i.e. GOROOT, GOPATH from ~/.bash_profile and run
source ~/.bash_profile
On a Linux system
rm -rf /usr/local/go
rm -rf $(echo $GOPATH)
Then, remove all entries related to go i.e. GOROOT, GOPATH from ~/.bashrc and run
source ~/.bashrc
For Windows 10:
Go to Apps in the Settings App.
Look for Go Programming Language * in the list and uninstall it.
Remove C:\Go\bin from your PATH environment variable (only if you don't plan on installing another version of golang)
Update (Sep, 2022)
The official page has changed path for the uninstallation help along with the help text. Here is what it says now.
Uninstalling Go
You can remove Go from your system using the steps
described in this topic.
Linux / macOS / FreeBSD
Delete the go directory.
This is usually
/usr/local/go.
Remove the Go bin directory from your PATH environment variable.
Under Linux and FreeBSD, edit /etc/profile or $HOME/.profile. If you
installed Go with the macOS package, remove the /etc/paths.d/go file.
Windows
The simplest way to remove Go is via Add/Remove Programs in
the Windows control panel:
In Control Panel, double-click Add/Remove Programs.
In Add/Remove
Programs, select Go Programming Language, click Uninstall, then follow
the prompts.
For removing Go with tools, you can also use the command
line:
Uninstall using the command line by running the following command:
msiexec /x go{{version}}.windows-{{cpu-arch}}.msi /q
Note: Using this
uninstall process for Windows will automatically remove Windows
environment variables created by the original installation.
Original Answer
From the official install page -
To remove an existing Go installation from your system delete the go
directory. This is usually /usr/local/go under Linux, macOS, and
FreeBSD or c:\Go under Windows.
You should also remove the Go bin directory from your PATH environment
variable. Under Linux and FreeBSD you should edit /etc/profile or
$HOME/.profile. If you installed Go with the macOS package then you
should remove the /etc/paths.d/go file. Windows users should read the
section about setting environment variables under Windows.
Use this command to uninstall Golang for Ubuntu.
This will remove just the golang-go package itself.
sudo apt-get remove golang-go
Uninstall golang-go and its dependencies:
sudo apt-get remove --auto-remove golang-go
To uninstall go on MacOS, do this:
On the terminal type which go it will; return a path like this /usr/local/go/bin/go
Go to the root folder of go which is /usr/local/go/ and type on the terminal rm -rf /usr/local/go/ . you may get permission denied depending on your system setup, so the command should be prefixed with sudo like this
sudo rm -rf /usr/local/go/
It will request for your password, just enter it.
sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go
This is perfect for Ubuntu 18.18
On a Mac-OS Catalina
need to add sudo before rm -rf /usr/local/go sudo rm -rf /usr/local/go
otherwise, we will run into permission denial.
sudo vim ~/.profile or sudo ~/.bash_profile remove export PATH=$PATH:$GOPATH/BIN or anything related to
go lang
If you use Zsh shell, then you need to remove the above line to ~/.zshrc file.
Hope it helps you :)
I just have to answer here after reading such super-basic advice in the other answers.
For MacOS the default paths are:
/user/bracicot/go (working dir)
/usr/local/go (install dir)
When uninstalling remove both directories.
If you've installed manually obviously these directories may be in other places.
One script I came across installed to /usr/local/.go/ a hidden folder because of permissioning... this could trip you up.
In terminal check:
echo $GOPATH
echo $GOROOT
#and
go version
For me after deleting all go folders I was still getting a go version.
Digging through my system path echo $PATH
/Users/bracicot/google-cloud-sdk/bin:/usr/local/bin:
revealed some places to check for still-existing go files such as /usr/local/bin
Another user mentioned: /etc/paths.d/go
You may also want to remove GOPATH and GOROOT environment variables.
Check .zshsrc and or .bash_profile.
Or you can unset GOPATH and unset GOROOT
In MacOS, you can just do it with brew:
brew uninstall go
brew install go
brew upgrade go
On linux we can do like this to remove go completely:
rm -rf "/usr/local/.go/"
rm -rf "/usr/local/go/"
These two command remove go and hidden .go files. Now we also have to update entries in shell profile.
Open your basic file. Mostly I open like this sudo gedit ~/.bashrc and remove all go mentions.
You can also do by sed command in ubuntu
sed -i '/# GoLang/d' .bashrc
sed -i '/export GOROOT/d' .bashrc
sed -i '/:$GOROOT/d' .bashrc
sed -i '/export GOPATH/d' .bashrc
sed -i '/:$GOPATH/d' .bashrc
It will remove Golang from everywhere. Also run this after running these command
source ~/.bash_profile
Tested on linux 18.04 also. That's All.
only tab
rm -rvf /usr/local/go/
not works well, but
sudo rm -rvf /usr/local/go/
do.
Go to the directory
cd /usr/local
Remove it with super user privileges
sudo rm -rf go

SmartGit Installation and Usage on Ubuntu

I have downloaded latest SmartGit installation and each time I want to use it I need to run script smartgit.sh from SmartGit bin directory, this process requires the same repository setup every time.
What it correct way of installing SmartGit on Ubuntu? Thus I can have normal icon and run the program from state of previous usage, without configuring repositories every time.
Thanks.
You can add a PPA that provides a relatively current version of SmartGit(as well as SmartGitHg, the predecessor of SmartGit).
To add the PPA run:
sudo add-apt-repository ppa:eugenesan/ppa
sudo apt-get update
To install smartgit (after adding the PPA) run:
sudo apt-get install smartgit
To install smartgithg (after adding the PPA) run:
sudo apt-get install smartgithg
This should add a menu option for you
For more information, see Eugene San PPA.
This repository contains collection of customized, updated, ported and backported packages for two last LTS releases and latest pre-LTS release
What it correct way of installing SmartGit on Ubuntu? Thus I can have
normal icon
In smartgit/bin folder, there's a shell script waiting for you: add-menuitem.sh. It does just that.
Now on the Smartgit webpage (I don't know since when) there is the possibility to download directly the .deb package. Once installed, it will upgrade automagically itself when a new version is released.
Seems a bit too late, but there is a PPA repository with SmartGit, enjoy! =)

How to run mvim (MacVim) from Terminal?

I have MacVim installed and I am trying to set it up as the editor for Git (version control), but I can't run 'mvim' from the command line as it isn't recognised. How do I setup mvim so I can run it from Terminal?
I don't think I'd to add anything to the path, did
brew install macvim
mvim -v
should then open macvim in the terminal, you can also go ahead and alias that
alias vim='mvim -v'
There should be a script named mvim in the root of the .bz2 file. Copy this somewhere into your $PATH ( /usr/local/bin would be good ) and you should be sorted.
If you go the brew route, the best way to install would be:
brew install macvim --with-override-system-vim
That will provide mvim, vim, vi, view, etc. in /usr/local/bin (all symlinked to the copy in the Cellar). This also removes the need to create any aliases and also changes your vi, vim, etc. to all use the same Vim distribution as your MacVim.
In addition, if you want to use MacVim (or GVim) as $VISUAL or $EDITOR, you should be aware that by default MacVim will fork a new process from the parent, resulting in the MacVim return value not reaching the parent process. This may confuse other applications, but Git seems to check the status of a temporary commit message file, which bypasses this limitation. In general, it is a good practice to export VISUAL='mvim -f' to ensure MacVim will not fork a new process when called, which should give you what you want when using it with your shell environment.
If you already have macVim installed: /Applications/MacVim.app/Contents/MacOS/Vim -g will give you macVim GUI.
just add an alias.
i use gvim because that is what i use on linux for gnome-vim.
alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g'
Assume MacVim is installed in the Application folder.
Instead of adding MacVim path to your environment, create a link by typing this in terminal:
sudo ln -s /Applications/MacVim.app/Contents/bin/mvim /usr/local/bin/mvim
Then, open a new terminal window/tab and type mvim.
If you have homeBrew installed, this is all you have to do:
brew install macvim
brew linkapps
Then type mvim in your terminal to run MacVim.
Here's what I did:
After building Macvim I copied mvim to one of my $PATH destinations (In this case I chose /usr/local/bin)
cp -v [MacVim_source_folder]/src/MacVim/mvim /usr/local/bin
Then when you invoke mvim it is now recognised but there is an annoying thing. It opens the visual MacVim window, not the one in terminal. To do that, you have to invoke
mvim -v
To make sure every time you call mvim you don't have to remember to add the '-v' you can create an alias:
alias mvim='mvim -v'
However, this alias will only persist for this session of the Terminal. To have this alias executed every time you open a Terminal window, you have to include it in your .profile
The .profile should be in your home directory. If it's not, create it.
cd ~
mvim -v .profile
include the alias command in there and save it.
That's it.
I'm adding Bard Park's comment here for that was the real answer for me:
Since mvim is simply a shell script, you can download it directly from the MacVim source at GitHub here: http://raw.github.com/b4winckler/macvim/master/src/MacVim/mvim
I'd seriously recommend installing MacVim via MacPorts (sudo port install MacVim).
When installed, MacPorts automatically updates your profile to include /opt/local/bin in your path, and so when mvim is installed as /opt/local/bin/mvim during the install of MacVim you'll find it ready to use straight away.
When you install the MacVim port the MacVim.app bundle is installed in /Applications/MacPorts for you too.
A good thing about going the MacPorts route is that you'll also be able to install git too (sudo port install git-core) and many many other ports. Highly recommended.
This works for me:
λ brew link --overwrite macvim
Linking /usr/local/Cellar/macvim/8.0-146_1... 12 symlinks created
For Mac .app bundles, you should install them via cask, if available, as using symlinks can cause issues. You may even get the following warning if you brew linkapps:
Unfortunately brew linkapps cannot behave nicely with e.g. Spotlight using
either aliases or symlinks and Homebrew formulae do not build "proper" .app
bundles that can be relocated. Instead, please consider using brew cask and
migrate formulae using .apps to casks.
For MacVim, you can install with:
brew cask install macvim
You should then be able to launch MacVim like you do any other macOS app, including mvim or open -a MacVim from a terminal session.
UPDATE: A bit of clarification about brew and brew cask. In a nutshell, brew handles software at the unix level, whereas brew cask extends the functionality of brew into the macOS domain for additional functionality such as handling the location of macOS app bundles. Remember that brew is also implemented on Linux so it makes sense to have this division. There are other resources that explain the difference in more detail, such as What is the difference between brew and brew cask?
so I won't say much more here.

Resources