Saturday, December 2, 2017

How to trace the origin of how updates make it into my Ubuntu machine?


How do I find the full "community history" of how the updates listed by "software updater" made it into my Ubuntu machine?


The question is for the general workflow to obtain the "community history" of updates, not the "community history" of all updates available.


What I am after is for example



  • Patch(es) related to the update on mailing list(s)

  • Community discussions about the update

  • Source code related to the update

  • Git commits related to the update

  • People responsible for the update

  • How does software updater know which repositories to fetch updates from?

  • If software updater finds updates for a specific package in different repositories, but one is older and the other is newer, how does it select?

  • etc


Background:
It seems about once or a couple of times each week the "Software updater" displays:



Updated software is available for this computer. Do you want to install it now?



From what I understand, these updates are the same as SRUs - Stable Release Updates? Or are only updates from Canonical/Ubuntu called "SRUs", while non-Canonical/Ubuntu updates are not called SRUs?


Here is a screenshot of my "Software Updater", how do I for example find the "community origin" (patch(es), discussions, etc, if any) of the Chrome update (Available version: 44.0.2403.157-1) which is highlighted in the screenshot? Then when this update is installed, where do I find info about it on my machine?


Software Updater


How do I list all the updates installed on my machine and how do I list all the available updates that are not yet installed?


The suggested duplicate of "Show apt-get installed packages history via commandline?" asks about listing packages installed, my question is about updates and how to trace the origin of the updates and how they make into my Ubuntu machine.



First off, an important clarification:


The terms "Stable Release Updates" and "Security Updates" (don't forget them!) apply to packages in main, universe, restricted and multiverse. PPAs or other third-party repositories may have their own release schedules and policies. In your screenshot I see "google-chrome-stable" -- this is not a Ubuntu package and it does not follow the Ubuntu release schedule.


Having said that, here's what you asked for:



  • For every Ubuntu update, the point of reference is the Launchpad bug. This is where you can find most of the information related to the problem(s) and solution(s).


    You can get the bug numbers by checking the changelog of each package. For example, as of writing, this is the last entry from apt-get changelog nautilus:


    nautilus (1:3.14.2-0ubuntu9.1) vivid; urgency=low
    * debian/patches/ignore-no-desktop-if-not-first-launch.patch:
    - Don't shut off the desktop when external application calls nautilus
    --no-desktop on a running GNOME desktop. (LP: #1453655)
    -- Chow Loong Jin Wed, 24 Jun 2015 11:50:03 +0800

    As you can see, the log entry refers to bug #1453655.


    For security bugs, generally the bug report is private (to prevent malicious people from accessing critical information) and, generally, instead of the Launchpad bug number you'll find the CVE number.


  • Patches applied by Ubuntu (or by Debian) are in the source package, in the debian/patches directory. If you want to download the source packages for Nautilus, use apt-get source nautilus.


    If a Stable Release Update or a Security Update introduces a new version of the software (e.g. a new version of Firefox), you'll have to look upstream for the full delta.


    Not all package sources are available under version control (git, hg, bzr, ...).


  • Discussion generally happen on Launchpad. If necessary, the ubuntu-devel mailing list may be used too.


  • People responsible for updates are the people who provide the updates (package maintainers or contributors), the Ubuntu SRU Team and the Ubuntu Security Team.


    Note that not all of these people are Canonical employees. Be kind and don't forget those contributors who use their spare time to maintain stability and security in Ubuntu :-)


  • The process for Stable Release Updates and Security Updates is documented on the Ubuntu Wiki: https://wiki.ubuntu.com/StableReleaseUpdates and https://wiki.ubuntu.com/SecurityTeam/UpdateProcedures



Friday, December 1, 2017

nvidia - Ubuntu 12.10. Can't add custom resolution


System: Ubuntu 12.10, nVidia Geforce GT240 (nvidia-current privative driver), LG display connected to VGA-0


The 1920x1080 resolution is not listed, I've added it in Windows but I'm having problems doing the same Ubuntu.


Step 1) Obtain modeline


$ cvt 1920 1080

Step 2) Create custom mode


$ xrandr --newmode "1080p"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

Step 3) Add custom mode


$ xrandr --addmode VGA-0 "1080p"

And then I get this error:


X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 18 (RRAddOutputMode)
Serial number of failed request: 29
Current serial number in output stream: 30

The xrandr output is


Screen 0: minimum 8 x 8, current 1152 x 864, maximum 8192 x 8192
VGA-0 connected 1152x864+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.0 +
1360x768 60.0 59.8
1152x864 60.0*
800x600 72.2 60.3 56.2
680x384 119.9 119.6
640x480 59.9
512x384 120.0
400x300 144.4
320x240 120.1
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
1080p (0x2f7) 172.8MHz
h: width 1920 start 2040 end 2248 total 2576 skew 0 clock 67.1KHz
v: height 1080 start 1081 end 1084 total 1118 clock 60.0Hz

