Sunday, February 21, 2016

ppa - Ubuntu 16.10 failing to update




I am trying to update my ubuntu with the fillowing command



sudo apt-get update


But everytime it fails and gives following error -



W: The repository 'http://ppa.launchpad.net/fossfreedom/byzanz/ubuntu yakkety Release' does not have a Release file.

N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/fossfreedom/byzanz/ubuntu/dists/yakkety/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.


So far i tried every solution given on this website but none of them worked.
The prolem started when i tried to install Byzanz software to record my screen by following the steps given in this link - How can I record my screen?



Please tell me how to fix this problem.




This probably happens due do a connection problem or something else gone wrong (i.e. this repository does not have a release file because there might be no version for 16.10 build maybe). However you can remove this repository by:



sudo apt-add-repository --remove ppa:fossfreedom/byzanz


This will turn the update process back to normal and remove the entry from your sources.list file.


How to make the command line history apply across all terminals



I always have at least 3 terminator (a terminal program) windows open, but sometimes open another terminal to just do something quickly. How can I make it so the command history is common throughout all of them?



Thanks to the link provided by gertvdijk above I am posting my favorite solution from it.



Here is my attempt at Bash session history sharing. This will enable history sharing between bash sessions in a way that the history counter does not get mixed up and history expansion like !number will work with some constraints.




Using Bash version 4.1.5 under Ubuntu 10.04 LTS (Lucid Lynx).



HISTSIZE=9000
HISTFILESIZE=$HISTSIZE
HISTCONTROL=ignorespace:ignoredups

history() {
_bash_history_sync
builtin history "$@"

}

_bash_history_sync() {
builtin history -a #1
HISTFILESIZE=$HISTSIZE #2
builtin history -c #3
builtin history -r #4
}

PROMPT_COMMAND=_bash_history_sync



Explanation:
The function history() overrides the builtin history to make sure that the history is synchronised before it is displayed. This is necessary for the history expansion by number (more about this later).



Append the just entered line to the $HISTFILE (default is .bash_history). This will cause $HISTFILE to grow by one line.



Setting the special variable $HISTFILESIZE to some value will cause Bash to truncate $HISTFILE to be no longer than $HISTFILESIZE lines by removing the oldest entries.



Clear the history of the running session. This will reduce the history counter by the amount of $HISTSIZE.




Read the contents of $HISTFILE and insert them in to the current running session history. this will raise the history counter by the amount of lines in $HISTFILE. Note that the line count of $HISTFILE is not necessarily $HISTFILESIZE.



More explanation:
Step 1 ensures that the command from the current running session gets written to the global history file.



Step 4 ensures that the commands from the other sessions gets read in to the current session history.



Because step 4 will raise the history counter, we need to reduce the counter in some way. This is done in step 3.




In step 3 the history counter is reduced by $HISTSIZE. In step 4 the history counter is raised by the number of lines in $HISTFILE. In step 2 we make sure that the line count of $HISTFILE is exactly $HISTSIZE (this means that $HISTFILESIZE must be the same as $HISTSIZE).



About the constraints of the history expansion:
Generally, once you have more than one Bash session, there is no guarantee whatsoever that a history expansion by number will retain its value between two Bash prompt displays. Everytime PROMPT_COMMAND is executed some command from another Bash session may snuck in your current session history and then the history numbers will be different. That means you always have to look up the number immediately before using it. I find this constraint reasonable. I have to look the number up every time anyway because I can't remember arbitrary history numbers.



Usually I use the history expansion by number like this



$ history | grep something #note number
$ !number



I recommend using the following Bash options.



## reedit a history substitution line if it failed
shopt -s histreedit
## edit a recalled history line before executing
shopt -s histverify


Strange bugs:

Running the history command piped to anything will result that command to be listed in the history twice. For example:



$ history | head
$ history | tail
$ history | grep foo
$ history | true
$ history | false


All will be listed in the history twice. I have no idea why.




Ideas for improvements:
Modify the function _bash_history_sync() so it does not execute every time. For example it should not execute after a CTRL+C on the prompt. I often use CTRL+C to discard a long command line when I decide that I do not want to execute that line. Sometimes I have to use CTRL+C to stop a Bash completion script.



