Saturday, April 30, 2016

Can't login after installing libimobiledevice

I am using ubuntu 13.10 and just installed libimobiledevice from Software Centre. I rebooted after the install and now I am unable to log in. I get to the login in screen, enter my password for my user name and get stuck at that point. It will not go any further.


My problem seems very similar to this thread as they also installed libimobiledevice.


unable to type in password at login screen after restart?


I would have chimed in on that post but I am new user and not allowed to comment.


Please help!

hard drive - How can I recover my data after replacing Windows with Ubuntu?


I have migrated from Windows 7 to Ubuntu just yesterday. Windows 7 was in my C: drive. I did not realise that if I wipe Windows 7 and install Ubuntu, Ubuntu would be installed in the C: drive only. So I didn't make any backups, and I deleted Windows and installed Ubuntu. But, Ubuntu has formatted my hard drive and I have lost all my important data!


How can I recover my data now?



For recovering accidentally overwritten partitions with TestDisk Install banshee please follow these prcoedures:



  • Stop using the drive!

  • Boot Ubuntu live session ("Try Out Ubuntu") from a CD or USB-drive

  • Install Testdisk to the live session via the Software Center

  • follow this concise guide for recovery: TestDisk Step by Step


Optionally (but highly advisable) and if we had an external drive big enough to hold all of the faulty drive we can make a backup to recover data or partitions from an image. Make this image with the following command in a terminal:


sudo dd if=/dev/sdX of=/path/to/external_drive/backup.img

Replace sdX with the drive to recover. Since dd is an advanced and potentially harmful tool take extra care to not accidentally overwrite any drive you may still need.


In case you are unable to recover your partitions you may be able to recover single files by running PhotoRec wich comes with the TestDisk suite.


Just to have mentioned it: there are other "forensic" tools to help you recover lost partitions or files. See How to recover deleted files?.


grub2 - Windows 10 won't boot after Grub update

I've not been able to boot to Windows 10 after an Ubuntu Update that appeared to upgrade Grub. I was initially getting the error invalid signature when trying to boot to Windows. In the past when I had this problem I booted to the Ubuntu live CD, ran boot-repair and this fixed the Windows boot entry in Grub. Now however I've tried boot-repair a number of times trying different options. I have a /boot/EFI partition. In UEFI I re-enabled CSM and disabled secure boot. I have rEFInd installed although I can't remember installing it. I think Ubuntu and Windows 10 were installed in UEFI mode. When I select the Windows option in Grub it goes to the rEFInd boot loader where there is no option to boot to windows. The options in rEFInd are below and they both boot to Ubuntu:



EFI/ubuntu/grubx64.efi
boot/vmlinuz-4.4.0-97-generic.efi




Ubuntu and Windows are installed on the same NVME drive on separate partitions. The EFI partition is there also. Here the the result of the last boot-repair.



https://paste.ubuntu.com/25735054/



Windows is installed on /dev/nvme0n1p4 and the Ubuntu root partition is on /dev/nvme0n1p5.



Can anyone help with this?

Is there a way to restrict the packages installable from a repository?



I want to restrict the packages installable from a repo, eg restrict some packages to the main Ubuntu repos, even if they are available from launchpad or some other third party repos, something like pinning some packages to certain repository.




Normally the repository last added repo takes over all the packages which were available in other earlier repos.



To set up AptPreferences for a set of packages add a new file in /etc/apt/preferences.d/.



sudo gedit /etc/apt/preferences.d/my-packages-pin


Add add the following lines in that file:



Package: package1 package2

Pin: release o=Ubuntu
Pin-Priority: 900


I will prevent ppa versions to replace packages provided by the main Ubuntu archives



To check if the package pin version run:



sudo apt-cache policy package1



Visit https://help.ubuntu.com/community/PinningHowto


installation - Can I install Ubuntu on P4 Machine with Windows XP

Sorry for the question, but I am the new guy with ubuntu and dying to install it in my old pc. And just wanted to confirm that can I install it on my P4, 1GB ram, intel 82845 graphic controller machine or it's going to need more then this



Thanks in advance.

apt - "Unable to locate package" error in Ubuntu 18.04 on Windows 10


I activated the Bash shell on Windows 10 (with the new update on Windows 10 which offers a Linux Bash shell).


The installation was a success, but I can't install anything...
When I ran, for example


sudo apt-get install cmatrix

it returned


Unable to locate package cmatrix

Can somebody help me with this?



First of all, try running sudo apt update. If that doesn't fix it, you might have an improperly configured /etc/apt/sources.list file.


apt - How can I remove all PPA?


I noticed that


sudo apt-get update

takes longer and longer, because i used several


sudo apt-add-repository xxx

it seems like non ubuntu repositories are not as fast or dont have as much bandwith as the default ones.


How can i reset the repositories to the default ones, removing all the ones added by me? (not to worry, if ever need any of them i can add them later)



To delete and purge all PPAs:


The ppa-purge removes the PPA and tries to replace the installed packages with the version of the Officially Ubuntu Repositories



  1. Install ppa-purge


    sudo apt-get install ppa-purge

  2. List the commands to be used with the command below. This command does nothing than print the commands to be used in the next step


    find /etc/apt/sources.list.d -type f -name "*.list" -print0 | \
    while read -d $'\0' file; do awk -F/ '/deb / && /ppa\.launchpad\.net/ {print "sudo ppa-purge ppa:"$4"/"$5}' "$file"; done

  3. Check the previous output and if all is ok, fire the purge-commands by the command below


    find /etc/apt/sources.list.d -type f -name "*.list" -print0 | \
    while read -d $'\0' file; do awk -F/ '/deb / && /ppa\.launchpad\.net/ {system("sudo ppa-purge ppa:"$4"/"$5)}' "$file"; done




Sample output


% find /etc/apt/sources.list.d -type f -name "*.list" -print0 | while read -d $'\0' file; do awk -F/ '/deb / && /launchpad/ {print "sudo ppa-purge ppa:"$4"/"$5}' "$file"; done
sudo ppa-purge ppa:yannubuntu/boot-repair
sudo ppa-purge ppa:bugs-launchpad-net-falkensweb/cool-retro-term
sudo ppa-purge ppa:andreas-boettger/gmusicbrowser-art
sudo ppa-purge ppa:yorba/ppa
sudo ppa-purge ppa:libreoffice/libreoffice-prereleases
sudo ppa-purge ppa:ricotz/testing
sudo ppa-purge ppa:nilarimogard/webupd8
sudo ppa-purge ppa:andreas-boettger/private
sudo ppa-purge ppa:snappy-dev/beta
sudo ppa-purge ppa:diesch/testing
sudo ppa-purge ppa:webupd8team/tor-browser
sudo ppa-purge ppa:musicbrainz-developers/stable
sudo ppa-purge ppa:latexila/ppa
sudo ppa-purge ppa:gencfsm/ppa
sudo ppa-purge ppa:webupd8team/java
sudo ppa-purge ppa:minecraft-installer-peeps/minecraft-installer
sudo ppa-purge ppa:gnome3-team/gnome3-staging
sudo ppa-purge ppa:git-core/ppa
sudo ppa-purge ppa:stackapplet-dev/stackapplet
sudo ppa-purge ppa:linuxgndu/sqlitebrowser
sudo ppa-purge ppa:webupd8team/atom
sudo ppa-purge ppa:webupd8team/unstable
sudo ppa-purge ppa:gnome3-team/gnome3
sudo ppa-purge ppa:webupd8team/y-ppa-manager
sudo ppa-purge ppa:team-xbmc/ppa
sudo ppa-purge ppa:peterlevi/ppa
sudo ppa-purge ppa:stebbins/handbrake-snapshots
sudo ppa-purge ppa:noobslab/apps
sudo ppa-purge ppa:numix/ppa
sudo ppa-purge ppa:dreibh/ppa
sudo ppa-purge ppa:saiarcot895/flightgear
sudo ppa-purge ppa:andreas-boettger/gmusicbrowser-daily
sudo ppa-purge ppa:xorg-edgers/ppa

drivers - Ubuntu 12.10: black screen after installing nvidia-current

COMPUTER: Macbook pro 7'1 (mid 2010)
GRAPHIC CARD: NVIDIA 320M



Today, after a fresh install of Ubuntu Quantal Quetzal, I installed the suggested nvidia drivers from terminal by running the following command:



sudo apt-get install nvidia-current



and then:



sudo nvidia-xconfig


But when I rebooted, after chosing Ubuntu from the boot loader, the screen was black and there was nothing I could do...



How can I fix this?