Am I doing something wrong?



Ok, this worked for me.


1) Edit /etc/X11/xorg.conf


2) In the section "Monitor", change HorizSync and VertRefresh to the correct values (consult your monitor specifications in the user manual). This is important or you will likely get an "signal out of range/sync" error in your monitor (if you make this mistake press ctr+alt+f1 and edit xorg.conf from console).


Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "CRT-0"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 75.0
Option "DPMS"
EndSection

3) In the section "Screen" add this line.


Option "ModeValidation" "AllowNonEdidModes, NoVirtualSizeCheck, NoMaxPClkCheck, NoWidthAlignmentCheck, NoExtendedGpuCapabilitiesCheck"

4) Restart the system.


5) xrandr --addmode still won't work but you will have more resolutions available. Check out my new xrandr output:


Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 8192 x 8192
VGA-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 75.0 + 70.1 60.0
1920x1200 60.0
1920x1080 60.0* 59.9
1792x1344 60.0
1680x1050 74.9 69.9 60.0 59.9
1600x1200 65.0 60.0
1440x900 59.9
1400x1050 74.8 70.0 60.0
1360x768 60.0 59.8
1280x1024 75.0 60.0
1280x960 60.0
1152x864 75.0 75.0 70.0 60.0
960x600 120.0
960x540 120.0
840x525 149.9 139.8 120.0 119.8
832x624 74.6
800x600 75.0 72.2 60.3 56.2
720x450 119.8
700x525 149.5 120.0
680x384 119.9 119.6
640x480 75.0 72.8 59.9
512x384 140.1 120.0
400x300 144.4
320x240 145.6 120.1
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)

bash - How to copy clone folder to remote computer in one line?



I have two machines with the same folder structure. One is my personal computer, the other is a remote computer. Sometimes I want a program to run on the remote computer.

At the moment I always need to




  1. ssh to the remote computer

  2. Type my password

  3. copy the folder manually using rsync



Even if I would write a script for rsync (like the one shown below) I would still need to enter my password every time or hard code it inside the bash script (which would be stupid).




#!/bin/bash/
pathToSync="/path/to/my/Folder/"
rsync -r -l -p --progress "$pathToSync"/ myUsername@nameOfRemoteComputer:"$pathToSync"


Has someone an idea of how to solve this problem more efficiently?
Such that in the end I only need to write



sync myFolder nameOfRemoteComputer



The question has been answered.
As Addition to the correct answer given below. Here are the the bash commands to make ssh and rsync work without having to enter passwords. On the client computer type:



mkdir ~/.ssh # Maybe this folder already exists
chmod 700 ~/.ssh
cd ~/.ssh
ssh-keygen -t rsa # This creates a public key
cp authorized_keys authorized_keys_Backup # This backups old / existing keys
cat id_rsa.pub >>~/.ssh/authorized_keys
ssh-copy-id nameOfRemoteComputer




Done! (-> Check if ssh works without password now)
(I have the same username on client and remote computer otherwise it would be ssh-copy-id myRemoteUsername@nameOfRemoteComputer)



SCP



Since you have ssh access you can just use command scp to do your work.



In terminal enter:




scp -r /path/to/my/folder myUsername@nameOfRemoteComputer:/path/to/my/folder



If you also use the same username on both computers you can even ommit myUsername@ and just enter:



scp -r /path/to/my/folder nameOfRemoteComputer:/path/to/my/folder



The name of the remote copumter can be an IP, a domain name or a name assigned at /etc/hosts.



Avoid Entering Password for SSH Connection




You could setup an SSH Key Pair between your server and your local machine.



I would suggest you use Passwords and Keyes app. It should come pre-installed on Ubuntu.



enter image description here



New Key Pair



Press the green + and create a new Secure Shell Key. Follow the dialog boxes to create a new key pair.




Here you can find terminal commands to generate the key pair id_rsa and id_rsa.pub, you will need to get a copy of id_rsa.pub to your server to make the key pair work.



Add the contents of id_rsa.pub to the file ~/.ssh/authorized_keys at your server in a new line. You could use command: cat id_rsa.pub >>~/.ssh/authorized_keys after login in through ssh.



If you set a passphrase to the private key you will have to enter the passphrase to ulock it. Assign no passphrase for ease of use.


firewall - Firewalld does not start at boot



I have installed firewalld and uninstalled ufw with the following commands:



sudo apt install firewall-applet
sudo systemctl start firewalld
sudo systemctl enable firewalld



It works but does not start on its own on restart.



$ sudo systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/lib/systemd/system/firewalld.service; enabled; vendor preset
Active: inactive (dead)

May 10 18:39:03 Yyyy systemd[1]: Stopped firewalld - dynamic firewall daemon. lines 1-5/5 (END)