Commands from the current session should always be the most recent in the history of the current session. This will also have the side effect that a given history number keeps its value for history entries from this session.


How to search for strings in mupdf?



I am using mupdf in my ubuntu 14.04 system. I like this pdf reader because its fast, light weight and doesn't clog my memory and CPU. But it becomes some times hard to use because of the lack of some function for example a search bar. After searching I found that in mupdf we can search strings using n/N function.



But when I type string "prime" and then press n it shows only this (also because of the presence of i in prime my background color is inverted)




Warning: String '' not found





so how should I search strings in mupdf?



You can use this :



/      Search for text. 
n, N Find the next/previous search result.



More useful information here:
Is there a comprehensive list of mupdf keyboard shortcuts?


xorg - External monitor stuck at 1024x768 resolution

I'm running Kubuntu 14.04 on a older Toshiba Satellite with the following graphics hardware:


 > lspci -vnn | grep -i VGA -A 12
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [8086:27a2] (rev 03) (prog-if 00 [VGA controller])
Subsystem: Toshiba America Info Systems Device [1179:ff10]
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at dc100000 (32-bit, non-prefetchable) [size=512K]
I/O ports at 1800 [size=8]
Memory at c0000000 (32-bit, prefetchable) [size=256M]
Memory at dc200000 (32-bit, non-prefetchable) [size=256K]
Expansion ROM at [disabled]
Capabilities:
Kernel driver in use: i915
00:02.1 Display controller [0380]: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller [8086:27a6] (rev 03)
Subsystem: Toshiba America Info Systems Device [1179:ff10]

On the laptop screen, the resolution is 1280x800. I've hooked up an external widescreen monitor that I know for a fact supports high resolution (well, at least 1440x900). However, when I hook it up to this Toshiba laptop, the maximum I am allowed to set it at is 1024x768.


I have the proper Intel video driver installed and I know the monitor supports more - why can't I set a higher resolution and how do I fix it? I'm not sure if I should mess around with xorg.conf as I hear that might break stuff if I set it up incorrectly.


EDIT


> xrandr -q
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
LVDS1 connected (normal left inverted right x axis y axis)
1280x800 60.0 +
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.0*
800x600 60.3 56.2
848x480 60.0
640x480 59.9
TV1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

The monitor is this: http://www.newegg.com/Product/Product.aspx?Item=N82E16824116066


When I try to manually generate an xorg.conf file, it appears mostly generic. Here are the "monitor" sections.


Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection

apt - Some index files failed to download / public key not available


When I try to use


sudo apt-get update

it gives this error:


Fetched 5.530 kB in 53s (104 kB/s)
W: GPG error: http://extras.ubuntu.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
W: 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)
E: Some index files failed to download. They have been ignored, or old ones used instead.

When I try to access to etc/apt folder, it said no such file or directory.


How can I fix this?



Based on the error message, you have two problems; one related to the public key for a repository and the other related to Google Chrome.


To solve the public key problem, run this command:


sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 

Replacing with the public key mentioned in the error message which is: 16126D3A3E5C1192.


The second problem is related to end of support for Chrome 32-bit. If you have a 32-bit system, you have no option other than migrating to Chromium. If you have a 64-bit system, run this command to force your system to look for only 64-bit updates of Google Chrome:


sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list" "/opt/google/chrome/cron/google-chrome"

Blank Screen after trying to install nvidia proprietary drivers

I tried to install the nvidia-331 drivers but as usual it doesn't want to work... I get a blank screen when I boot up.



I tried the instructions here Blank screen after installing nvidia restricted driver but that didn't help




I was actually able to load the driver with jockey-text and startx worked, but obviously no unity or any windowing... I started it from recovery mode.



Hopefully someone can help before I have to reinstall the OS again.. sigh

14.04 - How to add a PPA

I wish to add the 14.04 GQRX PPA, how can this be achieved?


https://launchpad.net/~gqrx/+archive/ubuntu/releases

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...