How to Upgrade a Specific Package and Nothing Else in Debian:

How to Upgrade a Specific Package and Nothing Else in Debian:

# apt-get install --only-upgrade <packagename>

ex:

# apt-get install --only-upgrade htop

- This command will only upgrade the already installed htop package in your debian system, and not upgrade anything else

Install Asian CJK Langauge Font Character Support in Debian (in this case Japanese, Chinese, Korean)

Install Asian CJK Langauge Font Character Support in OpenSUSE (in this case Japanese, Chinese, Korean):


Issue command at terminal:

# apt-get install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core xfonts-intl-asian fonts-noto-cjk



 NOTES:

- List fonts with this command:


$ fc-list

- Rebuilds cached list of fonts (after installing fonts and it doesnt work, run this command):


$ fc-cache -fv

-  So a better way to install it all and rebuild the cache list of fonts after in one command:


# apt-get install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core xfonts-intl-asian fonts-noto-cjk && fc-cache -fv

How to Fix Common Broken Dependencies Problem with APT in Debian Linux

How to Fix Common Broken Dependencies Problem with APT in Debian Linux:
Example with Google Chrome

*Fixing Dependencies with apt-get -f install After installing a .deb Binary with dpkg

*After downloading Google Chrome Debian from Google, then installe it with dpkg

# dpkg -i google-chrome-*.deb

Selecting previously unselected package google-chrome-stable.
(Reading database ... 118596 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (52.0.2743.82-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
 google-chrome-stable depends on fonts-liberation; however:
  Package fonts-liberation is not installed.
 google-chrome-stable depends on libappindicator1; however:
  Package libappindicator1 is not installed.

dpkg: error processing package google-chrome-stable (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-6) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.59) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for menu (2.1.47) ...
Errors were encountered while processing:
 google-chrome-stable

*Google Chrome was installed but it had some errors with some missing dependencies, doing 
# apt-get -f install 
, fixes this

Reading package lists... Done
Building dependency tree      
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  fonts-liberation libappindicator1 libdbusmenu-gtk4 libindicator7
The following NEW packages will be installed:
  fonts-liberation libappindicator1 libdbusmenu-gtk4 libindicator7
0 upgraded, 4 newly installed, 0 to remove and 757 not upgraded.
1 not fully installed or removed.
Need to get 1,031 kB of archives.
After this operation, 2,566 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ftp.debian.org/debian unstable/main amd64 fonts-liberation all 1.07.4-1 [835 kB]
Get:2 http://ftp.debian.org/debian unstable/main amd64 libdbusmenu-gtk4 amd64 12.10.2-1 [90.8 kB]
Get:3 http://ftp.debian.org/debian unstable/main amd64 libindicator7 amd64 0.5.0-3 [52.6 kB]                                                                                                
Get:4 http://ftp.debian.org/debian unstable/main amd64 libappindicator1 amd64 0.4.92-4 [52.5 kB]                                                                                            
Fetched 1,031 kB in 7s (130 kB/s)                                                                                                                                                           
Selecting previously unselected package fonts-liberation.
(Reading database ... 118702 files and directories currently installed.)
Preparing to unpack .../fonts-liberation_1.07.4-1_all.deb ...
Unpacking fonts-liberation (1.07.4-1) ...
Selecting previously unselected package libdbusmenu-gtk4:amd64.
Preparing to unpack .../libdbusmenu-gtk4_12.10.2-1_amd64.deb ...
Unpacking libdbusmenu-gtk4:amd64 (12.10.2-1) ...
Selecting previously unselected package libindicator7:amd64.
Preparing to unpack .../libindicator7_0.5.0-3_amd64.deb ...
Unpacking libindicator7:amd64 (0.5.0-3) ...
Selecting previously unselected package libappindicator1:amd64.
Preparing to unpack .../libappindicator1_0.4.92-4_amd64.deb ...
Unpacking libappindicator1:amd64 (0.4.92-4) ...
Setting up libindicator7:amd64 (0.5.0-3) ...
Setting up fonts-liberation (1.07.4-1) ...
Setting up libdbusmenu-gtk4:amd64 (12.10.2-1) ...
Processing triggers for libc-bin (2.21-7) ...
Processing triggers for fontconfig (2.11.0-6.3) ...
Setting up libappindicator1:amd64 (0.4.92-4) ...
Setting up google-chrome-stable (52.0.2743.82-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
Processing triggers for libc-bin (2.21-7) ...
Processing triggers for menu (2.1.47) ...

*Google Chrome now works, broken dependency issue now fixed


Further Notes:
- The command # apt-get -f install is usually used for when troubleshooting debian based system when there are installation dependency issues or upgrade issues after

How to Install Google Chrome Web Browser in Debian

A) Install Google Chrome in Debian with apt-get:

1.) Issue command at terminal

$ wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

2.) Then edit /etc/apt/sources.list with an editor

# emacs -nw /etc/apt/sources.list

paste the following: deb http://dl.google.com/linux/chrome/deb/ stable main

save and exit.

3.) Sync with repos

# apt-get update

4.) Install google chrome:

# apt-get install google-chrome-stable


Notes:


*Actually you have a choice of different versions
        google-chrome-beta (for beta)
        google-chrome-stable (for stable)
        google-chrome-unstable (for unstable/bleeding edge

*Recent versions of apt-get will automatically attempt to verify packages on download. If an appropriate key is not found or if the package is corrupted, you will get a message like the following:
   
             WARNING: The following packages cannot be authenticated! packagename

If you see this using this method dont worry about it, just choose y to say yes, to install these packages without verification? [y/N] y and let it install


/or


B) Downloading the binary from google and installing with dpkg manually:

1.) Open a terminal window.
2.) Type in the following commands then hit Enter after each.

For 32-bit systems:
$ wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb
 # dpkg -i google-chrome-*.deb
 # apt-get install -f

For 64-bit systems:
$ wget -c wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
 # dpkg -i google-chrome-*.deb
 # apt-get install -f


Notes:
*To avoid error messages and annoying authentication errors with debian sources.list and google repo, its better to just download the binary and install with dpkg manually, even with debian sid
*When upgrading to a newer version, just download it again, and repeat the procedure, dpkg -i actually installs and upgrades the package if there is already an older version
*Reference to dpkg cheatsheet - A dpkg Cheat Sheet

Enabling Normal Non-Root Users to Use Ping in Linux

Enabling Normal Non-Root Users to Use Ping in Linux
 

- Sometimes you just want to ping a remote site or server to test something like your connection:

$ ping google.com

- but get this error:
ping: icmp open socket: Operation not permitted

- However ping works for the root user, just not non root users. To enable ping for normal users, issue command below as root or use sudo:

# chmod u+s `which ping`

(Those are backticks not single quotes)
 
/or

# chmod u+s /bin/ping

- Now it should work.

How to Install the Java (JDK) in OpenSUSE

How to Install the real Java (JDK) in OpenSUSE

(Tested Working in OpenSUSE Tumbleweed)

The problem of installing openjdk in opensuse when you think you installed openjdk but when you do a javac -version or call javac from commandline it just doesnt work

Well if you think of quickly installing openjdk 8 with zypper like this in commandline is gonna be enough:


# zypper se java-1_8_0-openjdk

Your actually just installing the JRE despite the name of the package which is likely to confuse anyone not familiar with opensuse, as it did me earlier, in defense of opensuse though, you can see why this is a problem is if you do a search with zypper and pay close attention to the packages and their corresponding summary definitions

# zypper se opendjk

Loading repository data...
Reading installed packages...

S | Name                                  | Summary                                                          | Type 
--+---------------------------------------+------------------------------------------------------------------+--------
  | java-1_7_0-openjdk                    | SUSE's implementation of the OpenJDK 7 runtime environment       | package                    <- (the Summary states its just the JRE7)
  | java-1_7_0-openjdk-accessibility      | Accessibility connector for OpenJDK 7                            | package
  | java-1_7_0-openjdk-bootstrap          | SUSE's implementation of the OpenJDK 7 runtime environment       | package
  | java-1_7_0-openjdk-bootstrap-devel    | SUSE's implementation of the OpenJDK 7 Development Environment   | package
  | java-1_7_0-openjdk-bootstrap-headless | OpenJDK 7 runtime environment without X, audio and video support | package
  | java-1_7_0-openjdk-demo               | OpenJDK 7 Demos                                                  | package
  | java-1_7_0-openjdk-devel              | SUSE's implementation of the OpenJDK 7 Development Environment   | package           <- (openJDK 7)
  | java-1_7_0-openjdk-headless           | OpenJDK 7 runtime environment without X, audio and video support | package
  | java-1_7_0-openjdk-javadoc            | OpenJDK 7 API Documentation                                      | package
  | java-1_7_0-openjdk-plugin             | Java Web Start and plugin implementation                         | package
  | java-1_7_0-openjdk-src                | OpenJDK 7 Source Bundle                                          | package
  | java-1_8_0-openjdk                    | OpenJDK 8 Runtime Environment                                    | package                                   <- (the Summary states its just the JRE8)*
  | java-1_8_0-openjdk-accessibility      | OpenJDK 8 accessibility connector                                | package
  | java-1_8_0-openjdk-demo               | OpenJDK 8 Demos                                                  | package
  | java-1_8_0-openjdk-devel              | OpenJDK 8 Development Environment                                | package                            <- (And this is the the true openJDK 8)*
  | java-1_8_0-openjdk-headless           | OpenJDK 8 Runtime Environment                                    | package
  | java-1_8_0-openjdk-javadoc            | OpenJDK 8 API Documentation                                      | package
  | java-1_8_0-openjdk-plugin             | Java Web Start and plugin implementation                         | package
  | java-1_8_0-openjdk-src                | OpenJDK 8 Source Bundle                                          | package
  | java-1_9_0-openjdk                    | OpenJDK Runtime Environment                                      | package                                   <- (the Summary states its just the JRE9)
  | java-1_9_0-openjdk-accessibility      | OpenJDK accessibility connector                                  | package
  | java-1_9_0-openjdk-demo               | OpenJDK Demos                                                    | package
  | java-1_9_0-openjdk-devel              | OpenJDK Development Environment                                  | package                            <-(openJDK 9)
  | java-1_9_0-openjdk-headless           | OpenJDK Runtime Environment                                      | package
  | java-1_9_0-openjdk-javadoc            | OpenJDK API Documentation                                        | package
  | java-1_9_0-openjdk-src                | OpenJDK Source Bundle                                            | package