My laptop is running Ubuntu 16.04 LTS.



The output of sudo systemctl status iptables.service:



● iptables.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)


Iptables is installed. The output of dpkg -s iptables




Package: iptables
Status: install ok installed
Priority: important
Section: net
Installed-Size: 1624
Maintainer: Ubuntu Developers
Architecture: amd64
Version: 1.6.0-2ubuntu3
Depends: libxtables11 (= 1.6.0-2ubuntu3), libc6 (>= 2.14), libnfnetlink0

Description: administration tools for packet filtering and NAT
iptables is the userspace command line program used to configure
the Linux packet filtering ruleset. It is targeted towards system
administrators. Since Network Address Translation is also configured
from the packet filter ruleset, iptables is used for this, too. The
iptables package also includes ip6tables. ip6tables is used for
configuring the IPv6 packet filter
Homepage: http://www.netfilter.org/
Original-Maintainer: iptables devel team



I tried sudo firewalld-cmd --runtime-to-parmanent but it does not help firewalld start at boot.



Thanks



I also hit same problem as OP on my newly installed Ubuntu 16.04.4.



I've checked the service file - /lib/systemd/system/firewalld.service
It says firewalld conflict with iptables.service ip6tables.service ebtables.service ipset.service




Then I find ebtables.service is installed and enabled; After disabling and masking it by



sudo systemctl disable ebtables
sudo systemctl mask ebtables


firewalld can be started without any other script/trick after reboot, of coz it should be enabled.



So the root cause of my problem is - ebtables.service prevent firewalld.service from being started.


application development - unity components debugging

Following up on my question here, I would like to ask about best-practices for debugging additions to the unity components.


Integrating apps into unity requires many components: service files, desktop files, dbus clients, dbus servers, etc. With so many independent components involved, I have a bit trouble finding a good way to look for the problem when something is not working. But since many developers seem to be able to develop in this environment, there are probably tools / workflows that I'm missing.


As an example: quickly debug, which opens a python debugger does not help at all for lens development, unless the problem is directly in the code of the lens (which is easier found with simple unit tests). If the problem is in a service file, this does not help at all. I have had problems for example with whitespace in an application name in the .desktop file, which lead to a program not being listed in the sound menu (I think, maybe it was another menu...).


So: how are you debugging lenses, launchers, indicators, HUD methods... ?


Is there a tool to check the integrity of a .service file?


Is there a tool to check the integrity of a .desktop file?


Is there a tool to see if there are collision in .desktop/.service files? (e.g. several .service files supplying the same dbus service)


Is there a way to watch the communication between a specific lens in the dash and the supporting lens-service?


Can I test lenses without installing them?

boot - I deleted Ubuntu and accidentally deleted Grub with it. Other OS's aren't booting now. How do I fix this?

I was running a dual-booted Ubuntu/Windows 8.1 PC. I deleted my Ubuntu partition so I could install Arch, but in doing so I also accidentally messed up Grub and deleted my Windows EFI partition. I spent some time trying to restore the EFI partition, but I'm wondering if I could fix all of this by reinstalling Grub. Is reinstalling Ubuntu the easiest way to fix this? I can't reformat the drive because I have important work there that I can't lose.



I'm at school right now so I won't be able to post any logs until around 3:30 CST. Any advice would be greatly appreciated.



Edit: My problem extends beyond deleting Ubuntu. I accidentally messed up my windows filesystem and now it won't boot. It starts up and says there is no OS. I believe the best way to fix this would be to reinstall Grub but I need some confirmation of this.

kernel - Could not load 'vboxdrv' after upgrade to Ubuntu 16.04 (and I want to keep secure boot)

I upgrade from Ubuntu 15.10 to 16.04 and since then VirtualBox 5.0.18 isn't starting my VMs anymore. It complains that 'vboxdrv' isn't loaded. So I try to load it and get the following error:



$ sudo modprobe vboxdrv
modprobe: ERROR: could not insert 'vboxdrv': Required key not available


I believe it is related to secure boot which I use and which I want to continue using. Actually with Ubuntu 15.10 secure boot and VirtualBox were working just fine.



Also I tried $ sudo apt-get --reinstall install virtualbox-dkms which built the kernel module successfully but didn't solve this issue.




Any idea how to get vboxdrv loaded while keeping secure boot enabled?



Update 2: Also I tried executing sudo mokutil --disable-validation. When executing this command, during the next boot I get prompted to disable secure boot, add a key or hash from disk. Since I don't want to disable secure boot, it seems that this doesn't solve my issue either. Also I want to keep UEFI activated for a parallel Windows installation.



Note: If you don't mind disabling secure boot, see Why do I get "Required key not available" when install 3rd party kernel modules or after a kernel upgrade? instead.

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 (...