Thank you roadrm for your helpful answer, but I still cannot boot into a usable system even editing the kernel and adding the nomodeset string :( I managed to boot the 3.5.0-17, but my default kernel is the 3.5.0-25 so this doesn't help... I should probably add to the informations that before installing the nvidia-current I also entered the following commands:



sudo apt-get install Linux-source


And




sudo apt-get install linux-headers-generic


In order to give The correct headers for the driver :(

package management - How do I add a software source?


Sometimes I see sites offering Ubuntu packages via something like



Add this line to your software sources: deb http:// something something



How can I add these to my package manager so I can install the software and keep it up to date? I'd like both GUI and command line options.



You can easily add them in the Software Center->Edit->Software Sources->Other Sources->Add"



  1. Start the Software Center.


  2. In the panel go to Edit and select Software Sources.


    edit-software-sources


  3. In the tab Other Sources click on the Add button at the bottom.


    other-sources


  4. Add the deb URL in the APT Line input field and hit Add Source.


    software-properties-gtk



Once you close the Software Sources window your cache is going to be updated automatically.


You can now browse the newly added source in the New Source sub-list using the upper left list in Get Software.


boot - Unable to get back Windows 7 partition entry in Grub2 Ubuntu 12.04

I had Ubuntu 12.04 installed on my system along with Windows 7, running perfectly. Then I upgraded to 14.04 and many things in many things went wrong so I decided to format just my Ubuntu partition (deleted it and set it as root /) and install 12.04 once again, on that partition. This time, the grub disappeared. I tried grub-update, I got it back but without the Windows partition, even though it does exist.



I ran boot-repair disk, it said everything went fine, but still not getting my Windows partition entry in grub yet.




Here is a LINK of the execution trace from boot-repair. It says in the end that /mnt/boot-sav/sda3/ may need repair, which is the partition of Windows.



I already tried to run a repair with Windows bootable disk but it says that the automatic repair can't be performed.



I'm still not getting what needs to be done.



How to solve it ?

Friday, April 29, 2016

16.04 - WD Smartware or Equivalent

Recently I changed my operating system to Ubuntu 16.04. Before I had Windows 10 and used Western Digital SmartWare to make backups on an external drive from my WD hard drive. Now Ubuntu recognizes the external drive but intended to do backups with some software instead of manually transfer to the external drive. Is there any Ubuntu application to replace WD SmartWare? Thank you.

repository - E: Some index files failed to download. They have been ignored, or old ones used instead after apt-get update




My /etc/apt/sources.list contained:



nazar_art@nazar-desctop:/etc/apt$ cat source.list
deb http://security.ubuntu.com/ubuntu precise-security main universe
nazar_art@nazar-desctop:/etc/apt$ cat sources.list.old
deb http://archive.ubuntu.com/ubuntu precise universe
nazar_art@nazar-desctop:/etc/apt$ cat source.list
deb http://security.ubuntu.com/ubuntu precise-security main universe
nazar_art@nazar-desctop:/etc/apt$



I updated according to this post How do I restore the default repositories?



But It called another problem when I run sudo apt-get update I have some output like this:



Err http://ua.archive.ubuntu.com main/restricted Sources                       
404 Not Found [IP: 91.189.91.13 80]
Err http://ua.archive.ubuntu.com main/universe Sources
404 Not Found [IP: 91.189.91.13 80]
Err http://ua.archive.ubuntu.com main/multiverse Sources

404 Not Found [IP: 91.189.91.13 80]
Err http://ua.archive.ubuntu.com main/restricted amd64 Packages
404 Not Found [IP: 91.189.91.13 80]
Err http://ua.archive.ubuntu.com main/universe amd64 Packages
404 Not Found [IP: 91.189.91.13 80]


and this:



W: Failed to fetch http://ua.archive.ubuntu.com/ubuntu/dists/-backports/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.91.13 80]


W: Failed to fetch http://ua.archive.ubuntu.com/ubuntu/dists/-backports/universe/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80]

W: Failed to fetch http://ua.archive.ubuntu.com/ubuntu/dists/-backports/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.


UPDATE:



I did this command (Thanks NikTh):




find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;



whole output:



/etc/apt/sources.list

1 #############################################################
2 ################### OFFICIAL UBUNTU REPOS ###################
3 #############################################################

4
5 ###### Ubuntu Main Repos
6 deb http://ua.archive.ubuntu.com/ubuntu/ main restricted universe multiverse
7 deb-src http://ua.archive.ubuntu.com/ubuntu/ main restricted universe multiverse
8
9 ###### Ubuntu Update Repos
10 deb http://ua.archive.ubuntu.com/ubuntu/ -security main restricted universe multiverse
11 deb http://ua.archive.ubuntu.com/ubuntu/ -updates main restricted universe multiverse
12 deb http://ua.archive.ubuntu.com/ubuntu/ -proposed main restricted universe multiverse
13 deb http://ua.archive.ubuntu.com/ubuntu/ -backports main restricted universe multiverse

14 deb-src http://ua.archive.ubuntu.com/ubuntu/ -security main restricted universe multiverse
15 deb-src http://ua.archive.ubuntu.com/ubuntu/ -updates main restricted universe multiverse
16 deb-src http://ua.archive.ubuntu.com/ubuntu/ -proposed main restricted universe multiverse
17 deb-src http://ua.archive.ubuntu.com/ubuntu/ -backports main restricted universe multiverse
18
19
20
21 #############################################################
22 ################### OFFICIAL UBUNTU REPOS ###################
23 #############################################################

24
25 ###### Ubuntu Main Repos
26 deb http://ua.archive.ubuntu.com/ubuntu/ main restricted universe multiverse
27 deb-src http://ua.archive.ubuntu.com/ubuntu/ main restricted universe multiverse
28
29 ###### Ubuntu Update Repos
30 deb http://ua.archive.ubuntu.com/ubuntu/ -security main restricted universe multiverse
31 deb http://ua.archive.ubuntu.com/ubuntu/ -updates main restricted universe multiverse
32 deb http://ua.archive.ubuntu.com/ubuntu/ -proposed main restricted universe multiverse
33 deb http://ua.archive.ubuntu.com/ubuntu/ -backports main restricted universe multiverse

34 deb-src http://ua.archive.ubuntu.com/ubuntu/ -security main restricted universe multiverse
35 deb-src http://ua.archive.ubuntu.com/ubuntu/ -updates main restricted universe multiverse
36 deb-src http://ua.archive.ubuntu.com/ubuntu/ -proposed main restricted universe multiverse
37 deb-src http://ua.archive.ubuntu.com/ubuntu/ -backports main restricted universe multiverse
38
39

/etc/apt/source.list

1 deb http://security.ubuntu.com/ubuntu precise-security main universe


/etc/apt/sources.list.d/ubuntu-extras.list

1 deb http://extras.ubuntu.com/ubuntu/ precise main #Added by software-center
2 deb-src http://extras.ubuntu.com/ubuntu/ precise main #Added by software-center

/etc/apt/sources.list.d/webupd8team-y-ppa-manager-precise.list

1 deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu precise main
2 deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu precise main


/etc/apt/sources.list.d/playonlinux.list

1 deb http://deb.playonlinux.com/ quantal main

/etc/apt/sources.list.d/private-ppa.launchpad.net_commercial-ppa-uploaders_intellij-idea-ce_ubuntu.list

1 deb https://private-ppa.launchpad.net/commercial-ppa-uploaders/intellij-idea-ce/ubuntu precise main #Added by software-center; credentials stored in /etc/apt/auth.conf

/etc/apt/sources.list.d/webupd8team-sublime-text-3-precise.list


1 deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu precise main
2 deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu precise main

/etc/apt/sources.list.d/medibuntu.list

1 ## Please report any bug on https://bugs.launchpad.net/medibuntu/
2 deb http://packages.medibuntu.org/ precise free non-free #Medibuntu - Ubuntu 12.04 "precise pangolin"
3 # deb-src http://packages.medibuntu.org/ precise free non-free #Medibuntu (source) - Ubuntu 12.04 "precise pangolin"


/etc/apt/sources.list.d/lezhoev-qstamina-precise.list

1 deb http://ppa.launchpad.net/lezhoev/qstamina/ubuntu precise main
2 deb-src http://ppa.launchpad.net/lezhoev/qstamina/ubuntu precise main

/etc/apt/sources.list.d/webupd8team-java-precise.list

1 deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
2 deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main


/etc/apt/sources.list.d/tualatrix-ppa-precise.list

1 deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main
2 deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main

/etc/apt/sources.list.d/kilian-f_lux-precise.list

1 deb http://ppa.launchpad.net/kilian/f.lux/ubuntu precise main
2 deb-src http://ppa.launchpad.net/kilian/f.lux/ubuntu precise main


/etc/apt/sources.list.d/ubuntu-wine-ppa-precise.list

1 deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main
2 deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main

/etc/apt/sources.list.d/fsqcds-goldendict-precise.list

1 deb http://ppa.launchpad.net/fsqcds/goldendict/ubuntu precise main
2 deb-src http://ppa.launchpad.net/fsqcds/goldendict/ubuntu precise main


/etc/apt/sources.list.d/webupd8team-rhythmbox-precise.list

1 deb http://ppa.launchpad.net/webupd8team/rhythmbox/ubuntu precise main
2 deb-src http://ppa.launchpad.net/webupd8team/rhythmbox/ubuntu precise main

/etc/apt/sources.list.d/upubuntu-com-devel-precise.list

1 deb http://ppa.launchpad.net/upubuntu-com/devel/ubuntu precise main
2 deb-src http://ppa.launchpad.net/upubuntu-com/devel/ubuntu precise main




  • How to solve this trouble in Ubuntu 12.04



Open a terminal (CTRL+ALT+T) and issue the following commands in order.



SOLUTION:



sudo cp /etc/apt/sources.list ~/ 

sudo wget "http://pastebin.com/raw.php?i=uzhrtg5M" -O /etc/apt/sources.list
sudo apt-get update
sudo rm /etc/apt/sources.list.d/ubuntu-extras.list
sudo apt-get update


This solution is not general. It is specific to the sources.list file of the Original Poster.



The second command which starts with wget downloads and replaces the sources.list file with a specific for Precise (Ubuntu 12.04) sources.list file. See the file in raw format by visiting this page.




The fourth command removes the ubuntu-extras.list file which had an impact/conflict with another file of the same, so we removed it to avoid the error



W: Duplicate sources.list entry


see comments above.


How do you remove Nvidia's proprietary drivers?

I always seem to have grief with Nvidia drivers and have often had to re-install Ubuntu: is there a better way to remove them? When I first installed the drivers, the display came up on 640 by 480. I managed to set 2 screens to 1024 by 780 which was usable, but then Ubuntu recommended installing proprietary drivers (nvidia-current-updates 295.40-ubuntu1). After doing this and re-booting it shows LAPTOP and offers only 640 by 480 on a single screen.



  1. Is there any way to revert to the original driver?

  2. Is there any way to find out if the new drivers work before installing them? - For years I have been hoping that it would be all fixed in the latest release… I always seem to fall for this!

boot - I have Ubuntu alongside Windows Vista and I cannot reboot Windows Vista



I cannot get into Windows Vista .... I was working in Vista and then I restarted booted up Ubuntu and when I finished in Ubuntu I restarted this time in Vista and all I get is the microsoft box with the vertical stripes running interminably.
I ran sudo update-grub this is the result of that command:




generating grub.cfg
found linux image: /boot/vmlinuz-3.2.0-24-generic
found initrd image: /boot/iniytd.img-3.2.0-24-generic

found linux image: /boot/vmlinuz-3.0.0-19-generic
found linitrd image: /boot/initrd.img-3.0.0-19-generic
found windows recovery environment (loader) on /dev/sda1
skipping windows recovery environment (loader) on Wubi system
found windows vista (loader) on /dev/sda2
skipping windows vista (loader) on wubi system


I do have a backup of my Windows environment on an external hard drive and I can get to it through ubuntu but I am not sure if I can restore Windows Vista from Ubuntu or even if I need to.




Thanks for any help.



Install grub-customizer (from a PPA on launchpad) and enable the windows image



You asked for details, here you go:



Open up terminal - the commands add the extra line to your sources to allow you to install this new piece of software and get updates for it, the second installs it, then it should show up in the application launcher - if it doesn't, just run sudo grub-customizer after the last one.



sudo apt-add-repository ppa:danielrichter2007/grub-customizer




sudo apt-get install grub-customizer



After each command, you may have to enter your password - this is because you have to confirm this way to add or remove software. It will prompt in the terminal, not by covering your screen with a message, so check for it.


boot - Add Windows 10 to GRUB OS list

I recently got a computer from school. It came with Windows 8.1 installed. I then installed another copy of Windows 8.1 (so it would use the built-in Windows Pro license) and upgraded it to Windows 10. I then installed Ubuntu alongside both Windows 8 and 10.


Note that I made a separate 255MB ext2 partition for /boot.


Now, when I boot the computer, I first see a GRUB prompt (I already un-hid the grub prompt 'cuz I like it that way) with Windows 8 and Ubuntu options. However, there is no Windows 10 option. If I select Ubuntu, the computer boots into Ubuntu. However, if I select the Windows 8 option, I then get sent to the Windows bootloader, where it then gives me options to boot either Windows 8 or Windows 10. (However, by this point, the computer has already loaded the kernel and all. Apparently Microsoft misunderstood the concept of a bootloader and decided that that meant "boot practically the entire system before actually showing the bootloader". Typical Microsoft.)


How can I disable the Windows bootloader and add a Windows 10 option to GRUB?
EDIT: Someone has answered telling me to disable the Windows bootloader. However, I still do not know how to add Windows to the GRUB OS list. Can anyone help with this?


EDIT 2: After removing Windows 10 from the Windows bootloader with EasyBCD, it seemed that, after a few reboots, it would continually unhide itself and Windows 10 would reappear. However, I then later deleted Windows 10 from the list of OSes in msconfig, and it seems to have stayed deleted.


However, I STILL have not managed to get Windows 10 to appear in GRUB. It's as if GRUB simply doesn't detect it.


Also, I'll put this in the question so that people see it - I have tried using boot-repair, however, it has NOT helped any.

security - How to quarantine or delete infected files with ClamAV?

I scanned the home directory using ClamAV which found 13 threats.
The list was also displayed, but when I tried to delete or quarantine files, it did not proceed. Any ideas?

package management - sbackup-gtk not installable from 14.04


I can't install sbackup on my laptop due to below reason:



$ sudo apt-get install sbackup-gtk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an
impossible situation or if you are using the unstable distribution that some required
packages have not yet been created or been moved out of Incoming. The following
information may help to resolve the situation:
The following packages have unmet dependencies:
sbackup-gtk :
Depends: python-glade2 but it is not going to be installed
Depends: python-gnome2 but it is not going to be installed


sbackup-gtk package is available at universe repository in Ubuntu 14.04. So run the below commands on terminal to install sbackup-gtk,


sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install sbackup-gtk

boot - How to use windows 8 bootloader instead of ubuntu 13.04grub?




I have dual booted my netbook with windows 8 pro and ubuntu 13.04.



i do not like grub and think the windows 8 bootloader is a lot more clean and sharp.



Is there a way to use the windows bootloader instead of the horrible sticky looking grub?



Please Help!



Yes, you can use (in Windows) EasyBCD - a Windows tool that allows you to create a multi boot environment in order to run multiple operating systems on the same computer.




After you fix Windows boot loader, when you will go in Ubuntu, Grub will appear anyway. To prevent this, you must to edit /etc/default/grub file (sudo gedit /etc/default/grub) and make GRUB_TIMEOUT=0:



edit grub



Run sudo update-grub afterwards to update /boot/grub/grub.cfg.


Thursday, April 28, 2016

laptop - Lenovo 500S-14ISK Linux compatibility

I would like to buy a Lenovo 500S-14ISK, but I can't find any reviews on it regarding linux compatibility. Ubuntu does not seem to have certified this laptop (yet)?


Anybody had experience with this model? Since it's a lenovo, my gut says it will work with Ubuntu/Mint out of the box, but I just want to be sure.

Login loop after installing Nvidia drivers on Ubuntu 14.04

I keep getting a login loop (e.g. trying to login just redirects back to the login screen despite correct password.) This started occurring after trying to install Nvidia drivers using a .run.



During this installation, everything seemed to be okay except an error that pre-installation files could not be installed although I did not worry about this.



I have tried many things to try to rectify the situation after reading several other posts on here and other forums but none of this seemed to have worked. I have tried: removing and purging all Nvidia files and reinstalling Ubuntu desktop, reinstalling lightdm, changing permissions on .Xauthority, removing xorg.conf amongst other minor things but none of these have had any effect.



As I said, I'm aware of other posts on this but none of those solutions have worked. Any ideas?

Dual boot Ubuntu and Windows 8.1

Is it possible to dual boot both Ubuntu 14.04 and Windows 8.1 without conflict? I have Windows 8.1 installed on a 120 GB SSD with a 2TB HDD for mass storage. I also have a 1TB HDD with Ubuntu 14.04 installed. When I want to boot into Ubuntu I disconnect both my Windows drives and connect my Ubuntu drive. I would like to have all of them connected all the time so I can switch boot drives in BIOS without having to physically connect/reconnect my drives. Will doing so cause any issues?



Thanks :)

dual boot - Grub not recognizing windows 10



This what i did which made things to mess up.



1)I installed Windows 8.1



2)I installed ubuntu 15.04 in different partition