So if you want to install the openjdk and develop java apps with it, you have to install the openjdk-devel package with the version you want to use, in this example its openjdk 8:

# zypper in java-1_8_0-openjdk-devel

now you can try: java -version and javac -version , and get output like this, whereas you would have gotten the cnf command not found if you tried javac -version if you installed just java-1_8_0-openjdk , as its just the JRE , anyways as with other java installs there is no need to install the JRE version as installing the openjdk-devel the true openjdk package in opensuse, already contains a JRE so you can just do the following commands

$ java -version
openjdk version "1.8.0_101"
OpenJDK Runtime Environment (IcedTea 3.1.0) (suse-1.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)

$ javac -version
javac 1.8.0_101


- Nevertheless the naming convention of the package is still confusing, especially for people new to opensuse, they should just rename the openjdk JRE to openJRE or something, so even on quick glance its self explanatory


Resource Links:


Tumbleweed Android Studio and Java JDK Thread in the OpenSUSE Forum
Trying to get Android Studio to start but I'm getting an error saying JAVA_HOME points to a jre not a jdk, a...
   
Others have complained of the confusing package naming of opensuse like in this blog: thehumble.ninja - A Quick Review of OpenSUSE Tumbleweed! (2015)
an excerpt from this blog
"My only MAJOR complaint is the package naming and development packages. It’s FRUSTRATING hunting down each package, truly a nightmare compared to other distributions."



NOTE: However if you have multiple implementations of Java, when you want to select your preferred java implementation or switch to the one you prefer.

Select which multiple implementations of JRE and JDK and even Java Web Browser Plug-in installed then you can select which one to use with the update-alternatives commands below:

Java application launcher (JRE)
# /usr/sbin/update-alternatives --config java

Java compiler (JDK)
# /usr/sbin/update-alternatives --config javac

Java Web Browser (Web browser plug-in)
# /usr/sbin/update-alternatives --config javaplugin


Easy Way to Install and Maintain Multilibs with Slackware (Updated Way)

How to Install and Maintain Multilibs in Slackware with slackpkg+ 

(Easy Updated Way, Tested working in Slackware Current, it should work for Stable as well, just make sure to track the repos for stable for stable and current for current)

- Install Multilib in Slackware Current, and Keep the Multilib Enabled Slackware - Current up-to-date with slackpkg+:

1.) Install the latest binary package from slackpkg+
2.) Edit slackpkg.conf file with your desired editor, for examples emacs and nano are used:

# emacs -nw /etc/slackpkg/slackpkgplus.conf 

you can also use vim or nano for example:

# nano /etc/slackpkg/slackpkgplus.conf

add this line to the mirrorplus list:

MIRRORPLUS['multilib']=http://bear.alienbase.nl/mirrors/people/alien/multilib/current/

3.) Then in REPOPLUS array add the entry - multilib , typically best right after slackpkgplus entry so it would look like this:

REPOPLUS=( slackpkgplus multilib restricted alienbob ktown mate )
#priority repo list: order of left priority, right less priority                           

4.) Save, then exit and run these commands in order, line after line:
# slackpkg update gpg
# slackpkg update
# slackpkg upgrade-all
# slackpkg install multilib


(Optionally: Another way is to install slackpkg+ then run this command to automatically setup everything that is to be done with the instructions above:

# /usr/doc/slackpkg+-*/setupmultilib.sh

To uninstall re-run the same command again)


To keep multilib up-to-date:
After that, you can keep multilib up-to-date by running these commands in order, line by line:
# slackpkg update
# slackpkg upgrade-all
# slackpkg install multilib


