apt-get Behind a proxy server that requires authentication

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>";

Install Oracle JDK 10.0.1 on Linux

[Updated for jdk-10.0.1]
This is for 64-bit installation.

  1. Download JDK from Oracle site
    http://www.oracle.com/technetwork/java/javase/downloads
    The installation file I use is jdk-10.0.1_linux-x64_bin.tar.gz.
  2. Change directory to install the JDK code in /opt
    cd /opt
  3. extract the JDK files
    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

  4. Update environment variables to point to the newly installed JDK by editing the /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" 
  5. Refresh the environment variable.
    source /etc/environment
  6. Verify that the updated environment variables are in place and the path to the JDK is valid
    $ 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
    
  7. Update Java alternative list. You want to set a higher priority for the new JDK. On my system this is the result when I query the alternatives:
    $ 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)
  8. Likewise, set the new Java compiler as default with

    $ 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)
  9. If you wish, you can remove the link to the older java alternative
    $ 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
    
  10. In the similar way, remove the old javac alternative link.
    $ 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
    

Changing Display Font in elementary OS’s pantheon Terminal

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

Changing Display font in XTerm and UXTerm

Edit .Xresources to set the desire True Type font for UXTerm and XTerm.

XTerm*renderFont: true
XTerm*faceName: DejaVu Sans Mono
XTerm*faceSize: 10

UXTerm*renderFont: true
UXTerm*faceName: DejaVu Sans Mono
UXTerm*faceSize: 10

Use xrdb to merge your setting into the X server resource database.

xrdb -merge ~/.Xresources

Use xrdb -q to query the resulting resource setting:

$ xrdb -q
*customization: -color
UXTerm*faceName:        DejaVu Sans Mono
UXTerm*faceSize:        10
UXTerm*renderFont:      true
XTerm*faceName: DejaVu Sans Mono
XTerm*faceSize: 10
XTerm*renderFont:       true
Xcursor.size:   18
Xcursor.theme:  DMZ-White
Xcursor.theme_core:     true

You can find the correct font name with the following command:

fc-list | cut -f2 -d: | sort -u

Set Up Proxy Environment Variables

Add the following one-liner at the end of .bashrc script:

export {http,https,ftp}_proxy='http://<user>:<password>@<proxy-server>:<port>'

For example: export {http,https,ftp}_proxy='http://10.0.2.2:3128'

For this to take effect, restart terminal or run source with . ~/.bashrc

After that, check for the presence of the environmental variables with printenv | grep proxy

yields the following output:

http_proxy=http://10.0.2.2:3128
ftp_proxy=http://10.0.2.2:3128
https_proxy=http://10.0.2.2:3128