3)I upgraded windows to windows 10




4)I upgraded ubuntu to ubuntu 15.10



5)Thought to reinstall ubuntu so tried to replace existing ubuntu partition with new ubuntu using usb stick, but when i tried to reintsall using usb it used show an error like:
GNU GRUB Version 2.02~ beta 2-9



Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions.




grub>_



6)Trying to get rid of this i deleted the ubuntu partition



7)Got stuck in grub rescue mode



8)Now again to set things right i connected a live usb and installed ubuntu



9)Now grub is not recognizing Windows 10




Help me get out of this, I have some important files in windows 10.



For whatever reason (probably due to updating and Windows 10 using a different boot method or something akin to that) the listing of available operating systems has gone missing. This is something that can be fixed in a number of different ways. The simplest one to try is this:




  • Open the terminal by pressing CTRL+ALT+T.

  • Enter this command:



    sudo update-grub


  • Press the ENTER button.



  • Enter your password (no asterisks will show, nothing will change on the screen, the cursor will not move, this is normal).

  • Press the ENTER button.

  • Let the system do its stuff and then enter this command:



    sudo reboot




This will allow grub to automatically find and enumerate the available operating systems and then give you the option to boot to the desired operating system during the boot process.


grubrescue - What to do when grub rescue does not recognize any of the partitions?

I had Win 7, Ubuntu (old), Kali 2017.