*To uninstall multilib, edit the slackpkgplus.conf file located in /etc/slackpkg/slackpkgplus.conf and remove 'multilib' from PKGS_PRIORITY and REPOPLUS arrays, but do NOT delete the related MIRRORPLUS line, then run the following commands:

# slackpkg update
# slackpkg remove multilib

Note: this does NOT remove the core multilib packages, because they affect the 64bit system. Remove these with the following commands:


# slackpkg upgrade-all

then delete or comment the related MIRRORPLUS line, then run:

# slackpkg update


NOTE: This is a very basic sample slackpkg+ config file could look like with multilib setup:

SLACKPKGPLUS=on
VERBOSE=1
ALLOW32BIT=off
USEBL=1
WGETOPTS="--timeout=20 --tries=2"
GREYLIST=on

PKGS_PRIORITY=( restricted alienbob ktown mate )
REPOPLUS=( slackpkgplus multilib restricted alienbob ktown mate ) #priority repo list: order of left priority, right less priority                           

MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/current/x86_64/
MIRRORPLUS['alienbob']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/current/x86_64/
MIRRORPLUS['multilib']=http://bear.alienbase.nl/mirrors/people/alien/multilib/current/
MIRRORPLUS['ktown']=http://bear.alienbase.nl/mirrors/alien-kde/current/latest/x86_64
MIRRORPLUS['mate']=http://slackware.uk/msb/current/1.15/x86_64/


NOTE: Using this method with slackpkg+ to Install and Keep Multilib up-to-date in Slackware Current, this is definitely easier than the old way, and you can do the initial setup manually or with /usr/doc/slackpkg+-*/setupmultilib.sh script in slackpkg+


Tips and a Fix for Troubleshooting Common Problems with slackpkg/slackpkg+:

- When errors happen first check the slackpkg+ config file, and the mirror list at /etc/slackpkg/mirrors and /etc/slackpkg/slackpkgplus.conf , make sure there are no typos or using of capital letters in the urls and make sure its all setup as mentioned above.
- Before installing and upgrading with slackpkg/slackpkg+, issue these commands first: 

# slackpkg update gpg
then
# slackpkg update
- Sometimes the urls in the mirrors are not up-to-date in this case you have to check and find the right urls that work
- To avoid problems use urls that are the same version as the system you use, so use urls with current when using current, or 14.2 with 14.2
- If you run into an error that says you have duplicate packages that are conflicting in /var/log/packages, what you have to do is check that directory of any packages that have either a duplicate of the same package or
essentially 1 package with double or multiple versions like foo_ver1.1 and foo_ver1.2 , all you have to do is remove the problematic package in this case  the older one, and it should work.

example issue duplicate slackpkg version conflict:

- When running slackpkg upgrade-all as below you come into contact with such an error:

# slackpkg upgrade-all

NOTE: Remember to re-run 'slackpkg update' after modifying slackpkgplus.conf

Checking local integrity... DONE
You have a broken /var/log/packages - with two versions of the same package.
The list of packages duplicated in your machine are shown below, but don't
worry about this list - when you select your action, slackpkg will show a
better list:

slackpkg-2.82.1-noarch-1

You can (B)lacklist, (R)emove, or (I)gnore these packages.
Select your action (B/R/I): 


- Issuing the command removepkg on slackpkg will not fix this issue, even if you reinstall slackpkg, instead issue this command: 
# ls /var/log/packages | grep slackpkg
- Fortunately the error gave the hint of the program that is causing the problem, so you get a list that looks something like this for example where you see the duplicate issue

slackpkg+-1.7.0-noarch-4mt
slackpkg-2.81.1-noarch-1
slackpkg-2.82.1-noarch-1

- So you just uninstall the older or problematic version with this command: 
# removepkg /var/log/packages/slackpkg-2.81.1-noarch-1
- Now things should be back to normal, run the # slackpkg upgrade command now and it should work

NOTE: Before installing STEAM and VirtualBox, Wine and PlayonLinux on Slackware make sure to setup and install multilib in slackware first

Reference Links:
- "http://slakfinder.org/slackpkg+.html"
- "http://alien.slackbook.org/blog/introducing-slackpkg-an-extension-to-slackpkg-for-3rd-party-repositories/"
- "http://docs.slackware.com/howtos:slackware_admin:systemupgrade"
- "http://docs.slackware.com/slackware:multilib"
- "http://slakfinder.org/slackpkg+/src/README"
- "https://www.youtube.com/watch?v=AtLM3sjLT7U" *Linux4UnMe Channel basically mentions he used slackpkg+ to install multilibs in his slackware linux system, but doesnt explain how he did it, anyways i have tried to explain how to do this in detail above