If you have trouble using npm behind a proxy server, remember to set the npm proxy and https-proxy variables.
For example:
# sudo npm config set proxy http://10.0.2.2:3128 # sudo npm config set https-proxy http://10.0.2.2:3128
Things I know I'll forget sooner or later…
If you have trouble using npm behind a proxy server, remember to set the npm proxy and https-proxy variables.
For example:
# sudo npm config set proxy http://10.0.2.2:3128 # sudo npm config set https-proxy http://10.0.2.2:3128
Node.js binaries are available at nodejs.org. You can download the more stable LTS version or Current version with the latest features.
You can either first extract the binary files to a temporary directory, then copy them to the /usr/local directory; or extract the files right into the /usr/local directory.
/usr/local folder.
# cd temp # tar -xvJf ~/downloads/node-v7.2.0-linux-x64.tar.xz # cd node-v7.2.0-linux-x64 # sudo cp -R . /usr/local
/usr/local folder. First change directory to /usr/local, and then issue the tar command.
# sudo tar --strip-components=1 -xvJf ~/downloads/node-v7.2.0-linux-x64.tar.xz
# node -v v7.2.0
# npm version
{ npm: '3.10.9',
ares: '1.10.1-DEV',
cldr: '30.0.2',
http_parser: '2.7.0',
icu: '58.1',
modules: '51',
node: '7.2.0',
openssl: '1.0.2j',
tz: '2016g',
unicode: '9.0',
uv: '1.10.1',
v8: '5.4.500.43'
zlib: '1.2.8' }
Create a new file in the /etc/apt/apt.conf.d
for example: create the file 80proxy with
sudo nano /etc/apt/apt.conf.d/80proxy
and add the following lines to configure the proxy setting:
Acquire::http::Proxy "http://<username>:<password>@<proxy IP>:<port>";
Acquire::https::Proxy "http://<username>:<password>@<proxy IP>:<port>";
Acquire::ftp::Proxy "http://<username>:<password>@<proxy IP>:<port>";
[Updated for jdk-10.0.1]
This is for 64-bit installation.
http://www.oracle.com/technetwork/java/javase/downloadsjdk-10.0.1_linux-x64_bin.tar.gz./opt
cd /opt
sudo tar -xvzf <location of downloaded JDK>/jdk-10.0.1_linux-x64_bin.tar.gz
This will put the JDK into the newly created directory named jdk-10.0.1
/etc/environment file.
sudo nano /etc/environment
Add the JAVA_HOME variable, and add JDK bin to the PATH variable.
JAVA_HOME="/opt/jdk-10.0.1" PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk-10.0.1/bin"
source /etc/environment
$ echo $JAVA_HOME /opt/jdk-10.0.1 $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk-10.0.1/bin
$ update-alternatives --verbose --query java
Name: java
Link: /usr/bin/java
Slaves:
java.1.gz /usr/share/man/man1/java.1.gz
Status: auto
Best: /usr/lib/jvm/java-9-openjdk-amd64/bin/java
Value: /usr/lib/jvm/java-9-openjdk-amd64/bin/java
Alternative: /usr/lib/jvm/java-9-openjdk-amd64/bin/java
Priority: 1091
Slaves:
java.1.gz /usr/lib/jvm/java-9-openjdk-amd64/man/man1/java.1.gz
So, let’s make the new JDK our default…
sudo update-alternatives --install /usr/bin/java java /opt/jdk-10.0.1/bin/java 10001
The response is:
update-alternatives: using /opt/jdk-10.0.1/bin/java to provide /usr/bin/java (java) in auto mode.
Now, when you type java -version, you will see
java version "1.0.1" 2018-04-17 Java(TM) SE Runtime Environment 18.3 (build 1.0.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk-10.0.1/bin/javac 10001 update-alternatives: using /opt/jdk-10.0.1/bin/java to provide /usr/bin/javac (javac) in auto mode $ javac -version java version "10.0.1" 2018-04-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
$ sudo update-alternatives --verbose --remove java /usr/lib/jvm/java-9-openjdk-amd64/bin/java update-alternatives: discarding obsolete slave link java.1.gz (/usr/share/man/man1/java.1.gz) $ update-alternatives --verbose --query java Name: java Link: /usr/bin/java Status: auto Best: /opt/jdk-10.0.1/bin/java Value: /opt/jdk-10.0.1/bin/java Alternative: /opt/jdk-10.0.1/bin/java Priority: 10001
$ update-alternatives --verbose --query javac Name: javac Link: /usr/bin/javac Slaves: javac.1.gz /usr/share/man/man1/javac.1.gz Status: auto Best: /opt/jdk-10.0.1/bin/java Value: /opt/jdk-10.0.1/bin/java Alternative: /opt/jdk-10.0.1/bin/java Priority: 10001 Slaves: Alternative: /usr/lib/jvm/java-9-openjdk-amd64/bin/javac Priority: 1091 Slaves: javac.1.gz /usr/lib/jvm/java-9-openjdk-amd64/man/man1/javac.1.gz $ sudo update-alternatives --remove javac /usr/lib/jvm/java-9-openjdk-amd64/bin/javac
Edit the font property in the org.pantheon.terminal.settings schema. For example:
gsettings set org.pantheon.terminal.settings font 'DejaVu Sans Mono'
Then close and reopen the terminal for the change to take effect.
You can find the correct font name with the following command:
fc-list | cut -f2 -d: | sort -u