I wanted to erase Ubuntu so I deleted a partition using Win7, but I wasn't sure if it was Ubuntu's partition or not. When I restarted my computer the grub rescue> prompt came up. Now I can't do anything.



I tried checking the partitions using the ls command, but I couldn't find anything useful. I urgently need to get my system running again. What should I do?

Wednesday, April 27, 2016

boot - Upgrading Linux kernel without installing grub dependencies?

I installed Ubuntu 16.04 in a system that already uses rEFInd for booting. After installation, I removed all grub-related packages. However, each time a new kernel release comes out, it tries to install some grub dependencies that I don't need because I don't have grub installed to start with. Here's the commands I'm using:


$ sudo apt-get update && sudo apt-get upgrade
...
Fetched 306 kB in 0s (350 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
linux-headers-generic linux-signed-generic linux-signed-image-generic

So after that I try with a dist-upgrade:


$ sudo apt-get dist-upgradeReading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common
linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic
linux-image-4.4.0-72-generic linux-image-extra-4.4.0-72-generic
linux-signed-image-4.4.0-72-generic os-prober
The following packages will be upgraded:
linux-headers-generic linux-signed-generic linux-signed-image-generic
3 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 71.8 MB/71.8 MB of archives.
After this operation, 314 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

I tried upgrading anyways and removing the grub packages afterwards, however, the package manager fails when configuring and installing grub-pc, just like in this thread.


Is there any way I can upgrade the Kernel without installing those grub dependencies?

Why doesn't apt-get autoremove remove my old kernels?



My boot partition is on a SSD, so it doesn't have room for more than about 8 installed kernel versions, and eventually some kernel update will fail to install because my boot partition is full of old versions. There are many questions out there about how to remove old versions (even how to automate the process), but my question is simply this: Why doesn't apt-get autoremove detect and remove them automatically, and is there a way I can make it do so? I mean, apt-get is what installed them anyway, so it knows about them, so why does it choose to leave all old versions around?




As to answer why , refer to the file /etc/apt/apt.conf.d/01autoremove-kernels



enter image description here



As you can see, apt is told to never autoremove the kernels , as told by another (script) file, /etc/kernel/postinst.d/apt-auto-removal. And here it is:



enter image description here



If you manually install 2 chosen kernels, ie the first and the current one, then apt-autoremove will only ever remove the older versions you didn't manually install, so you will always have those 2 options plus whatever the latest one is.




Update:





In the /etc/kernel/postinst.d/apt-auto-removal there is this part:



if [ "$latest_version" != "$installed_version" ] \
|| [ "$latest_version" != "$running_version" ] \
|| [ "$installed_version" != "$running_version" ]
then

# We have at least two kernels that we have reason to think the
# user wants, so don't save the second-newest version.
previous_version=
fi


So if you compare the output of 01autoremove-kernels file and uname -r you'll realize that the currently running kernel and the most recent before it, are kept to be never removed by that script. There turns out is another file /etc/apt/apt.conf.d/01autoremove, where there is lines:



    APT
{

NeverAutoRemove
{
"^firmware-linux.*";
"^linux-firmware$";
};
VersionedKernelPackages
{
# linux kernels
"linux-image";
"linux-headers";

"linux-image-extra";
"linux-signed-image";
# kfreebsd kernels
"kfreebsd-image";
"kfreebsd-headers";
# hurd kernels
"gnumach-image";
# (out-of-tree) modules
".*-modules";
".*-kernel";

"linux-backports-modules-.*";
# tools
"linux-tools";
};


So you could comment these out, and it will allow you to auto-remove the kernels with apt-autoremove, though remember - do this at your own risk


software recommendation - Vim is not working fine in Ubuntu 13.04

How to install full version of Vim editor in ubuntu 13.04

xfce - How to customize Xubuntu with remastersys?

I've been trying to make my own custom xubuntu-based distro. I thought I understood how to import settings and features and repackage using remastersys, but apparently not.
One of the features involves removing the xfce4-panel and replacing it with cairo-dock(with my own theme), but with each ISO it keeps asking me to how I want to configure xfce4-panel and forgets about auto-starting cairo-dock.



Also when I do manually start cairo-dock it doesn’t have the theme i designed selected by default. I made sure I selected my user-name when configuring remastersys, as well as copying over the files/directories from my home directory to /etc/skel/. I even later moved my user-space over to /etc/skel/, but to no avail. Anybody know how what I'm doing wrong?

wireless - How to know I have to blacklist acer_wmi?


I recently bought a Xiaomi Notebook Air 13'.


As a lot of people, I met some issues with the WiFi on Ubuntu (16.04). Basically, the WiFi just did not work.


As answered on ask ubuntu, a simple way to fix this issue is to add blacklist acer_wmi in the file blacklist.conf.


So, my question is not "How to fix this issue?", but my question is "How could I know by myself ( ie. just by looking in command output like lsmod or lspci ) how to fix this issue?


For example, an extract of the output of lspci -vv is the following:


$ lspci -vv
02:00.0 Network controller: Intel Corporation Wireless 8260 (rev 3a)
Subsystem: Intel Corporation Wireless 8260
Control: I/O- Mem+ BusMaster+ SpecCycle- MenWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66Mhz UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ283
Region 0: Memory at a4100000 (64-bit, non-prefetchable) [size=8K]
Capabilities:
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi

Here, we see that iwlwifi is the module which drives the Wifi controller.


But I cannot find any link (when I use for example lspci or lsmod) between iwlwifi and acer_wmi.


But if I blacklist acer_wmi, the WiFi works fine! Why ?


For information:


$ lsmod | grep acer_wmi
acer_wmi 20480 0
sparse_keymap 16384 2 acer_wmi,dell_wmi_aio
wmi 16384 4 acer_wmi,mxm_wmi,dell_wmi_aio,nouveau
video 40930 3 acer_wmi,nouveau,i915


The module iwlwifi is the driver for your wireless device. The module acer_wmi is a helper module that translates key presses, Fn+F8 for example, into action, in your case, 'turn on the wireless radio, please.'


You can gain some clues from the terminal command:


rfkill list all

You may see something like this:


0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: acer-wireless: Wireless LAN
Soft blocked: yes
Hard blocked: no

As well, you may notice that any presses of the wireless or airplane mode key doesn't enable wireless. In your case, we also see:


$ lsmod | grep acer_wmi
acer_wmi 20480 0
sparse_keymap 16384 2 acer_wmi,dell_wmi_aio
wmi 16384 4 acer_wmi,mxm_wmi,dell_wmi_aio,nouveau
video 40930 3 acer_wmi,nouveau,i915

The original manufacturer of your Xiaomi is probably not both Acer and Dell.


As an experiment, you blacklisted acer_wmi and the wireless works correctly. I believe you found the correct solution!


How do I reinstall Unity?

I tested out Unity 5, and of course, it broke things, so I tried downgrading by


sudo apt-get install ppa-purge
sudo ppa-purge ppa:unity-team/staging

It removed Unity completely.


apt-get install unity

seemed to work, but the login screen now offers only Gnome.


How do I get back to Unity 4?

Unable to locate package koha-common




I just have installed Koha on Ubuntu 16.4. But due to some reasons I have uninstalled it. Now I am trying to install it again but now it is telling E: unable to locate package. Please help.




Results of sudo apt update:



E: Could not get lock /var/lib/apt/lists/lock- open (11: Resources temporarily unavailable). 
E: Unable to lock directory /var/lib/apt/lists/


As far as I can see, you error message says Unable to lock directory /var/lib/apt/lists/ and not E: unable to locate package.



If the error is: Unable to lock directory /var/lib/apt/lists/ that means that other package manager could be running in background, so please execute the following to check for that:




ps aux | grep '[a]pt'



If in the output of this command there's a process running using apt-get, then the best action to take is to wait for some time until it finishes. Otherwise you can kill it using:



sudo pkill -f or sudo killall -s KILL



After you're sure that there is no process using apt, you can remove the lock file using:



sudo rm /var/lib/apt/lists/lock




And then try to re-install koha-common with the command:



sudo apt-get install koha-common



Hope it helps.


Tuesday, April 26, 2016

dconf - How to change Gsettings via remote shell?


I need to automate desktop configuration via Puppet, virtual terminal or ssh.


Unfortunately, invocation of gsettings via ssh or virtual terminal gives:


gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize "4"
(process:29520): dconf-WARNING **: failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY

When I set the $DISPLAY with export DISPLAY=:0.0 it gives another error:


(process:29862): dconf-WARNING **: failed to commit changes to dconf: Could not connect: Connection refused

What can I do?



The key is to set the DBUS_SESSION_BUS_ADDRESS environment variable.


On this thread I found the following script, that helps to get the correct value of that variable. It requires name of the process, that is running on the desktop, on which we want to change the dbus settings. (There can be more than 1 running graphical sessions in parallel). Lets call it discover_session_bus_address.sh


#!/bin/bash
# Remember to run this script using the command "source ./filename.sh"
# Search these processes for the session variable
# (they are run as the current user and have the DBUS session variable set)
compatiblePrograms=( nautilus kdeinit kded4 pulseaudio trackerd )
# Attempt to get a program pid
for index in ${compatiblePrograms[@]}; do
PID=$(pidof -s ${index})
if [[ "${PID}" != "" ]]; then
break
fi
done
if [[ "${PID}" == "" ]]; then
echo "Could not detect active login session"
return 1
fi
QUERY_ENVIRON="$(tr '\0' '\n' < /proc/${PID}/environ | grep "DBUS_SESSION_BUS_ADDRESS" | cut -d "=" -f 2-)"
if [[ "${QUERY_ENVIRON}" != "" ]]; then
export DBUS_SESSION_BUS_ADDRESS="${QUERY_ENVIRON}"
echo "Connected to session:"
echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}"
else
echo "Could not find dbus session ID in user environment."
return 1
fi
return 0

With this script we can do the following, assuming that unity process is running on the desktop, on which we want to apply our settings:


. ./discover_session_bus_address.sh unity
gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize "4"

And things should work OK.


command line - Execute sudo without Password?



Inspired by this question....



I am the sole person using my system with 12.04.
Every time I issue a sudo command; the system asks for the user password (which is good in its own way).
However I was thinking; without activating the root account; how can I execute the sudo commands which will not ask for user password to authenticate.



NOTE: I want to execute sudo command without authenticating via password; only when they are executed via terminal.
I don't want to remove this extra layer of security from other functions such a while using 'Ubuntu software center' or executing a bash script by drag-drop something.sh file to the terminal.



sudo -i is the way to go if you don't want to be typing a password every 10 mins while doing modifications in your system (or other systems), and you don't want to modify any system files.




It will switch you to root using your sudo user password, when you close the console or type exit you are back to your normal user.


python - How can I report a bug when ubuntu-bug fails with an error?

How can I report a bug when ubuntu-bug crashes?


ongun@ongun-ubuntu:~$ ubuntu-bug python
ERROR: /etc/apport/crashdb.conf is damaged: No default database

bug reporting - command request me to report it's bug?



Today I got a message when I was using ld command .




It says :



ld: Please report this bug.



So, What should I do ?



Is it serious or just I should ignore it?



(if it is good to report it, I'll learn to do that ;) no Problem )




If you want to File the Bug report follow this



How do I report a bug?



You may consider reinstalling that package . Every bug get the affinity of being Serious , Low Urgency , etc. as per concluded by the Development team. But you need to report the bug for that.



It is a good practice , since you are Contributing to Ubuntu Development by reporting a bug . It helps in fixing it which get ends up in Updates as newer version with bug fixes and other features , thereby making your system more Secure and Robust.


updates - Is there a way to find out whether an updated program/package lands in the official Ubuntu release repositories?


If there is a new release/major update of a program (e.g. Rhythmbox 2.97, Skype 4.0 or Gimp 2.8), is there an easy way to tell whether and when they will make it to the current official Ubuntu release repositories (especially to the LTS release, e.g. Ubuntu 12.04)?
Or whether it will never be added to the official repositories, so I don't need to wait and just install it through an added PPA/repository?


I would like to use the program updates, but preferably when they are well tested and adjusted to the Ubuntu release I use (easily updated by the update manager). But some programs seem to never be added/updated and as I want to stick to the LTS release, I would need to add another repository.
I know that there are restrictions to what will be updated (Why don't the Ubuntu repositories have the latest versions of software?, StableReleaseUpdates). But for example Firefox and Thunderbird are now regularly updated and Gimp 2.8 might be available in the backports. There is list of pending Ubuntu stable release updates, but I don't find Firefox, Thunderbird (or Gimp) on it, although they are updated.


I just want to know how to find out whether there is an easy way to know (e.g. one webpage) which programs will be added/updated in the official Ubuntu repositories. Or do we have to ask a question on Askubuntu for every single program?



There is no list that covers all yet, especially for possible future updates/upgrades. Maybe somebody can work on this ...


That is what I could find out so far:
If a program is updated/upgraded, it will be automatically added to the software centre (and will be updated by the system), viewable also with Synaptic (needs install) and apt-cache (command line).
The page packages.ubuntu.com shows past updates, but do not inform what the future will hold.


Stable Release Update/Backport
Every SRU (Stable Release Update) and Backport is manually requested. SRUs are done only to fix an important bug. Backports are done upon request, if volunteers and resources are available.
Requests for packaging and/or backports are generally tracked as bugs. They are not really bugs, of course. But bug trackers usually track more than just bugs, see backports list.
If you poke around in Launchpad, you should quickly find the similar tracking lists for the Packaging Team, the Security Team, and the SRU Team.
There is doubt that tentative release dates are realistic for most packages, since many backporters seem to work more-or-less at random from the list. If some backporter has specific interests, then they could certainly post ETA dates in the comments and assign the package to themself.


PPAs and alternative repositories
As there are not many significant updates/upgrades that are added in the official repositories of a Ubuntu release (although this might change with future LTS releases), PPAs and alternative repositories are chosen by a lot of people, but it takes time to find them:
I would also promote a list of PPAs and alternative repositories, but this is not supported by Canonical as many PPAs and alternative repositories can cause problems to a system. But a list with the possibility of rating and comments (problem, success) would be better as the scattered information without or little feedback from the community. Unfortunately the Ubuntu brainstorm page will be closed, so I add this idea to this answer, perhaps somebody knowledgeable reads it and can work on it.
There is a related brainstorm idea regarding this topic as long as Ubuntu Brainstorm exists.


How Do I Dual boot Windows After Ubuntu in Legacy mode GPT paritition Table?

Number Start End Size Type File system Flags




1 1049kB 370GB 370GB primary ext4 boot



3 370GB 496GB 126GB primary ntfs



2 496GB 500GB 4198MB extended



5 496GB 500GB 4198MB logical linux-swap(v1)



Okay so basically I have my ubuntu on Legacy boot secure mode off: and I have created another partition of 126GB(ntfs) for my dual boot windows, However when I started to boot windows, I had an error message: Your partition table is MBR. The disk is in EFI system, and you need to convert it to GPT from MBR. I think it's maybe I have installed ubuntu on Legacy and I am installing windows on UEFI maybe? Now in order to convert MBR to GPT I need to erase all data and I would want to avoid that, So can I run both ubuntu and Windows on legacy GPT ?

Monday, April 25, 2016

14.04 - Can you transfer Steam games from one Ubuntu Laptop to another?



This question is about importing steam games from Windows to Ubuntu so is similar but I don't think a duplicate.




A little on my situation, I have an old laptop running Ubuntu 14.04 and have Steam installed with some games downloaded or part-downloaded. I've got a new laptop also running ubuntu 14.04 and have installed steam. I have not yet opened steam. If it makes any difference my old laptop only has one HDD whereas my new machine has / on a SSD and /home on a HDD and user name is the same on both.



Is there an easy way to transfer my steam game files from my old laptop to my new one?



Unless you have setup separate libraries, Steam on Linux stores all the games in the .local/share/Steam/SteamApps, which is the equivalent of the Windows Steam client's SteamApps folder. So just copy this folder.


Can't boot Windows 8 after installing Ubuntu



I have Ubuntu configured to dual boot on my Windows 8 laptop. When I first installed it, I partitioned ~100GB for Ubuntu and left the rest to Windows (I might've messed up the partitioning.). Now when I try to boot Windows 8, the Windows Boot Manager tells me it has failed.




Specifically:



Windows Boot Manager  

Windows failed to start. A recent hardware or software change might be the cause.
To fix the problem:

  1. Insert your Windows installation disc and restart your computer.
  2. Choose your language settings, and then click "Next."
  3. Click "repair your computer."


If you don't have this disc, contact your system administrator or computer
manufacturer for assistance.

  File: \Boot\BCD

  Status: 0xc0000001

  Info: The Boot Configuration Data for your PC is missing or contains errors.


Any tips on how to fix this? I'm going to try to repair it with the installation disk, but I'm worried that some of my data won't be able to be recovered.




You've got a BIOS/CSM/legacy-mode Ubuntu installation alongside an EFI/UEFI-mode Windows installation. As you've discovered, this combination is not good. You probably got to this point because you followed misguided installation instructions that suggested you enable the CSM (aka "legacy boot support") in your firmware. This causes more problems than it solves, as described in greater detail on this page of mine. To fix the problem, I recommend:




  1. Download the USB flash drive or CD-R version of my rEFInd boot manager.

  2. Prepare a boot medium from the rEFInd image.

  3. Enter your firmware setup utility. You typically do this by hitting Del, Enter, or a function key soon after powering on the computer (about when you'd press F12 to get the firmware's built-in boot manager that you're using as a workaround).

  4. Disable the CSM. This will produce a boot straight to Windows, once you reboot.

  5. If it's currently enabled, disable Secure Boot. You can re-enable it later, if you like.

  6. Insert the rEFInd medium and reboot into it. (You may need to use your F12 key.)


  7. rEFInd should show options to boot both Windows and Ubuntu. Test Windows first, then Ubuntu.

  8. If you can boot both Windows and Ubuntu from rEFInd, then you can install an EFI-mode boot loader from Ubuntu. There are many options, but the two easiest are likely to be:


    • rEFInd -- You can install the rEFInd PPA or Debian package to use it, bypassing GRUB. You know it works at this point, so it's a pretty safe choice; but if you want to use it with Secure Boot enabled, there will be more hoops to jump through later, as described here.

    • GRUB -- You can install the grub-efi package, which should replace the grub-pc package. You'll then have to re-install GRUB by typing sudo grub-install. You may also need to type sudo update-grub to get the configuration file right. This is a bit of a leap of faith, but if it doesn't work, you can use the rEFInd medium to boot up and try again. Alternatively, Boot Repair can usually get things working by re-installing GRUB automatically. One advantage of this approach is that you should be able to re-enable Secure Boot after you're done with no additional trouble.




There are numerous variants on this procedure. Most notably, if you're sure you want to stick with GRUB, you can skip using rEFInd and boot your Ubuntu installation medium in EFI mode and run Boot Repair from it, rather than use rEFInd to boot into your existing installation and repair it.



How to upgrade from 14.04 to 16.04?


I would like to upgrade an Ubuntu system from 14.04 to 16.04. I ran the usually referenced command:


sudo update-manager -d

Which is strangely proposing to upgrade to 14.10:


enter image description here


If I then ask for the upgrade I get this error message:


enter image description here


How is it done exactly?



Try:



  1. Edit the file /etc/update-manager/release-upgrades .

  2. Change the value of "Prompt" from "normal" to "lts".

  3. Then try sudo do-release-upgrade -d.


See if that works.


Sunday, April 24, 2016

Unable to run svn commands on a repository version 1.7


I'm unable to run svn commands in an existing repository.


Running svn status results in this :



gene@gene-ThinkPad-T60p:~/Dropbox/CDS$ svn status
svn: The path '.' appears to be part of a Subversion 1.7 or greater
working copy. Please upgrade your Subversion client to use this
working copy.



After some googling I thought that the right thing to do would be to run svn upgrade, (but this was a red herring, upgrade doesn't upgrade your installation of SVN, it upgrades the version implicit in the project). In any event, upgrade is not available in version 1.6



gene@gene-ThinkPad-T60p:~/Dropbox/CDS$ svn upgrade
Unknown command: 'upgrade'
Type 'svn help' for usage.



I tried to update of subversion (aka svn at the command lines)
I tried sudo apt-get update then sudo apt-get upgrade, with no effect.
I also tried sudo apt-get install subversion, with no effect.


I downloaded the source code and tried building subversion, but I got this error
after running ./configure


...truncated...



/bin/grep -E checking whether ln -s works... yes checking for a
BSD-compatible install... /usr/bin/install -c configure: Apache
Portable Runtime (APR) library configuration checking for APR... no
configure: WARNING: APR not found The Apache Portable Runtime (APR)
library cannot be found. Please install APR on this system and
configure Subversion with the appropriate --with-apr option.

You probably need to do something similar with the Apache Portable
Runtime Utility (APRUTIL) library and then configure Subversion with
both the --with-apr and --with-apr-util options.

configure: error: no suitable APR found



I had already read a few pages about the APR utility in the readme for SVN, but it seemed very involved. Maybe APRUTIL is for installing the server version of SVN rather than the client?


This command sudo apt-get install libapache2-svn says that I'm already at the most current version.


(edit:)
When I try sudo apt-get install subversion it says that I'm at the newest version



Reading package lists... Done
Building dependency tree
Reading state information... Done
subversion is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.



But, my current version (based on svn --version) is svn, version 1.6.17 (r1128011) compiled Jun 26 2013, 20:44:02. This seems recent to me, but according to the website they're already on 1.8.


Thanks in advance for any help.



My apologies, but I didn't do a very good job at asking the question in the first place. In my defense, this was due to many different attempts at solving the problem and I lost track of the steps.


But, here is the answer as to why SVN commands were not working, and why upgrading was not working.


My problem was that I was using Dropbox to sync my repositories across computers, and I accidentally put a SVN 1.7 repo on a SVN 1.6 machine.


SVN said that I needed to upgrade, but the SVN upgrade is only available in 1.7, so I got the error "command does not exist" (somehow version 1.6 knows that it should exist, because it's in the error message!!!)


The other complication was that I couldn't upgrade to 1.7 on this machine using the typical apt-get (update/upgrade/install) commands, because the binary is not available for Ubuntu 12.04 (LTS) though the default PPA resources.


To upgrade to SVN 1.7 in Ubuntu 12.04 you need to add a new PPA. Instructions can be found here: Where can I find a Subversion 1.7 binary?

Note: Look at more than one answer in the link above. There is a ppa available from the SVN team, and at the time of writing this was not the selected answer


From what I've read (and my personal experience) it's possible sync SVN and Git projects across machines using Dropbox, even across operating systems. However, it's probably not a good idea, and the change in SVN versions caused some pretty big problems for me. Now, several of my tracked files have been overwritten in the project and I have to go though a messy process of checking out the entire project again and manually syncing unversioned files. The overwritten files were replaced with blank files that have the original name, but no content (and they appear to SVN to be the most current version, so a revert doesn't revert them).


Yes I know that keeping unversioned files is not ideal, but I have very good reasons for doing so.


64 bit - Can I have common CD for 64 bit Ubuntu and 32 bit Ubuntu?

Why does not Ubuntu have a common CD to install Ubuntu, choosing at time of installation whether to install 32 bit or 64 bit Ubuntu, Like Windows disks. Is there any tweak that would allow installation of 32 bit Ubuntu and 64 bit Ubuntu from same CD?

compiz - Falied installing ATI X.Org binary driver!! (ATI Radeon HD 5400)


The open source driver worked well with the fresh installation of Ubuntu 12.04, but it drains my laptop battery faster. So I installed the proprietary driver from jockey-gtk. It gave me this error message at the end of the installation:


enter image description here


After restarting the computer, I lost all the compositing animations. Compiz visual effects don't work. There is a black boarder around Docky.


enter image description here


I tried:



sudo apt-get --purge remove fglrx*



...which cleaned up the proprietary driver so I could install it again, but the same issue occurred again.


fglrxinfo returns this:


X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 139 (ATIFGLEXTENSION)
Minor opcode of failed request: 66 ()
Serial number of failed request: 13
Current serial number in output stream: 13


Please somebody help me...! Thanks!



I've had similar problems, while installing the ATI driver through Jockey.


I suggest you go with a manual installation by following this excellent answer https://askubuntu.com/a/126513/47681


How can I backup files?

Is there a way to backup Ubuntu using the GUI?



I tried using rsync. It asks me "source and destination".



I want to say back up everything on internal (/dev/sda*) hard drive and save it in external hard drive (/dev/sdb*). I type exactly that, but there is no button saying "Do it now".

touchpad - How to switch from libinput to synaptics in Ubuntu 18.04


There is a problem with my laptop — jumping cursor. I think the hardware is the source of the problem. Maybe toucpad is just very inaccurate when getting finger coordinates and touching events.


On Ubuntu 14.04 I just set vertical and horizontal hysteresis and high and low finger pressure to make touchpad feel smooth and nice. When I installed 18.04 I found that I can't adjust my touchpad any more (except a few options that are not too helpful in my case).


So, can anybody of you, guys, help me with getting back that beautiful synaptics driver?



I had the same problem and basically solved it by following Ryko's advice.


sudo apt install xserver-xorg-input-synaptics

... did the trick. I didn't uninstall libinput like Pilot6 said and libinput is still happily handling my keyboard, etc.


16.04 - After updates sometimes experience stutter, lag and high load on CPU

After 10 January (meltdown patches) I've started sometimes experience 1 second stutter. My audio stutter and maybe video as well but it is hard to notice, mouse cursor lagging as if experiencing high load on HDD and during this 1 second I have high load on CPU.
I managed to make a screenshot of KSysGuard during(or aftermath of) that 1 second:
https://i.imgur.com/k3u8PNi.png



If I turn off the Wi-Fi or connect to the Wi-Fi network problem disappears.

Just in case, here is the wireless info - https://paste.ubuntu.com/26484280/



I've tried Linux kernel 4.10.0-43 and there was no problem. Any kernel from 4.13.0-26 and up to the 4.16.4 have this problem because I've tested many kernels on different distributions.



Distro: Xubuntu 16.04.3
Kernel: 4.13.0-32



This is a bug in the kernel but I don't know how to specifically report it.

sound - Only HDMI audio since installing Nvidia card: onboard audio device has disappeared


I replaced my graphics card with an Nvidia GT620. However, when I rebooted with the new card, my onboard Intel audio device disappeared completely - does not even appear in lshw.


Now the only audio output is the HDMI audio on the Nvidia card, which is annoying as my monitor has speakers but no headphone jack.


How can I make the HDMI audio device go away, and get back my onboard audio?


Sound Settings Screenshot


Sound-related stanza in lshw:


       *-multimedia
description: Audio device
product: GF108 High Definition Audio Controller
vendor: NVIDIA Corporation
physical id: 0.1
bus info: pci@0000:02:00.1
version: a1
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=snd_hda_intel latency=0
resources: irq:60 memory:fccfc000-fccfffff

Output of "aplay -l":


**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0

Output of sudo lspci | grep Aud


02:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev a1)


The cause of the problem was that the Onboard Audio was set to "Auto" in the BIOS: meaning when the BIOS detected the HDMI audio controller, it disabled Onboard Audio.


Setting Onboard Audio to "On" caused the Onboard Audio controller to reappear in Ubuntu alongside the HDMI Audio.


lxde - Run synapse (or alternative) on Lubuntu 15.04



On Lununtu 15.04 I installed synapse via PPA:



sudo apt-get install python-software-properties
sudo add-apt-repository ppa:synapse-core/testing
sudo apt-get update
sudo apt-get install synapse



enter image description here



Source: http://linuxg.net/how-to-install-synapse-0-2-99-on-ubuntu-15-04-ubuntu-14-10-ubuntu-14-04-and-derivatives/



It seems to run, but it crashes the moment I enter any letter into the window.



How can I make this run or is there an alternative on Lubuntu with lxde?



Maybe it would suffice to start the execute-command from your menu with





Alt F1



How to install wine in ubuntu 16.04?

I'm unable to install wine in ubuntu 16.04.


sudo apt-get install wine

is giving me this error


Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

Please help soon


The following packages have unmet dependencies:
wine : Depends: wine1.6 but it is not going to be installed or
wine1.8 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

14.04 - How to upgrade to a later version of Remmina than is in Repository


What's the best-practice way to upgrade to a package that is later than the one that's in the repository?


I continue to experience this bug in Remmina on Ubuntu 14.04. An Arch user informed me that he too was experiencing this before Arch upgraded him to a later version of Remmina (than the one offered in the Ubuntu 14.04 repositories).


Brendan Hide said:



I've had this exact same bug running ArchLinux. Seems to have been
fixed in the latest version however. My pacman log shows I updated
Remmina on Thursday October 17th from v1.0.0 to v1.1.1.



I've requested, via the bug tracker, for Ubuntu to make this newer package available via the repository, but this has not been granted yet.


So, what's the best practice way to upgrade to a package that is later than the one that's in the repository?



There is a PPA for stable versions off Remmina's master branch.


Install Remmina 1.1.1 using


sudo add-apt-repository ppa:remmina-ppa-team/remmina-master
sudo apt-get update
sudo apt-get install remmina remmina-plugin-rdp

Now Ubuntu will keep installing any new versions of Remmina which are put into this repo. If you want to prevent remmina from updating, use the following command:


echo remmina hold | sudo dpkg --set-selections

unity - What are some of the issues with CCSM and why would I want to avoid it?



I've seen some people complaining about how unstable CompizConfig Settings Manager ("CCSM") is and how it can break people's desktops if they're not careful.



What are some of the known problems with CCSM? I'd like to decide whether or not it's worth the risk for me.




I am an experienced Linux user, I've contributed to kernel and work on the Canonical OEM team; I only mention these facts to show my context, which is -- the other day, I did a fresh install of 11.10 on my laptop, and wanted to customize something (turning on focus-follows-mouse). I poked around in gnome-control-center for about 30 minutes before giving up and discovering the only way to do this was using ccsm.



After installing ccsm, I configured ffm, and then -- accidentally! -- my mouse cursor passed over the preferences button and the touchpad on my laptop registered a click.



Boom!



Unity session dead.



Luckily I still had an irc window open and I could beg for help from my colleagues who told me how to recover (rm ~/.compiz-1). This is the same problem some people keep having:






I know that people are going to google for how to configure things and land up here and they're going to see lots of mentions of ccsm; or worse yet from another unreliable source. The horse is out of the barn already, and we can't go back. The determined users are going to find it anyway, and anyone that tenacious deserves to know how to get what they want (and if you break it you get to keep both pieces!)



But my point is that from now on, we can try and do better for our users.




  1. ccsm is dangerous; even if you know not to touch the bad thing, you might accidentally touch it anyway like I did.

  2. ccsm has no future; the future plans for Unity are to migrate all the useful configurability bits out of ccsm into safer, supported tools. These tools should start to appear in 12.04.


  3. the attitude of "recovering from your mistakes is a positive learning experience" is niche. Most normal people just want to use their computers without having them randomly break in mysterious, non-recoverable ways; most normal people do not share our culture of taking things apart to see how they work.



Again -- I know that people are going to find the dangerous stuff no matter what. But what we can do here is change our culture and give opinionated help, steering people away from the bad stuff and towards the good stuff.



It's easy to convey facts; it's much harder to convey wisdom.



Here, we should be aiming higher than merely giving the facts of what is possible; we should be sharing the wisdom of what is recommended.


apt - Why do apache2 upgrades remove and not re-install libapache2-mod-php5?

We repeatedly see that when an apache2 update arrives and is installed it causes the libapache2-mod-php5 package to be removed and does not subsequently re-install it automatically.


We must subsequently re-install the libapache2-mod-php5 manually in order to restore functionality to our web server.


Please see the following github gist, it is a contiguous section of our server's dpkg.log showing the November 14, 2011 update to apache2:
https://gist.github.com/1368361
it includes


2011-11-14 11:22:18 remove libapache2-mod-php5 5.3.2-1ubuntu4.10 5.3.2-1ubuntu4.10

Is this a known issue? Do other people see this too? I could not find any launchpad bug reports about it.


Platform details:



$ lsb_release -ds
Ubuntu 10.04.3 LTS
$ uname -srvm
Linux 2.6.38-12-virtual #51~lucid1-Ubuntu SMP Thu Sep 29 20:27:50 UTC 2011 x86_64
$ dpkg -l | awk '/ii.*apache/ {print $2 " " $3 }'
apache2 2.2.14-5ubuntu8.7
apache2-mpm-prefork 2.2.14-5ubuntu8.7
apache2-utils 2.2.14-5ubuntu8.7
apache2.2-bin 2.2.14-5ubuntu8.7
apache2.2-common 2.2.14-5ubuntu8.7
libapache2-mod-authnz-external 3.2.4-2+squeeze1build0.10.04.1
libapache2-mod-php5 5.3.2-1ubuntu4.10

Thanks


At a high-level the update process looks like:



package package_name do
action :upgrade
case node[:platform]
when 'centos', 'redhat', 'scientific'
options '--disableplugin=fastestmirror'
when 'ubuntu'
options '-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
end
end

But at a lower level



def install_package(name, version)
run_command_with_systems_locale(
:command => "apt-get -q -y#{expand_options(@new_resource.options)} install #{name}=#{version}",
:environment => {
"DEBIAN_FRONTEND" => "noninteractive"
}
)
end
def upgrade_package(name, version)
install_package(name, version)
end

So Chef is using "install" to do "update".


This sort of moves the question around to "how does apt-get safe-upgrade" remember to re-install libapache-mod-php5?


The exact sequence of packages that triggered this was:



apache2
apache2-mpm-prefork
apache2-mpm-worker
apache2-utils
apache2.2-bin
apache2.2-common

But the code is attempting to run checks to make sure the packages in that list are installed already before attempting to "upgrade" them.



case node[:platform]
when 'debian', 'centos', 'fedora', 'redhat', 'scientific', 'ubuntu'
# first primitive way is to define the updates in the recipe
# data bags will be used later
%w/
apache2
apache2-mpm-prefork
apache2-mpm-worker
apache2-utils
apache2.2-bin
apache2.2-common
/.each{ |package_name|
Chef::Log.debug("is #{package_name} among local packages available for changes?")
next unless node[:packages][:changes].keys.include?(package_name)
Chef::Log.debug("is #{package_name} available for upgrade?")
next unless node[:packages][:changes][package_name][:action] == 'upgrade'
package package_name do
action :upgrade
case node[:platform]
when 'centos', 'redhat', 'scientific'
options '--disableplugin=fastestmirror'
when 'ubuntu'
options '-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
end
end
tag('upgraded')
}
# after upgrading everything, run yum cache updater
if tagged?('upgraded')
# Remove old orphaned dependencies and kernel images and kernel headers etc.
# Remove cached deb files.
case node[:platform]
when 'ubuntu'
execute 'apt-get -y autoremove'
execute 'apt-get clean'
# Re-check what updates are available soon.
when 'centos', 'fedora', 'redhat', 'scientific'
node[:packages][:last_time_we_looked_at_yum] = 0
end
untag('upgraded')
end
end

But it's clear that it fails since the dpkg.log has



2011-11-14 11:22:25 install apache2-mpm-worker 2.2.14-5ubuntu8.7

on a system which does not currently have apache2-mpm-worker. I will have to discuss this with the author, thanks again.

apt - Can't install libpng-dev



I use Ubuntu 15.10 64-bit. When I run




sudo apt-get install libpng-dev


the console prints




Reading package lists... Done
Building dependency tree
Reading state information... Done

Note, selecting 'libpng12-dev' instead of 'libpng-dev'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libpng12-dev : Depends: libpng12-0 (= 1.2.51-0ubuntu3) but 1.2.51-0ubuntu3.15.10.2 is to be installed
E: Unable to correct problems, you have held broken packages.



At first I tried installing libpng-dev in the Software Center, but it crashed when it tried installing libpng-dev. Then I googled, tried




sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -f libpng-dev



but this didn't help. Maybe I should just reinstall Ubuntu? I'd have no problem with that, would just take me about an hour.




$ apt-cache policy libpng12-dev


prints




libpng12-dev:

Installed: (none)
Candidate: 1.2.51-0ubuntu3
Version table:
1.2.51-0ubuntu3 0
500 http://de.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages



$ apt-cache policy libpng12-0



prints




libpng12-0:
Installed: 1.2.51-0ubuntu3.15.10.2
Candidate: 1.2.51-0ubuntu3.15.10.2
Version table:
*** 1.2.51-0ubuntu3.15.10.2 0
100 /var/lib/dpkg/status

1.2.51-0ubuntu3 0
500 http://de.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages


You've manually installed some other build of libpng12-0 it appears. You need to sudo apt-get install --reinstall libpng12-0=1.2.51-0ubuntu3 and then you will be able to install libpng-dev.


How to boot from a usb in UEFI mode on a Dell Inspiron

I want to dual boot ubuntu 15.10 with already installed windows 10 (upgraded from 8). From what I've been researching, in order for ubtuntu to be dualbooted with windows 10 on a uefi machine, the ubuntu installation media (in this case a usb) must also be booted from uefi (as opposed to changing the boot setting to Legacy and booting from usb that way), so that the correct grub-efi, instead of grub-pc, is installed.



I have a Dell Inspiron 7000 series with core i7 processor its 64bit and also boots windows with uefi. This dell does not seem to support booting a usb from uefi as no matter what I try, "Boot from usb" will NOT appear under "UEFI boot options." The only way for me to boot from the usb is to boot in legacy mode and then select boot from usb. The problem is, when I try to install ubuntu this way, after rebooting, my system boots directly to windows 10 and the grub option does not even appear, let alone the actual bootloader screen to select which OS I want to boot. I assume my problem is that I can not install ubuntu correctly since I have to boot the usb in legacy mode when trying to install.




Also, the filesystem on the usb appears as FAT32 which should be recognizable to windows to support usb uefi booting



Does anyone know of a way I can "Boot from USB" with "UEFI boot option"?



I was following the steps on https://help.ubuntu.com/community/UEFI but under General Principles, number 5, I can not do this with my system. Can anyone help me with a workaround or anything?

Saturday, April 23, 2016

software installation - Package missing when I run `sudo apt install ...`

I use Ubuntu 16.04. APT cannot seem to find the package m4:


root@kevin:/# sudo apt install m4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package m4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'm4' has no installation candidate

I ran:


sudo apt-get upgrade && apt-get update

This didn't make any difference.


root@kevin:/# grep main /etc/apt/sources.list
# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## extensively as that contained in the main release, although it includes
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted

16.04 - How to secure phpmyadmin



OK, so I have several sites on a vps with ssl certificates. I have mod security setup as well as tripwire. My question then relates to phpmyadmin security. If my IP is 123.123.123.123 I can access phpmyadmin using 123.123.123.123/mypmyadmin-IHaveChangedThisURL.




And even though I changed the phpmyadmin url, phpmyadmin is still accessible if you can find the url.



I have added a blank html file to the root directory and so no directory index is given using the vps hostname or vps IP.



Is there anything else I can do to protect the IP use and attempts to get to phpmyadmin etc?



Any guidance appreciated. Thanks.



Several things could be done. I will explain my ideas and the way how they could be implemented within Apache2.







1. Use HTTPS connection to protect your data from sniffing




  • First enable SSL module if it is not enabled: sudo a2enmod ssl.


  • Оpen port 443 (HTTPS) into the firewall. You should use your custom port here.


  • Follow this manual and enable a free certificate from Let's Encrypt.


  • Check this answer and disable Weak Ciphers.


  • Then you can force all users to use HTTPS.








2. Change the URI of PhpMyAdmin



To change the URI, within the default configuration, you should edit /etc/phpmyadmin/apache.conf and change the first part (/phpmyadmin) of this directive:



Alias /phpmyadmin /usr/share/phpmyadmin



Restart Apache and you will be able to access PhpMyAdmin through the new URI.






3. Run PhpMyAdmin on different port



Here is a step-by-step manual: How to run PhpMyAdmin on different port. Don't forget to open this port into the Firewall.







4. Access PhpMyAdmin only locally through SSH tunnel



Run PhpMyAdmin on different port. Let's assume it is port 99. Close this port into the Firewall. Then establish SSH connection by a command similar as:





ssh -fTN -R 99:localhost:99 @or




  • This command will create ssh tunnel, where the remote -R port 99 is forwarded to the local port 99 on the localhost (127.0.0.1).

  • The options -fTN will push the connection in to the background.



Then PhpMyAdmin should be accessible via the web browser of your local machine on the URL http://localhost:99/. More ideas could be find here:









5. Protect PhpMyAdmin URI path via Password authentication



More details could be found in this Apache's manual: Authentication and Authorization. The package apache2-utils must be installed. In short the steps are:




  • Create folder outside of /var/www, where the password file will be kept. Then generate password file. Let's assume the name of this new folder is /var/www-auth:



    $ sudo mkdir /var/www-auth
    $ cd /var/www-auth

    $ sudo htpasswd -c .htpasswd.phpmyadmin
    New Password: *********
    Re-Type New Password: *********
    Adding Password For User



    • .htpasswd.phpmyadmin is the name of the file in which the password will be stored.

    • user is the login name that will be used.

    • ********* is the password :)


    • -c means create new file. If this option is omitted htpasswd command will try to add the new login name to an existing .htpasswd.file.


  • Modify PhpMyAdmin authentication type, through edit /etc/phpmyadmin/apache.conf in this way (or create .htaccess file):




    .....


    AuthType Basic
    AuthName "The name of the authentication form - type some user and password hints"

    AuthUserFile /var/www-auth/.htpasswd.phpmyadmin

    Require valid-user

    .....


  • Enable the modules and restart Apache2 to apply the new configuration:



    sudo a2enmod authz_core authz_user authn_file

    sudo systemctl restart apache2.service

  • Now to access PhpMyAdmin's URI you must provide the login name user and its password.







6. Protect PhpMyAdmin URI path via Two Factor Authentication (2FA):





  • Follow steps 1 and 3 from this manual to generate .google_authenticator file, located in your $HOME directory. In step 4 is described how to generate authentication codes.


  • Create a new directory under /var/www-auth. Let's assume the name of this new folder is google_authenticator:



    sudo mkdir -p /var/www-auth/google_authenticator

  • Copy the file $HOME/.google_authenticator into that directory and change its permissions (it must be readable for www-data):



    sudo cp $HOME/.google_authenticator /var/www-auth/google_authenticator/user
    sudo chown www-data:www-data /var/www-auth/google_authenticator/user



    Please note that the file name determines the login name! The file name will be used as username while logging-in to your secure website.


  • Modify the new file by adding the directive " PASSWORD=qwerty, where qwerty is the new login password.




    E3CY3TNSNBXXXXXX
    " RESETTING_TIME_SKEW ...
    " RATE_LIMIT 3 30 ...
    " WINDOW_SIZE 17
    " DISALLOW_REUSE 48885555 ...

    " TOTP_AUTH
    " PASSWORD=qwerty
    4567...

  • Install mod_authn_google for Apache2. Unfortunately I this module is unavailable within Ubuntu's repository, but we can get it from this repository. The steps are: (1) go to your Downloads, (2) download the package dba-apa24-mod_authn_google-r22... .rpm, (3) extract mod_authn_google.so, (4) place the file in /usr/lib/apache2/modules/, (5) grant appropriate permissions, (6) Create module load file:



    cd $HOME/Downloads
    wget http://download.opensuse.org/repositories/home:/csbuild:/DBA/RedHat_RHEL-7/x86_64/dba-apa24-mod_authn_google-r22-1.1.x86_64.rpm

    rpm2cpio dba-apa24-mod_authn_google-r22-1.1.x86_64.rpm | cpio -iv --to-stdout ./DBA/apache24/WWW/2.4.x/modules/mod_authn_google-r22.so > mod_authn_google.so


    sudo mv mod_authn_google.so /usr/lib/apache2/modules/
    sudo chown root:root /usr/lib/apache2/modules/mod_authn_google.so
    sudo chmod g-w /usr/lib/apache2/modules/mod_authn_google.so

    echo "LoadModule authn_google_module /usr/lib/apache2/modules/mod_authn_google.so" | sudo tee /etc/apache2/mods-available/authn_google.load

    sudo a2enmod authn_google

  • Modify PhpMyAdmin authentication type, through edit /etc/phpmyadmin/apache.conf in this way (or create .htaccess file):





    .....


    AuthType Basic
    AuthName "The name of the authentication form - type some user and password hints"
    AuthBasicProvider "google_authenticator"
    GoogleAuthUserPath /var/www-auth/google_authenticator
    GoogleAuthCookieLife 3600

    GoogleAuthEntryWindow 2

    Require valid-user

    .....


  • Enable the modules and restart Apache2 to apply the new configuration:



    sudo a2enmod authz_core authz_user authn_google

    sudo systemctl restart apache2.service

  • Now to access PhpMyAdmin's URI you must provide the login name user, its password and 6 digit token code:



    enter image description here







7. Use ModSecurity for Apache




With ModSecurity you can add more flexible restrictions to the PhpMyAdmin's URI.
In this answer, under the section "ModSecurity Rules > SAS > Iptables", I've described in short how we can create custom rules for ModSecurity.


11.10 - Can&#39;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 (...