Ubuntu Install Only Certain Updates

Problem

Needed a way to choose which updates to install.

Solution

apt-get update — To check what’s new

apt-get upgrade — To update installed packages without kernel modules

apt-get dist-upgrade — To install all updates for installed packages with kernel modules

apt-get -s dist-upgrade — To simulate the above without making any changes.

apt-get install –only-upgrade [package_name] e.g

apt-get install –only-upgrade liboxideqt-qmlplugin — To only upgrade one specific package and not all (This is useful if you first run the simulate dist upgrade command above)

Resources

How can I install just security updates from the command line?

How to install updates via command line?

How to upgrade a single package using apt-get?

Duplicate Sources.list Entry Chrome

Problem

I was getting the following error when updating ubuntu 14.04 on Linux Mint 17.02:


W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_b
inary-amd64_Packages)
W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main i386 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_bi
nary-i386_Packages)
W: You may want to run apt-get update to correct these problems

Solution

First I had to remove the duplicate Google Source Entry by going to Software Sources -> Additional repositories:

Linux Mint 17.2 Source Sources
Linux Mint 17.2 Source Sources

Then From there check that the 2 Google Repositories have the same repo:

Check Google Additional and Google Chrome List repositories
Check Google Additional and Google Chrome List repositories

After confirming the above, I unchecked the Google additional repositories entry and clicked on Update Cache:

Uncheck Extra Google Repo and Click on Update the cache
Uncheck Extra Google Repo and Click on Update the cache

I got another error after clicking update the cache:


Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)
Some index files failed to download. They have been ignored, or old ones used instead.

From this post 32-bit builds of Google Chrome have been discontinued. Therefore quick fix was to switch to the 64bit Only Repo by adding  [arch=amd64]. This can be done quickly by:

theone# sudo sed -i -e ‘s/deb http/deb [arch=amd64] http/’ “/etc/apt/sources.list.d/google-chrome.list”
theone # sudo sed -i -e ‘s/deb http/deb [arch=amd64] http/’ “/opt/google/chrome/cron/google-chrome”
theone # cat /etc/apt/sources.list.d/google-chrome.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

After this running apt-get update should not throw any errors:

References

How To Fix Failed To Fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release on Ubuntu 14.04

Solved W: Duplicate sources.list entry Ubuntu 13.04 12.10 12.04

How to fix Duplicate sources.list entry?

 

 

Creating Multiple webapps on Tomcat

Problem

Needed to ran 2 applications deployed using war(s) on Tomcat but use different application directories as well as URLs.

Solution

Stop Tomcat

copy the war into the WEBAPPS directory. Ensure that the war has a different name from the other war e.g application2.war

Start Tomcat

Tomcat will deploy the war and create a directory called application2 in the WEBAPPS directory.

Stop tomcat

Go to the WEBAPPS directory and open the application2/WEB-INF/server directory and:

  • Add the application2 directory in the context param under (<!– These init parameter(s) are read in by org.xxxx.web.Listener –>)
# pwd
/var/lib/tomcat7/webapps
# vim application2/WEB-INF/web.xml

<context-param>
<param-name>application.data.directory</param-name>
<param-value>/usr/share/tomcat7/.application2/</param-value>
</context-param>
<!-- // End init parameters -->
  • Add the webAppRootKey context param after (<!– // End init parameters –>)
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>openmrs-marira</param-value>
</context-param>
  • Now you can restart Tomcat and you should be apply to access application one under URL http://localhost:8080/application1 and application2 under URL http://localhost:8080/application2