Need a shell script to find the latest file from a directory and move it to another on a weekly basis I am new to shell scripting and I need some help with it. I have a requirement to move the latest expdp dump file from one directory to another where it will be maintained for 90 days and then deleted. This job should run once a week.

Create a script with something like this;

#!/bin/sh
mv "$(ls -t <name of your file> | head -1)" /directory/it/has/to/go
find /directory/it/has/to/go -type f -mtime 90 -exec rm {} +

Now we have to create a cronjob so this script runs every week.

$: crontab -e

Add this line:

0 0 * * 0 yourscript.sh >/dev/null 2>&1

You could use something like this (I have no idea if this is the best way to do it as I just put something together and it's working).

#!/bin/bash
cd /source/directory/
cp `ls -1t | head -1` /destination/directory/


groups: cannot find name for group ID 125 I've recently uninstalled virtualbox and since then, everytime I open a terminal I get the following:

  groups: cannot find name for group ID 125

The output of /etc/group is here:

  http://pastebin.com/gysgpHra

I didn't want to paste the full output here, it's a bit long.

Strangely enough, there is no group 125 but as far as I remember that was assigned to the vboxusers group.

Google has not been helpful at all.

I see a similar question here:

  https://askubuntu.com/questions/131651/cannot-find-name-for-group-id-127

But I don't know what he's talking about here:

  But I've found it in the group- list

  Entry
  vboxusers:x:127:peter

Can anyone point me the right direction?

You could use sudo delgroup vboxusers to completely remove that group, if the uninstallation of Virtualbox failed to do that. Then enter id in the terminal and your uid, gid, and the groups you belong to will be listed, and vboxusers shouldn't be there.

If this does not work you could simply reinstall Virtualbox with sudo apt-get install --reinstall <virtualbox pkg names> and then you might be able to remove the package cleanly with sudo apt-get purge <virtualbox version> (which would remove any configuration files) and then you could use sudo apt-get autoremove to remove any other files left by Virtualbox. Then you could try my first suggestion again.

Lastly, if these options are unsuccessful, but installing Virtualbox does show that group 125 is virtualbox, you could remove the Virtualbox users group (as detailed in my first suggestion with sudo delgroup vboxusers), before you uninstall Virtualbox. This may work as Virtualbox doesn't seem to be uninstalling correctly and seems to be leaving a partial group that can't easily be removed after uninstallation as it doesn't show up in /etc/group.

It also should be said that you need to logout and login again for any changes to users and groups to take effect.

Check /etc/nscd.conf make sure that the following line is there:

 enable-cache            group           yes


How to open file with default application from command line? In Nautilus, when you double click a file, it will open it with the default application associated with the file's extension. For instance, .html files will open in a web browser and .pdf will be opened with Document Viewer. Is there a way to reproduce the same behavior from within the command line (i.e. open path/filename)? I'm asking because I like to browse my file-system from the command line but sometimes don't remember which app. opens what.

I think xdg-open is the command you are looking for.

NAME
       xdg-open - opens a file or URL in the user's preferred application

SYNOPSIS
       xdg-open {file | URL}

       xdg-open {--help | --manual | --version}

DESCRIPTION
       xdg-open opens a file or URL in the user's preferred application. If a
       URL is provided the URL will be opened in the user's preferred web
       browser. If a file is provided the file will be opened in the preferred
       application for files of that type. xdg-open supports file, ftp, http
       and https URLs.

eg: xdg-open index.php

This will open index.php in gedit(if you are using gnome).

If you want to open a url in browser

xdg-open http://google.com

this will open google.com in your default browser.

xdg-open is a wrapper script - it will use the desktop environment's tool (gio open, gvfs-open, kde-open, gnome-open, dde-open, exo-open, and a host of other such tools). It is also installed by default, and very likely to work on past, current and future versions (on the other hand, gvfs-open and gnome-open have been deprecated, and may be unavailable in future releases).

If you want to:

make an alias for this command (e.g. open)
hide output from the command
continue using this terminal after

You can use this .bashrc function:

function open () {
  xdg-open "$@">/dev/null 2>&1
}


Create fillable or editable fields in a PDF I wonder how to create fillable forms in a PDF, such as this one. I would like to fill out the places that are required to fill out.

I believe OpenOffice Writer can create fillable PDFs, though it may be lacking some features that you may be looking for such as emailing the output.

The basics are:

Create a new OO Writer document
Enable the Forms toolbar: View → Toolbars → Form Controls
Create your form
Export as a PDF

Here's a detailed tutorial:

http://openoffice.blogs.com/forms_fromscratch.pdf

In order to add form fields to an existing PDF, you can install the pdf importer extension for OO writer:

sudo apt-get install libreoffice-pdfimport

I just tested that and it works fine with LibreOffice 3.

PDF Studio 9 has an interactive form designer to add text fields, check boxes, radio buttons, list or signature fields to PDF documents. JavaScript formatting and calculations are supported.

If you are only interested in filling data into existing interactive forms, our software PDF Studio can also do that and save the forms. It supports acroforms and static xfa forms.

http://www.qoppa.com/pdfstudio/


How do I rename a USB drive? How exactly would I rename a USB drive?

I've read that you can go into the Disk Utility, click on Edit Partition, and there is an option to rename the label but I can't click in the area to rename.

Is there any other way?

Open "Disks" application
Select the flash drive in the panel on the left
Press the Unmount button (should look like a "stop button")
Click on the gears icon ("More actions") and choose "Edit filesystem"

Simpler:

Insert USB into a Mac or Windows PC

Right click on the device in Finder or Explorer > Rename

or

In macOS Finder > command click on USB name > it is selected > type new name

or

In macOS Finder > select USB > hit Enter > name is selected > type new name


How to change visudo editor from nano to vim? When I use visudo, it always opens it with nano editor. How to change the editor to vim?

Type sudo update-alternatives --config editor

You will get a text like below.

There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
  3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    10        manual mode

Press enter to keep the current choice[*], or type selection number: 3

Find vim.basic or vim.tiny selection number. Type it and press enter. Next time when you open visudo your editor will be vim

If you want just to make your user use by default a different editor, add

export EDITOR=vim;

in your .profile (or wherever you keep your startup environment if using a shell different from bash). Log out, log in, check that the variable is set:

[romano:~] % env | grep EDI
EDITOR=vim

and now all the programs that call an editor (and are well written) will default to vim for your user.

As noticed by @EliahKagan (thanks!) in the comment, this will not work for visudo: since you are supposed to call it using sudo, when you do

sudo visudo

the sudo command will sanitize (read: delete) most environment variables before rising privileges --- and it's a good thing it does. So the change will not percolate to visudo. To still have it working, you have to call it like:

sudo EDITOR=vim visudo

Finally, as hinted here, you can also add a line to your /etc/sudoers file near the top that reads:

Defaults editor=/usr/bin/vim

A word of warning: when modifying your sudoers configuration, keep a terminal open with a root shell in it (with sudo -i). You never know, and you can easily get locked out of root.


Error installing Ubuntu Server 16.04 on VMWare I'm trying to install Ubuntu Server 16.04 LTS on VMware Workstation 11 but facing an error :

Network boot from Intel E1000
Copyright (C) 2003-2014 VMware, Inc
Copyright (C) 1997-2000 Intel Corporation

....
PXE-E53: No boot filename received

PXE-MOF: Exiting Intel PXE ROM
Operating System not found

How can I fix this ?

Your Virtual Machine is trying to boot from PXE (this is a network boot protocol). Unless you have a network boot server on your local LAN, it will not work.

You need to configure VMWare to boot from removable media, and "insert" the Ubuntu image (.iso) in a virtual drive.

Go to the VM Settings > Hardware and, if not present, add a CD/DVD drive. Then connect the Ubuntu ISO to it and boot your Virtual Machine again.

Link to VMWare WS 11 documentation for adding CD drives.


How to disable mouse acceleration on Kubuntu 18.04 I just installed Kubuntu 18.04 and i tried to disable mouse acceleration. I had a script file that i was usually using with the following commands but it doesnt work anymore :

xinput set-prop 8 "Device Accel Profile" -1
xinput set-prop 8 "Device Accel Constant Deceleration" 4

The output of xinput is:

Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Razer Razer Abyssus                       id=8    [slave  pointer  (2)]
⎜   ↳ Gaming KB  Gaming KB                      id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Gaming KB  Gaming KB                      id=9    [slave  keyboard (3)]
    ↳ Gaming KB  Gaming KB                      id=11   [slave  keyboard (3)]

and xinput -list-props

Device 'Razer Razer Abyssus':
        Device Enabled (139):   1
        Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        libinput Natural Scrolling Enabled (274):       0
        libinput Natural Scrolling Enabled Default (275):       0
        libinput Scroll Methods Available (276):        0, 0, 1
        libinput Scroll Method Enabled (277):   0, 0, 0
        libinput Scroll Method Enabled Default (278):   0, 0, 0
        libinput Button Scrolling Button (279): 2
        libinput Button Scrolling Button Default (280): 2
        libinput Middle Emulation Enabled (281):        0
        libinput Middle Emulation Enabled Default (282):        0
        libinput Accel Speed (283):     0.000000
        libinput Accel Speed Default (284):     0.000000
        libinput Accel Profiles Available (285):        1, 1
        libinput Accel Profile Enabled (286):   1, 0
        libinput Accel Profile Enabled Default (287):   1, 0
        libinput Left Handed Enabled (288):     0
        libinput Left Handed Enabled Default (289):     0
        libinput Send Events Modes Available (259):     1, 0
        libinput Send Events Mode Enabled (260):        0, 0
        libinput Send Events Mode Enabled Default (261):        0, 0
        Device Node (262):      "/dev/input/event2"
        Device Product ID (263):        5426, 66
        libinput Drag Lock Buttons (290):       <no items>
        libinput Horizontal Scroll Enabled (291):

I tried changing Accel Profile Enabled but it doesnt work (unless i'm doing something wrong).

any ideas?

This worked for me on Ubuntu.
You have to change Accel Speed.

xinput set-prop <mouse_id> <accel_speed_id> <number>

So in your case:

xinput set-prop 8 283 -0.5

note: i used -0.5 as an example, use what ever value you want.
This will last till the next reboot or logout.
If you want it permanent use a X11 conf file (/usr/share/X11/xorg.conf.d), there are some tutorials online, but i had no luck getting it to work.
An alternative is creating a startup script that would execute the command for you.

I haven't figured out how to disable mouse accel. yet, and I'm quite sure Jubast's way isn't the best one. If it was, 0.0 should give a 1:1 ratio, but it doesn't. xset m 0 0 is also useless (and ffs, why tf is it still so hard to do stuff like this on Linux? Jesus).
Regarding storing the settings, you can make the configuration permanent by writing it to the ~/.config/kcminputrc file. Here's mine

[Keyboard]
KeyboardRepeating=0
NumLock=0
RepeatDelay=200
RepeatRate=25

[Mouse]
XLbInptAccelProfileFlat=true
XLbInptNaturalScroll=false
XLbInptPointerAcceleration=-0.75
cursorTheme=breeze_cursors


Ubuntu 17.04 Nvidia 384 and Kernel Update I recently got an Nvidia card, after long debating I convinced myself that I earned a little gaming - tho I only used the machine for webdev. so far I have no experience with gcards and ubuntu.

I installed the driver, or at least I tried. I got some problem with the nouveau kernel - so whatever stumbled upon this thread

How to disable Nouveau kernel driver

Did whats posted on the accepted answer and now the pc won´t start.

I got 2 Kernels in the Advanced Menu (4.10.0-35 and 4.10.0-37) but in the root bash I also do not get any eth device to work, so no way of sudo apt-get update / upgrade.

Tomorrow I can get an USB Stick with 17.04 Live on it, any quick way to fix that with the Live Image? Recovery? Will it keep my files - I got an Backup, but not from my databases. So it would be nice to fix it.

Is there a log where I can figure out where the problem is?

Had the same issue.
There is a way to boot with Ubuntu "live CD" or "Live USB stick",
then select "Try Ubuntu".
When in, you can mount your "broken" system in terminal with:

sudo mount /dev/sda2 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

now you can delete all the nvidia stuff and revert the blacklisting....


How to fix ubuntu load screen after install nvidia driver (331,38) I installed nvidia proprietary driver (331.38 on ubuntu 14.04 by sudo apt-get install nvidia-331) and now the Ubuntu load screen is with a bad resolution (640x480). I followed some recommendations from previous questions but I can not increase the resolution. I would like to return to 1920x1080 resolution.

I had this problem a few days ago, removing the xorg.conf created by Nvidia seems to fix the problem. Execute the commands below after pressing CTRL+ALT+F1 on GDM screen or within GNOME.

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old
sudo touch /etc/X11/xorg.conf

When I did that on my xps 15 (optimus gt 540) the screen was blank,
So I removed the drivers (sudo apt-get remove --purge nvidia-*) and
then reinstalled ubuntu-desktop, then the resolution was fine.


How to run  Samsung Android Kies software on Wine ? I've a Samsung Galaxy mini with Android 2.2. Kies, the software provided by Samsung to manage my phone, doesn't run on linux,. I've tried to run it on wine, but it doesn't work at all.

Is there any way i can get this running on wine?

Yeah it's a major pain in the arse (speaking as somebody who has tried everything). Wine doesn't work reliably with things that need hardware connections. If you're trying to upgrade your phone's firmware, it's just plain not worth the risk.

VirtualBox (with Windows installed within, and the USB plugin installed) would normally be a viable option but for some reason VBox really hates my Galaxy S2. If you can get this to work, that's great.

For upgrading firmware I turned to Heimdall. This is essentially an open source replacement for Samsung's Odin tool (that isn't officially available to the public). I had success with this but I'm not sure it supports your phone.

Failing that, borrow a friends Windows laptop and install Keis. I tried this after VirtualBox failed but Samsung's 64bit drivers are awful. Plain wouldn't work. I think they've updated them since but it was too late for me. If you have easy access to a proper install of Windows you should probably try this first.

It works fine for my Galaxy S2 through Chrome OS. It did not work at all through Firefox, sadly. Install Chrome OS and you'll be fine!


After upgrading to 13.10, no applications are visible in the application lens I upgraded from 13.04 to 13.10 and now all icons in the application lens are gone.

This is what I tried so far:

apt-get install --reinstall unity-lens-applications
unity --replace and unity --reset-icons
moving ~/.config to ~/.config2
deleting ~/.cache/software-center and ~/.cache/unity

Most of these things have been suggested in this question: Unity Applications lens is empty - but all to no avail.

I think this is likely because the unity-scope-home package is not installed.

Try using Software Center to find and install that package, log out and back in to restart Unity, and see if that resolves the problem.

I think I may have had a similar problem, not sure it was due to upgrading to 13.10 or due to user error. I ended up fixing it as follows:

Log out of unity and log in to tty1 (ctrl-alt-f1).
"sudo apt-get purge unity" (gets rid of unity and it's settings).
"sudo apt-get autoremove" (gets rid of any leftover packages that unity depended on, like the lenses and such.)
"sudo reboot" and log into tty1 again afterwards.
"sudo apt-get install unity"

Bit drastic, but it worked.


How to get rid of Windows I think the answer must be very simple, but I still don't know it.
I have installed Ubuntu 12.10 in my Windows 7 laptop.
After installing Ubuntu and started using it I decided to restart my laptop. But when I turned it on again,it still asks me if I want to use Windows 7 or Ubuntu.
How can I get rid of Windows 7 so as to start directly from Ubuntu the next time I turn my computer on?
Thanks!

How to Install Ubuntu Only

Back up everything you want to keep from Windows and Ubuntu on an external drive.
Insert the Ubuntu Live CD into your computer.
Boot your computer from the Ubuntu Live CD. You may need to look up details on how to change your computer's boot order; this will depend on the exact model of computer you have. Ensure that it's set to boot from CD first.
Follow the steps of the Ubuntu installation process. The Live CD should make this easy.
Copy everything you want to use from your external drive back onto your Ubuntu installation.

I recommend that you keep both systems available instead of removing Windows altogether. If you want to do that instead, here are the steps involved:

How to Install Ubuntu And Keep Windows out of the Way

Back up everything you want to keep from Windows and Ubuntu on an external drive.
Shrink your Windows partition using the Disk Management utility in the Control Panel. Just right click on your drive and find "Shrink Volume...".
Insert the Ubuntu Live CD into your computer.
Boot your computer from the Ubuntu Live CD. You may need to look up details on how to change your computer's boot order; this will depend on the exact model of computer you have. Ensure that it's set to boot from CD first.
Follow the steps of the Ubuntu installation process, except tell Ubuntu to use the unallocated partition rather than the whole disk.
Copy everything you want to use from your external drive back onto your Ubuntu installation.
Edit the file /etc/default/grub as the root user, and change #GRUB_HIDDEN_TIMEOUT=0 to GRUB_HIDDEN_TIMEOUT=0. (see How to make grub stop appearing every time I boot?)
Change the GRUB boot order, setting Ubuntu as the first option; see How do I change the GRUB boot order? but remember you want Ubuntu first, not Windows like the asker requested.
Open a terminal and run the command sudo update-grub.

Additional Notes

I previously had difficulty installing Ubuntu in the above manner on drives set up with RAID 0. It may be possible to do so, but I had to remove Windows and disable RAID. If you have similar trouble, look at the following links for assistance.

https://help.ubuntu.com/community/FakeRaidHowto
https://help.ubuntu.com/community/Installation/SoftwareRAID
https://wiki.ubuntu.com/Raid

You can format the windows partition and edit your grub to delete the windows startup lines. Try to find a grub editing tool on the Ubuntu Software Center :) See it's easy :)


Bluetooth settings shows the error "No bluetooth adaptor found" I'm gettng a "No bluetooth adaptor" found message under blutooth settings when i have an adaptor and it's on.

Why?

I have a sony vaio cr343nb.

I found  the answer, well not exactly but it worked.I had to enable the bluetooth that i had disabled on my windows partition and then boot from my Ubuntu pen drive and it recognized the bluetooth device and worked perfectly. thanks

The Linux kernel was not made to work with proprietary drivers, so it's possible that if you're computer was manufactured with windows/mac in mind, there will be components that don't work. For instance, my dvd drive won't eject unless I push the button.Ubuntu has a compatibility site here:     http://www.ubuntu.com/certification/
Check to see if you're computer is "Ubuntu certified", otherwise there's no gurantees. And even then...


Reattaching to an existing screen session I have a program running under screen. In fact, when I detach from the session and check netstat, I can see the program is still running (which is what I want):

udp        0      0 127.0.0.1:1720          0.0.0.0:*                           3759/ruby

Now I want to reattach to the session running that process. So I start up a new terminal, and type screen -r

$ screen -r
There are several suitable screens on:
    5169.pts-2.teamviggy    (05/31/2013 09:30:28 PM)    (Detached)
    4872.pts-2.teamviggy    (05/31/2013 09:25:30 PM)    (Detached)
    4572.pts-2.teamviggy    (05/31/2013 09:07:17 PM)    (Detached)
    4073.pts-2.teamviggy    (05/31/2013 08:50:54 PM)    (Detached)
    3600.pts-2.teamviggy    (05/31/2013 08:40:14 PM)    (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

But how do I know which one is the session running that process I created?

Now one of the documents I came across said:

"When you're using a window, type C-a A to give it a name. This name will be used in the window listing, and will help you remember what you're doing in each window when you start using a lot of windows."

The thing is when I am in a new screen session, I try to press control+a A and nothing happens.

There are two levels of "listings" involved here. First, you have the "window listing" within an individual session, which is what ctrl-A A is for, and second there is a "session listing" which is what you have pasted in your question and what can also be viewed with screen -ls.

You can customize the session names with the -S parameter, otherwise it uses your hostname (teamviggy), for example:

$ screen

(ctrl-A d to detach)

$ screen -S myprogramrunningunderscreen

(ctrl-A d to detach)

$ screen -ls

There are screens on:
    4964.myprogramrunningunderscreen    (05/31/2013 09:42:29 PM)    (Detached)
    4874.pts-1.creeper  (05/31/2013 09:39:12 PM)    (Detached)
2 Sockets in /var/run/screen/S-paul.

As a bonus, you can use an unambiguous abbreviation of the name you pass to -S later to reconnect:

screen -r myprog

(I am reconnected to the myprogramrunningunderscreen session)

The output of screen -list is formatted like pid.tty.host. The pids can be used to get the first child process with pstree:

screen -list|cut -f1 -d'.'|cut -f2|xargs -n 1 pstree -p|grep "^screen"

You will get a list like this

screen(5169)---zsh(5170)---less(15268)
screen(4872)---zsh(4873)-+-cat(11364)
...


How to search for strings inside files in a folder? Is there any utility to make searches for a string inside ASCII files to avoid command line searches?

How to make a command line search, for example for the string "test" inside all files in the directory /var/x/?

I assume that your first question is about a GUI alternative to the grep command. I can't help you with that, I always find the command line very effective.

As for the command line, try

grep "test" /var/x/*

If you want to search recursively (i.e. not only in /var/x/, but also in subdirectories thereof), do

grep -R "test" /var/x/

To avoid grepping the files which grep thinks to be binary, use the -I option:

grep -I "test" /var/x/

If grep thinks a file is binary (based on first few bytes of the file), it will assume it does not match instead of going through the whole file.

You can use Sublime Text Find in Files option from Find menu to search for strings inside files from a folder.

To Install Sublime Text 3

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

You can also follow this question for other possible ways of installing Sublime on Ubuntu.

To search in all files for a string from a folder in Sublime Text you can follow this question for more clear answers.


Ubuntu 20.04 access to NAS files After upgrade to 20.04 Files (and Krusader!) can find the volumes on local NAS, but individual files and folders are returned as "No such file or folder; has it been deleted?".
Taking note of previous related posts I have tried:
sudo gedit /etc/samba/smb.conf

add:
workgroup = WORKGROUP
client min protocol = NT1
server max protocol = NT1
client min protocol = CORE

Not sure what else to try. The 18.04 box still works perfectly and I can't work out if it is a Nautilus, Gnome, Samba, or (unlikely) a kernel thing.
Stumped! Can anyone help?

file-as-folder is fixed via https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1872476

It's fixed in the package https://launchpad.net/ubuntu/+source/samba/2:4.11.6+dfsg-0ubuntu1.2 which is currently sitting in focal-proposed, and will be in updates shortly.

I make a copy of the file smb.conf
cd /etc/samba
sudo cp smb.conf smb.conf.old

then I changed the original file
sudo gedit smb.conf

In global section under work group I add a new line
#This new line is to obtain access to my DNS-320l
client min protocol = NT1

I save the file and finally re-start my computer and everything worked, I can access my files. Of course I put my credentials, user and password of my DNS, I hope this could be useful for someone else.


I want to setup Active directory in Ubuntu server for mix environmet (Windows/linux) to authenticate I want to migrate my all windows Server and workstation to linux system (Ubuntu server 12.04). I am new to Linux.

I want to create Active directory for my Linux (Ubuntu) as well as Windows Workstations to work parallel (Some system will have Ubuntu workstation and some Windows 7).

Now i need assistance to which application would help me to achieve this and what would be the perquisite. Needed best procedure to install and maintain the Ubuntu server.

I hope you understand my requirement.

Thanks & Regards,

Sam

Here are some resources I have found that may be of help to you. According to these, there are several different options but most of them center around the use of Samba4 with OpenLDAP.

http://linuxdrops.com/install-samba-4-on-centos-rhel-fedora-debian-ubuntu/

http://www.ittables.com/2013/06/samba-4-active-directory-configuration.html


Chrome or chromium window doesn't appear after opening I'm new to ubuntu and I'm getting very frustrated so far. I'm trying to get chrome to work properly, as I have a chromecast I would like to use, as well as all the extensions I have on chrome.

I've tried to install it any way possible and tried to install chromium as well. Every time I install it, it shows that it's opened but I cannot see the window. I've tried reinstalling chrome, chromium and ubuntu several times without any luck.

I haven't found a solution online and if I can't find one soon, I'll probably just go back to windows.

I'm running ubuntu 17.04

what I've tried so far?

google-chrome

shows no output but puts an icon in the launcher, but chrome window doesn't appear. same is with chromium

I think it may be a permissions issue. Nothing is being written to .config folder. Checked hidden files and no folders for chrome or chromium. Any ideas on what is causing this?

Let try this..
Go to system setting -> Select display setting
Check whether how many displays are enabled. If enabled more than one
then turn off the unused display or enable mirror option.
This can solve your issue.

First get a terminal and type
sudo install gdebi
Enter your password and type "y" when prompted
Run Firefox and google "chrome"
Save "deb 64"
Open using gdebi
It will work perfectly


How can I open a folder in a new window? It appears that Nautilus no longer provides an Open in New Window option in its right-click context menus:

What procedure should I now use instead when I want to open a folder in a new window?

Hold Shift while double-clicking it.

I discovered that through trial and error. The documentation of keyboard shortcuts for Files is frustratingly sparse.

What I did is:

Edit -> Preferences -> Behavior -> Open each folder its own window /UNCHECK/

It was unchecked already, and must be so by default, so I checked, closed, tried the behavior which did open new window but in initial manner.

Then I returned to the Preferences and unchecked, tried it and voila!

Good luck!


What do I get rid of to install Ubuntu when I have 4 primary partitions? I am very new to Ubuntu and Linux in general, so any advice is appreciated. I am following the "Dual-Boot Windows 7 and Ubuntu in Perfect Harmony" tutorial on Lifehacker to do exactly that. This is the link. I am at the step of partitioning my system, I already have windows installed but i am in the Ubuntu Live. When i go into the GParted Partition Editor and try and select "new" I get this message:

  It is not possible to create more than 4 primary partitions.

  If you want more partitions you should first create an extended
  partition. Such a partition can contain other partitions. Because an
  extended partition is also a primary partition it might be necessary
  to remove a primary partition first

Thats all!

Wow! Ubuntu's community is amazing, i was expecting at least a day wait for an answer. Anyways, here is the picture:

Also, i forgot to tell you, but i am on a laptop for this project, if that changes anything.

thanks for all of you help so far!

Disclaimer: always take a current backup of your hard disk prior to playing around with partitions.

  Note1: GParted "records" the actions that we're doing, so it's not actually creating or deleting any partitions until we hit Apply. So, if you mess up before applying, just undo or close and reopen GParted.

  Note2: your screenshot shows a low battery. Ensure that your laptop is plugged into a power source and charging.

Copy all the contents of the Data partition to your C drive, or to an external storage device, because we're going to delete it. You can do this normally in Windows, or you can do this in Live Ubuntu. In Live Ubuntu, if you move your mouse to the bottom of the Launcher on the left, you'll find a couple of hard disk icons. Clicking them will mount and open up the partitions.
In Live Ubuntu, open up GParted. Right click and "Unmount" the partitions if you opened them up (if you followed the previous step).
Right click on sda4 > Delete.
Right click on the now large unallocated > New:

Create as: Extended Partition
Click Add.

Right click on the new unallocated (which is nested under "New Partition") > New:

Create as: Logical Partition (you shouldn't be able to change it anyways.)
File system: ntfs
Label: Data
Free space preceding: 0
New size: 181524

This is 177 GB. You can of course, change it to however big you want your new Data partition to be.

When you click away, the Free space following should fill up automatically.
Click Add.

It should now look like this:

sda1
sda2
sda3
New Partition
      New Partition (Data)       177.27 GB
      unallocated                119 GB

Take a look at your partitions. Cross your fingers. Pray. Take another look. If you're satisfied, click the green check mark in GParted to apply. This shouldn't take too long, maybe 10 minutes maximum...probably take a few seconds =/.
At this point, you can boot back into Windows and copy back your Data stuff, or continue with installing Ubuntu since you're already in Live Ubuntu.

Now, you have an unallocated space that can be used to create new partitions and install Ubuntu.

There are several ways from here to install Ubuntu. I would highly advise this:

Click on the Install Ubuntu to Hard Disk icon in the Launcher on the left (second icon from top).
When presented with options, choose Install Ubuntu alongside Windows 7. This will basically take care of everything. It will detect the free, unallocated space, and install itself there, along with creating an essential partition called swap. It will not touch your other Windows partitions. The only thing that can go wrong here is bootloader stuff, where you might not get a screen to "choose" which OS, and it just boots into Ubuntu or Windows. This can be fixed using Boot-Repair, but I doubt that it'll get to this point.
When it's done, reboot your computer (and don't forget to remove your USB/CD so that you don't boot into Live Ubuntu), and you should be presented with options to choose your OS. At this point, I like to first boot into Windows to make sure that it boots successfully. When it does, shutdown and boot into Ubuntu...and enjoy.

The ubuntu dualboot will detect the unallocated space and install ubuntu on that part.

If you are using windows 7 there is a partition tool (search for it in the startbutton meny) where you can handle your partitions and resize them.


Ubuntu 16.04 cannot locate Skype after enabling Canonical Partners in Software & Update I am experiencing this problem for the first time with Ubuntu 16.04, after a fresh installation.

Skype cannot be located after enabling Canonical Partners both in Software & Update, or by command line with the command:

sudo add-apt-repository "deb http://archive.canonical.com/   $(lsb_release -sc) partner"

Then running the following:

sudo apt-get update
sudo apt-get install skype

However, I still get:

  E: Unable to locate package skype

Any clue?

UPDATE

I run "sudo apt-get update --fix-missing" before trying to install skype, and this is the output I get:

Hit:1 http://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease
Hit:2 http://archive.canonical.com/ubuntu xenial InRelease
Hit:3 http://id.archive.ubuntu.com/ubuntu xenial InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:5 http://id.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:6 http://id.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 3s (79.5 kB/s)
Reading package lists... Done

I try "sudo apt-get install skype" again, and I obtain:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package skype

The legacy Skype for Linux application was discontinued and removed from Canonical's partner repositories. You can install the new Skype for Linux application instead.

DaniCee!

I think I have a solution for your problem. Of course, there's the terminal way which hasn't worked for you, but I'll put here for redundancy's sake.

sudo add-apt-repository "deb http://archive.canonical.com/    $(lsb_release -sc) partner"
sudo apt-get update
sudo apt-get install skype

Now that we've covered option 1, your second option is to simply search in  Synaptic. Make sure it's "skype" with a lowercase s, and not "Skype" with an uppercase S. I was able to find it in Synaptic, but that may be because I have Skype installed already.

Finally, you can simply to this website https://www.skype.com/en/download-skype/skype-for-linux/ and click the download .deb option and voila! skype.deb is now available to download manually (is that considered manual?). Hope this helps out!


How can I enable screenlock without turning off the monitor? (Ubuntu Gnome 14.04) Ubuntu Gnome 14.04

When locking the screen, my monitor/screen turns off immediately.

I don't want that to happen immediately, more like after 30 minutes or so. Is that possible?

This is not possible anymore in Gnome 3. You would have to execute gsettings set org.gnome.settings-daemon.plugins.power idle-dim-time [seconds] (possibly as lightdm as this is the user who runs the lockscreen) however this key doesn't exist anymore.

A possible workaround Khurshid mentioned is to install XScreenSaver (and set the timeout from there):

How can I change or install screensavers?

I have a fresh installation of Ubuntu GNOME 14.04 on a new machine I got, and I have set the power to dim after "inactive for 30 minutes"

When I lock the screen it does not turn off for 30 min. However, if you don't manually lock the screen, it will turn off when your power settings have reached their limit (i.e. 30 min set time)


Firefox h264 (mp4) HTML not working after upgrade So I just upgraded on both laptop + desktop.

Desktop = clean install
laptop = upgrade from 15.04

Now Firefox can't play h264/mp4 videos on YouTube or other.

I have tried a clean profile, which "works" but can't output 1080p. For that I have to enable

media.fragmented-mp4.exposed=true
media.fragmented-mp4.ffmpeg.enabled=true
media.fragmented-mp4.gmp.enabled=true
media.mediasource.enabled=true

After that it goes to error.

I have also tested this w3schools video which also does not work. So it have something do with mp4, since HTML5 vp9  works just fine.

ubuntu-restricted etc. all installed (else youtube.com/html5 would give an error anyway.)

Tried googling, no result.

This fixed it for me:

sudo apt-get install ubuntu-restricted-extras

Disable in about:config Media Source Extensions it is broken in 15.10


How to pass an array as function argument? Struggling for a while passing an array as argument but it's not working anyway. I've tried like below:

#! /bin/bash

function copyFiles{
   arr="$1"
   for i in "${arr[@]}";
      do
          echo "$i"
      done

}

array=("one" "two" "three")

copyFiles $array

An answer with explanation would be nice.

Edit: Basically, i will eventually call the function from another script file. Plz explain the constraints if possible.

Expanding an array without an index only gives the first element, use

copyFiles "${array[@]}"

instead of

copyFiles $array

Use a she-bang

#!/bin/bash

Use the correct function syntax

Valid variants are

function copyFiles {…}
function copyFiles(){…}
function copyFiles() {…}

instead of

function copyFiles{…}

Use the right syntax to get the array parameter

arr=("$@")

instead of

arr="$1"

Therefore

#!/bin/bash
function copyFiles() {
   arr=("$@")
   for i in "${arr[@]}";
      do
          echo "$i"
      done

}

array=("one 1" "two 2" "three 3")

copyFiles "${array[@]}"

Output is (my script has the name foo)

$ ./foo
one 1
two 2
three 3

I propose to avoid any limitation about "passing array(s) args" to a function by... passing strings, and make them array INSIDE the function :

#!/bin/bash

false_array1='1 2 3 4 5'
false_array2='my super fake array to deceive my function'
my_normal_string='John'

function i_love_arrays(){
  local myNumbers=("$1")
  local mySentence=("$2")
  local myName="$3"
  echo "My favorite numbers are, for sure: "
  for number in ${myNumbers[@]}
  do
    echo $number
  done
  echo "Let's make an ugly split of a sentence: "
  for word in ${mySentence[@]}
  do
    echo $word
  done
  echo "Yeah, I know, glad to meet you too. I'm ${myName}."
}

i_love_arrays "${false_array1}" "${false_array2}" "${my_normal_string}"


Jieli BR21 Bluetooth dongle shown as storage device Result of lsusb:
Bus 001 Device 002: ID 0bda:f179 Realtek Semiconductor Corp. 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 002: ID e5b7:0811 ZhuHai JieLi Technology JieLi BR21
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 04ca:00ac Lite-On Technology Corp. Dell Wireless Device
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The third line is my Bluetooth device. But the Bluetooth still doesn't work. May be a driver issue. I have tried almost all the answers available through googling. Please help me.

As far as i know, those things are soundcards with bluetooth recieving capebility, not bluetooth sticks. They can't connect to any non-audio devices, and will only transmit/recieve audio to the USB-audio driver.


Start firefox using apparmor (for extra security) I'm having some trouble starting firefox with apparmor. Here's what I've run:

$ sudo aa-enforce /etc/apparmor.d/usr.bin.firefox
$ firefox
/usr/lib/firefox/firefox: error while loading shared libraries: libpthread.so.0: cannot stat shared object: Permission denied

Does firefox now work out of the box with the configs provided by ubuntu? Do I need any extra configs?

I think you should run firefox as root too because you run apparmor as root.
maybe thats why it says

  Premission denied

sudo firefox


Move 10 digit number to the beginning of file name I have thousands of files that I need to rename.  They all contain a 10 digit number that all begin with '42469'.  I need to move this 10 digit in each of the files to the beginning of the filename and add an underscore. Example:

Original - HOLZHEAUSER GAS UNIT_ 2_4246932863_2.pdf
Result -   4246932863_HOLZHEAUSER GAS UNIT_2_2.PDF

Can anyone help me with this?  Thank you in advance!

I am not a real experienced script user/programmer, so my choice would be to be able to do this in Powershell.  I have tried the two suggestions in Powershell without any luck.

Using mmv to rename files with wildcard matching:

$ touch 'HOLZHEAUSER GAS UNIT_ 2_4246932863_2.pdf'
$ mmv '*_ ?_*_?.*' '#3_#1_#2_#4.#u5'

$ ls
'4246932863_HOLZHEAUSER GAS UNIT_2_2.PDF'

You can also do it with sed. This command should exactly do what you want:

ls | sed -r 's/(.*) 2_(42469)([0-9]+)_2(.*)/"&" "\2\3_\12_2\4"/' | xargs -L1 mv -v


install postfix and store all incoming mails in MySQL DB i cant config. postfix correcly, could someone please help me with that?

the google results i find, aren't really helping me..

its about a problem i try to solve for weeks now..

so: i need to be able to receive emails that are sent to email adresses using my Domain name, for example(badabum@domainName.com), this email will contain informations as a string, which i need to store in my database.
getting the information is not a problem, ad i would just do that with php or node.js.
all i need help with, is receiving emails and storing the body of those mails in my database ad strings.
i couldn't really find helpful answers in the web, cause all those solutions are for full mail servers that send, receive and filter spam and viruses, what i obviously don't need!
also all these answers i found assume that you have high level skills in what you do*ubuntu and mailservers*, which i really dont have..

im currently working on an Project which will help me finance my Collage, which starts october this year, when collage starts, i wont have time to finish my project, so 8 months of hard work would be destroyed=/.. therefore i really need your help to finish this.

what i have so far: i have an ubuntu vSerber, it has mysql and so on, so all i need is the software to receive emails.
i also have bought a domain.

please tell me now what i need,
i have installed postfix, but how do i need to config. it? i cant get it started..=/
ad what else do i need to install to ensure that all received mails are directly stored in my database?

please just answer if you know anything:) it would help me a lot!

tnak you!

Since you want to use node.js anyway, take a look at this simple smtp-server written in node.js: https://github.com/baudehlo/Haraka

configuration of postfix. solltest dich aber an die sprache hier halten.
http://www.postfix.org/BASIC_CONFIGURATION_README.html


whenever i am trying to open firefox, it shows a massage " firefox is already open but not responding" I am trying to open Firefox browser in my system. But every time it is showing  message that "firefox is already open but not responding. Please restart the system". Even after restarting the system it showing the same message, when i again try to open it.

Check the Firefox profile directory .mozilla/firefox/<profile> in your home directory and see if there is a file named .parentlock. Removing it should allow you to open Firefox again.

Firefox has a memory leak. Run htop and kill the process.


xdg-desktop-portal always crashes at startup in Ubuntu 19.10 xdg-document-portal always crashes when Ubuntu 19.10 starts up. Is there a way to prevent it crashing or to disable it without interfering with system functionality?

update:

It crashes almost on every system boot.

ProblemType: Crash
Architecture: amd64
CrashCounter: 1
CurrentDesktop: ubuntu:GNOME
Date: Fri Mar  6 13:18:09 2020
DistroRelease: Ubuntu 19.10
ExecutablePath: /usr/libexec/xdg-document-portal
ExecutableTimestamp: 1578493564
ProcCmdline: /usr/libexec/xdg-document-portal
ProcCwd: /home/usr
ProcEnviron:
 LANG=en_US.UTF-8
 LC_ADDRESS=en_US.UTF-8
 LC_IDENTIFICATION=en_US.UTF-8
 LC_MEASUREMENT=en_US.UTF-8
 LC_MONETARY=en_US.UTF-8
 LC_NAME=en_US.UTF-8
 LC_NUMERIC=en_US.UTF-8
 LC_PAPER=en_US.UTF-8
 LC_TELEPHONE=en_US.UTF-8
 LC_TIME=en_US.UTF-8
 PATH=(custom, user)
 SHELL=/bin/bash
 XDG_RUNTIME_DIR=<set>
ProcMaps:

update2:

Look at the syslog, I have error like this:

xdg-document-portal.service: Failed to set 'memory.limit_in_bytes' attribute on '/user.slice/user-1000.slice/user@1
000.service/xdg-document-portal.service' to '-1': No such file or directory
xdg-document-portal.service: Failed to set 'pids.max' attribute on '/user.slice/user-1000.slice/user@1000.service/x
dg-document-portal.service' to '4915': No such file or directory

Yes, to fix the issue simply run the following command in Terminal:

$ sudo apt upgrade xdg-desktop-portal


How do I stop all processes in a chroot? I have a number of LVM partitions, each containing an Ubuntu installation. Occasionally, I want to do an apt-get dist-upgrade, to update an installation to the most recent packages. I do this with chroot - the process is usually something like:

$ sudo mount /dev/local/chroot-0 /mnt/chroot-0
$ sudo chroot /mnt/chroot-0 sh -c 'apt-get update && apt-get dist-upgrade'
$ sudo umount /mnt/chroot-0

[ not shown: I also mount and unmount /mnt/chroot-0/{dev,sys,proc} as bind-mounts to the real /dev, /sys and /proc, as the dist-upgrade seems to expect these to be present ]

However, after upgrading to precise, this process no longer works - the final umount will fail because there are still open files on the /mnt/chroot-0 filesystem. lsof confirms that there are processes with open files in the chroot. These processes have been started during the dist-upgrade, I'm assuming this is because certain services in the chroot need to be restarted (eg, through service postgresql restart) after the package is upgraded.

So, I figure I need to tell upstart to stop all the services that are running within this chroot. Is there a way to reliably do this?

I've tried:

cat <<EOF | sudo chroot /mnt/chroot-0 /bin/sh
# stop 'initctl' services
initctl list | awk '/start\/running/ {print \$1}' | xargs -n1 -r initctl stop
EOF

Where initctl list  seems to do the right thing and only list processes that have been started in this particular root. I've tried adding this too, as suggested by Tuminoid:

cat <<EOF | sudo chroot /mnt/chroot-0 /bin/sh
# stop 'service' services
service --status-all 2>/dev/null |
    awk '/^ \[ \+ \]/ { print \$4}' |
    while read s; do service \$s stop; done
EOF

However, these doesn't seem to catch everything; processes that have daemonised and been reparented to PID 1 don't get stopped. I've also tried:

sudo chroot /mnt/chroot-0 telinit 0

But in this case, init doesn't distinguish between the separate roots and shuts down the entire machine.

So, is there any way to tell init to stop all processes in a particular chroot, so that I can safely unmount the filesystem? Does upstart have any facility to SIGTERM/SIGKILL all child processes (as would be done during regular shutdown) within a chroot?

I don't trust anything but the kernel to keep a sane state here, so I don't (ab)use init to get this job done, nor do I count on myself actually knowing what is or isn't mounted (some packages can mount extra filesystems, like binfmt_misc).  So, for process slaughter, I use:

PREFIX=/mnt/chroot-0
FOUND=0

for ROOT in /proc/*/root; do
    LINK=$(readlink $ROOT)
    if [ "x$LINK" != "x" ]; then
        if [ "x${LINK:0:${#PREFIX}}" = "x$PREFIX" ]; then
            # this process is in the chroot...
            PID=$(basename $(dirname "$ROOT"))
            kill -9 "$PID"
            FOUND=1
        fi
    fi
done

if [ "x$FOUND" = "x1" ]; then
    # repeat the above, the script I'm cargo-culting this from just re-execs itself
fi

And for umounting chroots, I use:

PREFIX=/mnt/chroot-0
COUNT=0

while grep -q "$PREFIX" /proc/mounts; do
    COUNT=$(($COUNT+1))
    if [ $COUNT -ge 20 ]; then
        echo "failed to umount $PREFIX"
        if [ -x /usr/bin/lsof ]; then
            /usr/bin/lsof "$PREFIX"
        fi
        exit 1
    fi
    grep "$PREFIX" /proc/mounts | \
        cut -d\  -f2 | LANG=C sort -r | xargs -r -n 1 umount || sleep 1
done

As an addendum, I'd point out that approaching this as an init problem is probably the wrong way to look at it, unless you actually have an init in the chroot and a separate process space (ie: in the case of LXC containers).  With a single init (outside the chroot), and a shared process space, this is no longer "init's problem", but rather just up to you to find the processes that happen to have the offending path, hence the above proc walk.

It's not clear from your initial post if these are fully-bootable systems that you're just upgrading externally (which is how I read it), or if they're chroots that you use for things like package builds.  If it's the latter, you might also want a policy-rc.d in place (like the one dropped in by mk-sbuild) that just forbids init jobs starting in the first place.  Obviously, that's not a sane solution if these are meant to be bootable systems as well.

schroot: It has the feature of session management. When you stop the session its all processes are killed.

https://github.com/dnschneid/crouton/blob/master/host-bin/unmount-chroot: This scripts kill all the chroot process and unmounts all the mounted devices.


No internet connection on 14.04LTS + Thinkpad x250 I received my laptop (Thinkpad x250) today, installed Ubuntu 14.04 LTS 64-bit on it, but don't have a Wi-Fi internet connection. My Wi-Fi is working, because I am now writing this. How could I make it work on Linux?

This is the output of lspci -knn | grep Net -A2:

03:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095b] (rev 59)
Subsystem: Intel Corporation Dual Band Wireless-AC 7265 [8086:5210]
Kernel driver in use; iwlwifi

Internet is working on all my home devices (smartphone, and this laptop) but not on my new laptop. I see my network available in the menu bar, but can't connect to it. If i click it it searches for internet, and after a while it complains: Disconnected - you are now offline.
And @terdon this is the output of iwconfig:

eth0    no wireless extensions.

wlan0   IEEE 802.11abgn ESSID:off/any
        Mode:Managed Access Point: Not-Associated   Tx-Power=22 dBm
        Retry short limit:7  RTS thr:off    Fragment thr:off
        Power Management:on

lo      no wireless extensions.

14.04 ships an old kernel. Please update your wifi driver / firmware.
Take a look at https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/core_release


Ubuntu LiveUSB not booting in HP laptop I am using a HP Pavilion laptop pre installed with Windows 8. I am trying to install Ubuntu 13.04 on my laptop using a LiveUSB, which I created in the conventional way given on the Ubuntu official site.

The problem is that even after changing the boot order to USB Stick in my BIOS, my system doesn't boot from the LiveUSB. It boots directly from the HDD, due to which I don't see the grub menu and system is automatically booted in Windows 8.

I tried the same USB on a different system (my assembled desktop which doesn't support UEFI), and it works fine there. The problem occurs only on my HP laptop.

Please help. Thanks in advance.

P.S. I tried installing Ubuntu from Wubi, but then there's a whole different altogether. During boot, it shows an Ubuntu option, but reports a missing file.

I think this might be because of UEFI. I did a quick search and found this, try it.

http://scienceblogs.com/aardvarchaeology/2013/12/16/tech-note-how-to-install-linux-on-a-laptop-with-uefi/


Adding a ppa repo and get key signed - no valid OpenPGP data - proxy issue? I want to get a ppa key signed

I tried

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

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys A258828C
gpg: requesting key A258828C from hkp server keyserver.ubuntu.com
gpgkeys: HTTP fetch error 7: couldn't connect to host
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

and

wget -q http://ppa.launchpad.net/panda3d/ppa/ubuntu/dists/lucid/Release.gpg -O- | apt-key add -

gpg: no valid OpenPGP data found

I am behind a proxy , in apt.conf it is configured correctly

Acquire::http::Proxy "http://proxy.mycompany.de:3128";

I also tried setting proxy

export http_proxy="proxy.mycompany.de:3128"
export https_proxy="proxy.mycompany.de:3128"

Try

export http_proxy=http://proxy.mycompany.de:3128; export https_proxy=$http_proxy
sudo -E apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A258828C

Try running sudo -s before

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

This worked for me.


How do I install Ubuntu from an USB drive / create a live USB-stick in Windows? I tried to use the usb-creator.exe from Ubuntu 10.10 desktop i386 ISO image and it does create an USB stick that doesn't boot. When I try to boot from it I get:

  Operating System not found.

I try to do this from Windows 7 x64. I'm not looking to create a live Ubuntu media, only an installation USB disk.

I repeated the process several times and I even tried to reformat the USB drive (FAT32), no success yet.

The USB stick is a 8GB one.

Well you can create a Live-USB disk that can be used for installing the operating system with unetbootin. Here is the official documentation on USB installation.

Make sure that you boot the USB disk at system startup, i.e. when you on your computer. That means the BIOS of your computer has to be set to try to boot from USB before it boots from hard drive and the stick has to be inserted before hard drive booting takes place.

The usual procedure from within Ubuntu is to use Startup Disk Creator. With that you just select the Ubuntu image or LiveCD and the USB-Media and go ahead. See picture below:

Set to boot from USB in BIOS. that is if you haven't set to it.


Grub does not autoboot the default option after upgrade to 12.10 I recently upgraded Ubuntu from 12.04 to 12.10 and since that time, the system does not automatically boot. It always opens the boot menu, and I have to press Enter to make it boot Ubuntu.

It seems to be ignoring the timeout value, and using a 'neverending' timeout.

There are no other systems (no dual boot), only the options originally installed by default Ubuntu 12.04 installation.

My /etc/default/grub has only these effective options:

GRUB_DEFAULT='Ubuntu'
GRUB_HIDDEN_TIMEOUT=1
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_TERMINAL=console

I experimented with GRUB_DEFAULT, giving it values '0', '1', 'Ubuntu' but nothing helps.

Yes I always run update-grub afterwards.

How can I make the system booting again ?

Add the following to /etc/default/grub

GRUB_RECORDFAIL_TIMEOUT=0

Save and run

sudo update-grub

Try this. I didn't have to use the live disk cause I could manually boot the os by selecting the option in grub and pressing enter. This fixed my problem. Good luck!

http://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/


Make the sound louder in Lubuntu I have a Toshiba r835 running Lubuntu 11.10. Turning the volume slider up all the way doesn't give very loud sound. I've tried typing alsamixer in a terminal and turning up all the levels there to maximum, but the speakers are still fairly quiet. Is there a simple way to increase maximum volume in software?

I understand that there are physical limits to the sound the laptop's speakers can produce, but I suspect my maximum volume is limited by software.

EDIT:

This is exactly the type of solution I'm looking for. However, it doesn't work for me. What I did:

sudo pico /etc/asound.conf

This file does not exist, so I create a new one, containing:

pcm.!default {
      type plug
      slave.pcm "softvol"
  }

  pcm.softvol {
      type softvol
      slave {
          pcm "dmix"
      }
      control {
          name "Pre-Amp"
          card 0
      }
      min_dB -5.0
      max_dB 20.0
      resolution 6
  }

I reboot the machine, and type alsamixer. I use my left/right arrow keys to inspect the various volume options. I expect to see a new option, called Pre-Amp, but I don't see one. This fix seems to work for other people. Why doesn't this fix work for me?

You could try using PulseAudio. Simply install pavucontrol package and then play with volume levels through the settings menu of the regular volume control in the panel.

Try looking in the man pages in Terminal.
Open Terminal from the Dash or Menu, It can most of the time be found under 'Accessories'.
Type in 'man alsamixer'.
You could also open the Help application, if it exists.


How do I make rsync delete files that have been deleted from the source folder? I recently set up a machine with Ubuntu Server to host game servers.  I installed a backup plugin for each game server that creates frequent backups of game world files in a particular folder on the machine.  I also established a cron task to automatically copy those backups to my Dropbox folder every night using rsync with the -a option.

After a few months my Dropbox account reached its storage limit and I realized I would not be able to keep so many backups, so I configured the game server backup plugin to not retain so many backups, then waited a few days to see if it would delete the older backups as it is scheduled to do on a weekly basis.  The backup plugin eventually did its job and deleted the older backups, so I was expecting the rsync cron task to subsequently delete the older backups from my Dropbox folder to match the source folder, but it has not done so.  So I have a couple of questions:

By default, does rsync only add files to the destination folder
that have been added to the source folder and change files that
have been changed in the source folder but NOT delete files
that were deleted from the source folder?
If that is the case, what is the best way to make rsync do this?  I
want the destination folder to perfectly reflect the source folder,
and that means deleting any files that have been deleted from the source
folder.

I see some options listed in the manual page for rsync that might do the trick, but since I'm not familiar with.

To delete files in the target, add the --delete option to your command. For example:

rsync -avh source/ dest/ --delete

The ‘-delete’ flag has to appear after your /source and /destination.
So it’s like this

rsync -rvpthE --progress /Volumes/EOS_DIGITAL/DCIM/ /Users/mitchellg/Desktop/files -delete

The options are:

-r recursive
-v verbose (print to screen)
-p permissions
-t time (use time instead of checksums ‘c’)
-h human readable
-E extended Info (the Color tags on a .Mac)


Choosing "something else" when installing I am in the process of installing Kubuntu 14.4 on my Windows 10 computer.  Normally I would simply use the whole disk, as I don't really like Windows, however there are a few programs I like to use, and want to keep it.
I have tried this in the past, and failed.  Ending up erasing the entire disk and using it for Linux  (have used several flavors in the past).
My problem is configuring the hard disk.  I have never quite been able to understand partitioning.  I usually screw it up, one way or another.  The last time totally messing up a hard drive in my laptop, to the point I had to install a new one and start from scratch (hey now I have a better hard drive with double the space) I always manage somehow to mess up the order of the partitions. Don't ask me how.  It should be fairly straightforward.  The last time I tried I ended up with no mount point, and could not get anything to install.
I would like to see some sort of graphic showing just what I will encounter when I choose "something else".  (I have already tried Kubuntu on this machine and it worked fine, even the touchscreen).
I remember trying to install another distro some time ago, and being presented with questions I had no idea how to answer, regarding formatting the disk.  So if there is someone out there who has the patience to walk me through this, I would appreciate it. I also have problems converting MB's to GB's. For some reason it always is much less than I thought. I have a 2 TB hard drive. So figuring it out in MB's is a bit confusing.  Hey for years, I couldn't make change for a dollar!
What I have now is two small volumes at the beginning that simply say "Healthy" and nothing else.  I assume they are something that came with my HP 23 Aio.  Both are in the  milibytes.  Then There is C drive which is Windows. I have 196 GB free out of 496 GB. There is a recovery drive D marked "new volume" that is 450MB, Then there is a drive E that is the largest being 1.5 GB.  It is also marked "new volume" and appears to be empty. At least that is what the file manager says.
I really don't want to shrink C drive as I have quite a few video and music files stored. Which is why I believe the drive is more than half full.  Windows not showing what is stored just where. That leaves E, which I had tried to shrink, and D which I had deleted after making a recovery USB.  Those two mistakes left me with unallocated space after D drive, and after E drive.  So I restored from a recovery USB (it's still doing its thing two hours already).  Supposedly that will restore everything to the way it was before I tried to manipulate the partitions. I have my important files saved to an external HD.

Okay, from your post I'll assume that Install alongside Windows is not working.
Now for the partitioning:
Partitions needed by Linux
Linux needs the following partitions to install:

A root partition -- mounted at / -- contains all files
A swap partition -- used as additional RAM -- if you have decent amounts of RAM (8 GB or more), you may not need this

How to partition
Do not start the installer yet!
I'll assume the entirety of the disk is taken up by Windows partitions.
If you want to install Kubuntu on your hard drive, you'll need to shrink a partition or there won't be any space!
Using Partition Manager (found in the menu), right-click on the partition you want to shrink and select Resize/Move.
There will be a rectangle with something like sd... on it. Select the edge of it with the mouse and drag it to resize.
The recommended amount of free space (indicated by a rectangle divided by a line from the previous rectangle (it's so hard to put GUIs into words!)) is 20-25 GB.
Click Apply or OK or something.
Now you will have some free space.
Now, start the installer!
When you get to the Something Else... option, choose it. Right click your shiny new free space and choose "New partition".
Select it to mount at / and used as Ext4 ... filesystem and check "Format".
Now do the same for the little bit of space, except this time, don't change the mount point and select it to be used as swap.  Its recommended size should be
amount_of_free_space - half_of_RAM_size.
You are now ready to continue!
P.S. Still in doubt? Refer to this excellent answer.
Welcome to Linux and hope you like it!

Most if not all long time Linux users will omit any tips to preserve any W's related usability. Windows installer doesn't format partitions since long time now. The last time I saw that I was still in W XP. So you need to leave the disk Unallocated from a Live CD session and do the restore again if you want total control over partition Layout which in W's is not total. But you can install in any order with another method and just leave unallocated space where you want W's.

I assume you want Windows in one piece so in that case you are going to need a little help of a flash drive.

If this is a laptop great in most cases because laptops usually have a SD card reader so you buy the fastest bad boy card and use it during installation ( empty but with a Fat 32 partition ), what you would is sort out the partitioning layout problem and install Kubuntu in the hard drive but the bootloader in the memory card. Last, go to your Bios settings and set the first drive for Booting as the memory card.

When in Kubuntu make a disknimage backup of the booloader and in every update to it.

This is actually all you need to sort out if you want Windows to be really intact.

The Boot loaded used in Linux commonly support W's so it will be included in the boot loader for Kubuntu.

AFAIK Kubuntu shows the menu when two or more OS's are installed but you can change that to skip the boot menu and just pull out the card and W's will boot.

That's is done in the GRUB configuration.

A more correct way (and less painful ) would be to install W's last after any Linux distro you use and a copy of Hiren's boot CD in an USB drive to make the process faster but I haven't done that. The idea is that Windows will set it's bootloader and will work well with upgrading and other utilities that could be affected by not having it's original loader.

If you desire this, ask for help in the Ubuntu forums and double check everything stated here.

Good luck!


Need advice on size of Root Partition for latest Ubuntu or Ubuntu clone distro? I have two Hard Drives a Samsung 750Gigs and a Western Digital Green 2 TB.
My current partition scheme consists of only 3 NTFS partitions:

750:
   C: 75 Gigs  Windows 7 Home Premium
   D: 675 Gigs for Games and other stuff

2000:
   E: 2 TB for remaining storage

and 4Gigs of RAM

I plan to dual boot Linux Ubuntu or a similar flavor of it (I assume they mostly have the space requirements)

My Question is mainly about the size of the Root partition and maybe also the SWAP partition.
I plan to install a  root  swap and home partition on the 2 TB hard drive and leave the other HDD for windows 7 and windows games. But, I am slowly transitioning to Linux, hopefully completely and want to know how large should be the root partition if I plan to install a lot of software and Linux games from the repositories and maybe sourceforge and other sources so I would not need to resize the root in the foreseeable future ?

thank you in advance.

I would give 40-50GB for / and mabey 100GB for /home with the rest as an NTFS volume for movies/music/whatever so you can get to it from either OS. Putting /home on it's own partition allows you to upgrade or distro hop without losing all your linux data.


How to convert .mkv file into .mp4 file losslessly? I need to convert a video file from Matroska container into mp4 container. Matroska file contains one h.264 video track and one AC3 sound track. It should be possible to do this losslessly, but how to do it with native Ubuntu tools?

Transcoding is not an option.

Perhaps the easiest tool for that is ffmpeg, or avconv from the libav-tools package. Libav is a fork of FFmpeg, which Ubuntu switched to for a few years until Ubuntu 15.04. It is one of the backends for many of the GUI tools mentioned in other answers.

Changing container without re-enconding content could not be simpler:

ffmpeg -i input.mkv -codec copy output.mp4

It auto-detects a Matroska to MP4 container conversion based on input/output filenames.
-codec copy stream copies, or "re-muxes", the streams from the input to the output without re-encoding. Think of it like a copy and paste.
Default stream selection behavior is to select only one stream per stream type. For example, if your input has two video streams and one audio stream then only the video stream with the largest frame size will be selected. Add -map 0 if you want to select all streams from the input.
Some containers may not support some formats. So check if your chosen container format, be it mkv, mp4 or even avi has support for all the content in your files (video, audio, subtitles, data, etc). For example, mp4 does not support SubRip subtitles (.srt files).

You can try HANDBRAKE by adding its PPA by typing this code into the terminal:

sudo add-apt-repository ppa:stebbins/handbrake-releases


Bash Script: catching errors in a block of statements I have a large iptables ruleset that I manage with my own bash script. Most of the commands in the script are simple, single-statment iptables commands. I am trying to improve the script by adding success/failure output as the script executes.

I have the script broken out into different sections. One example would be the FORWARD chain section, where all the rules are applied to the FORWARD chain. At the beginning of the section, I output that the script has started applying the FORWARD rules, and at the end, I want to output whether or not all the rules were applied successfully, or if any of them didn't work. Here is the basic idea:

#Start FORWARD section
echo -ne "Applying FORWARD rules..."

#rule 1
/sbin/iptables -A FOWRARD...

#rule 2
/sbin/iptables -A FORWARD...

echo -ne "\t\t\t[OK]\n"

What I'm wanting to do is catch any output or errors that may result from each iptables command and store them in an array or something. Then at the end of the block, use an if statement to evaluate the array to see if there were any errors. If not, output the [OK] status, if there were, output the [FAILED] status and display the related error.

Is there a way I can do this for the entire block of rules without wrapping each iptables rule in an if [ $? != 0 ] expression?

You could use the trap shell builtin command to have a handler function called if a command has a non-zero exit status. You can pass necessary information, like the line number and the exit status to your error handler function.

Example:

#!/bin/bash

handle_error() {
    echo "FAILED: line $1, exit code $2"
    exit 1
}

trap 'handle_error $LINENO $?' ERR

# your commands here
# ...

echo "OK"

You mean something like this?

ok=1

#Start FORWARD section
echo -ne "Applying FORWARD rules..."

#rule 1
/sbin/iptables -A FOWRARD... || ok=0

#rule 2
/sbin/iptables -A FORWARD... || ok=0

echo -ne "\t\t\t"
if [ $ok -eq 1 ]; then
  echo "[OK]"
else
  echo "[fail]"
fi


How to edit the start menu I installed ubuntu 13.04 on a new laptop but don't know how to handle the system. I want to edit start menu, to group items, add or remove some, get rid of icons.

Using this application, you can edit what applications are available:
https://apps.ubuntu.com/cat/applications/alacarte/

You can use it to change icons as well.

You can buy Drawer for 2.99$ from the software center.

A utility for organizing related items for easy launching from the Unity launcher by "mini-dashes" or quicklists. You can also create persistent Desktop Widgets that display a directory or links to related items and applications.

There are currently three types of Drawers:

Basic Drawers: A favorite for the Unity Launcher that can contain any combination of files, applications, web links or directories. Just drag and drop on the icon or open drawer and your item will be added.  Left-clicking the launcher "opens a drawer" with an icon view of each item for launching. Right-clicking allows fast launching through quicklists.  Use Basic Drawers for quick creation of application categories or to keep shortcuts of related documents and links together when working on a project. Drawers can even be nested within one another (just drag from Dash to open drawer).

AppMenu Drawers: A favorite for the Unity Launcher that displays a "Gnome Classic-like" application menu, drawers-style!  Applications are categorized and displayed automatically, so there's no need to add applications manually to the drawer.  An AppMenu Drawer can be created at any sub-level (e.g. Accessories or Games) or items in sub-levels can be pinned to the Launcher's quicklist.  If you wish to edit the menu structure, you must currently use an xdg-menu editor such as alacarte or menulibre.

Active Drawers: A favorite for the Unity Launcher that links to a specific directory. Any files dragged to the icon will be copied to that directory.  A quicklist is generated after each opening with the 10 most recently modified files or files can be pinned to stay in the quicklist.  Opening the Drawer displays a folder view that is updated in real time.  Pin it to the desktop and you have a Folder View Widget!

For support, please contact at http://launchpad.net/drawers


System freeze after suspend Since I installed Ubuntu 16.04 my laptop (HP Probook 450 G2) has issues waking up from suspend. Rarely it manages to properly wake up from suspend, but mostly the screen either stays black or it turns on, and completely freezes after 2 or 3 seconds, followed by a bit louder fan activity in both cases. I cannot switch to a tty shell, or do anything else apart from killing the power by holding the power button.

I tried following different solutions such as disabling USB Legacy, adding acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012' to GRUB_CMDLINE_LINUX_DEFAULT, but nothing worked.

I switched to Linux Mint yesterday just to test if I have an issue there, but it still persists. Here is the output of /var/log/kern.log which shows the last messages from my previous session.

Feb 13 09:51:55 hamza-PC kernel: [  913.345833] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.4773] manager: sleep requested (sleeping: no  enabled: yes)
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.4774] manager: sleeping...
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.4774] device (wlo1): state change: activated -> unmanaged (reason 'sleeping') [100 10 37]
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.4969] dhcp4 (wlo1): canceled DHCP transaction, DHCP client pid 1440
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.4970] dhcp4 (wlo1): state changed bound -> done
Feb 13 09:52:22 hamza-PC kernel: [  940.019586] wlo1: deauthenticating from b4:75:0e:ce:22:bb by local choice (Reason: 3=DEAUTH_LEAVING)
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.5125] dns-mgr: Writing DNS information to /sbin/resolvconf
Feb 13 09:52:22 hamza-PC kernel: [  940.034017] cfg80211: World regulatory domain updated:
Feb 13 09:52:22 hamza-PC kernel: [  940.034019] cfg80211:  DFS Master region: unset
Feb 13 09:52:22 hamza-PC kernel: [  940.034020] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 13 09:52:22 hamza-PC kernel: [  940.034022] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 13 09:52:22 hamza-PC kernel: [  940.034024] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 13 09:52:22 hamza-PC kernel: [  940.034025] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Feb 13 09:52:22 hamza-PC kernel: [  940.034026] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 13 09:52:22 hamza-PC kernel: [  940.034027] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 13 09:52:22 hamza-PC kernel: [  940.034028] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Feb 13 09:52:22 hamza-PC kernel: [  940.034029] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Feb 13 09:52:22 hamza-PC kernel: [  940.034030] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Feb 13 09:52:22 hamza-PC NetworkManager[1004]: <info>  [1486975942.5423] manager: NetworkManager state is now ASLEEP
Feb 13 09:52:26 hamza-PC kernel: [  943.880782] i915 0000:00:02.0: BAR 6: [??? 0x00000000 flags 0x2] has bogus alignment
Feb 13 09:52:27 hamza-PC kernel: [  944.885059] i915 0000:00:02.0: BAR 6: [??? 0x00000000 flags 0x2] has bogus alignment

Also

uname -a
Linux hamza-PC 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Any info would be helpful, thank you!

I have a 4.19 kernel and Nvidia driver version 390.
I changed gdm  to lightdm.

sudo apt install lightdm

Problem is solved now.

Temporary Solution | Stuck On The Logon Screen | Even After Many Restarts

If you still find yourself stuck on the logon screen even after the hard restart then follow these steps to get out of this...

Restart your system : Press & hold the power button for 5-10 seconds
Start the system in recovery mode by selecting "Advance Option for Ubuntu"
Select the first options that ends with "(recovery)"
Choose "root drop to root shell prompt" option and hint ENTER Key (twice)
Execute the following commands:

  sudo dpkg --configure -a

  sudo prime-select intel

  sudo reboot

Note: : This would work only if you're using a system that has two graphics cards (such as nvidia+intel or intel+amd) and the non-intel one is configured as the primary one.


phablet-flash: error: too few arguments I try to install Ubuntu touch into my nexus 10 (ver: 4.3)Now I start to work on the 4th step - Downloading & Deploying Image to Device

I wrote: phablet-flash (cdimage-touch|cdimage-legacy|ubuntu-system|community) -b

then: bash: syntax error near unexpected token 'cdimage-touch'

I wrote: phablet-flash -b

then: usage: phablet-flash [-h]
phablet-flash: error:too few arguments

So what I should do next?

Try:
    phablet-flash  cdimage-touch -b

to flash the latest stable image.


fresh 20.04 install with nvidia and iGPU.. only get iGPU resolutions I am curious how am I supposed to switch to using the nvidia card on my ubuntu 20.04 setup?

on 18.04 once installed, I could just plug in and go.. seems with 20.04 it is using both iGPU and PCI-E GPU... I see the device is here, I have nvidia-smi responding with output.. but the ubuntu gnome resolution is only going up to 1920x1080.. telling me it's using the intel iGPU off my core i7 2600K

Edit:

strangely, after reinstalling.. it now eroneously occupies the GPU even though I only get intel resolutions..

how do I revert so the iGPU is used 100% and the GPU is left freed ?

This solution was given to me and tested via the NVIDIA linux forums

Essentially start the NVIDIA X Server settings:

https://forums.developer.nvidia.com/t/ubuntu-20-04-fresh-install-looking-for-how-to-use-prime-to-use-igpu-on-desktop-intel-gtx-1060/124195/2

under PRIME profiles select

NVIDIA OnDemand

next, you need to do the following :

add ‘nogpumanager’ kernel parameter

See https://wiki.ubuntu.com/Kernel/KernelBootParameters if you're unfamiliar with that step

delete /usr/share/X11/xorg.conf.d/11-nvidia-offload.conf
create /etc/X11/xorg.conf with contents:

   Section "Device"
       Identifier     "intel"
       Driver         "modesetting"
       BusID          "PCI:0:2:0"
   EndSection

Try changing the driver in Software & Updates --> Additional Drivers.


How to check if I have deleted my windows 10 partition when dual booting ubuntu 16 I just attempted to dual boot Ubuntu 16 from my already existing Windows 10.

I created a new partition and then restarted my pc and booted from my usb which had the ubuntu iso installed on it.
The ubuntu installation went smoothly until I tried to boot back into windows..
My grub cannot see windows.

I tried the following:

sudo fdisk -l

And it prints out:

Device
/dev/sda1
/dev/sda2
/dev/sda5

as well as a red line:

Partition 2 does not start on physical sector boundary

Can someone please help me? I fear I may have deleted my Windows partition.

Actually this problem is depend on laptop company also. But don`t worry, Just press 'Ctrl+Alt+Del' it will restart then while restarting continuously press F2 or F12 then you will enter into the doss then there is option to change the operating system, you just select your windows. other wise select the secure boot you may get you windows.

Basically now days all laptops having UEFi and CSM option in the doss. for windows you can select UEFI in system configuration and for Ubuntu CSM. but UEFI is having secure boot option also.

All the best...


How to go back to original clean installation of Ubuntu I use Ubuntu Studio 18.04.3 (with the additional ppa backports to get LTS) in three desktop PCs and one laptop.

But, one of the desktop PCs was sequentially upgraded from old versions up the today last version. In other words, in this PC there was not a "full clean" installation.

As the three desktop are exactly the same machines, I suspect that a lot of audio problems I only have in that specific PC are related with the fact it was not a "full clean" installation.

Can I automatically reset and back the system to the original "full clean" installation, without to have to use the Live DVD way?

How?

I'm talking about some automatic way to full erase all the apps and libraries from the old versions whith some compatibility problems with the last version.

There are two options, though you should use each with caution as ny automated solution could accidentally remove something vital:

Resetter

Here's a description from OMG Ubuntu:

  A new Linux app currently in beta claims to let you do exactly that:
  reset Ubuntu, clear out all the non-default apps, remove old kernels,
  and even purge surplus user accounts.

If support for your distribution isn't there it can be added following instructions in this video.

Reset dconf

OMG Ubuntu has detailed a way to reset your desktop to its default configuration simply by running:

dconf reset -f /

  Running this command will reset, among other things: the apps pinned
  to the Unity launcher or Ubuntu Dock ; panel applets and/or
  indicators; monitor resolution and interface scaling; keyboard
  shortcuts; fonts, GTK and icon theme; window button placement,
  launcher behaviour; and so on.

  This command will also reset any application that uses dconf to store its settings. >This includes core desktop apps like Rhythmbox, Evince, Shotwell and Nautilus.


How to remove all files from a directory? The closest I've gotten is

# rm /path/to/directory/*.*

but that doesn't work for files that don't have an extension...

Linux does not use extensions. It is up to the creator of the file to decide whether the name should have an extension. Linux looks at the first few bytes to figure out what kind of file it is dealing with.

To remove all non-hidden files* in a directory use:

rm /path/to/directory/*

However, this will show an error for each sub-directory, because in this mode it is only allowed to delete files.
To remove all non-hidden files and sub-directories (along with all of their contents) in a directory use:

rm -r /path/to/directory/*

* Hidden files and directories are those whose names start with . (dot) character, e.g.: .hidden-file or .hidden-directory/. Note that, in Bash, if the dotglob option (which is off by default) is set, rm will act on hidden files too, because they will be included when * is expanded by the shell to provide the list of filename arguments.

You can cd into the directory and then run the command rm *.* just like in DOS if you remember.


Cannot boot from USB - HP Envy I'm having a little bit of a problem right now...  I am trying to install Ubuntu, whether it be the 12.04LTS or 13.10, but I can't seem to get my PC to even run into my bootable USB.

I am trying to at least boot into Ubuntu off the USB so I can see if the Network Card will work and be able to grab wifi.  When I open my boot source when I start my PC, I can click on the USB drive, but it will tell me that it cannot authenticate it(paraphrasing loosely of course).  I'm using an HP ENVY TS m6 Sleekbook with Windows 8 (64-bit).

I would definitely appreciate someone's help, so if Ubuntu is compatible with my network card, I can learn more about Ubuntu and such.  Thank you in advance.

Specs:

OS: Windows 8 64-bit
CPU: AMD A10 @ 2.10GHz
RAM: 6GB
Graphics: ATI Radeon HD 8610G
HDD: 698GB Seagate (SATA)

I had a similar problem some time ago with 12.04.
 I disabled the secure boot(by going into the BIOS usually F2 during boot)

I was unable to boot from the USB drive,  I then tried changing the priority in the BIOS (USB first). This worked for me in the past, (after disabling the secure boot of course) and booted from the USB with no issues, after installing 12.04 I then returned the HD to 1st in the boot priority.

I was having a problem booting from a USB drive. I tried everything and nothing seemed to work well. I ended up using a newer USB drive and it worked. Sometimes certain USB drives don't work well with certain laptops. In my case it was a Lexar 16 GB thumb drive and my Yoga 2 Pro. Once I used my brother's San Disk, it worked like a charm. If all else fails, don't forget this! Good luck!


mysql login to root account with unix socket I'm wanting some assistance in understanding mysql root account that connects by unix socket. I do not understand the unix_socket very well. Logging in without a password concerns me as I may be misunderstanding how the login is happening.

I'm running Ubuntu server 18.04.1 LTS and installed mysql-server Ver 14.14 Distrib 5.7.23. I ran mysql_secure_installation.

I cannot login to mysql with the password at all.

mysql -u root -p

I can login to mysql if executed as sudo without password.

sudo mysql -u root

I understand this is because it's using the unix_socket instead of mysql_native_password.

Can a non-sudo user login to the mysql server with my current setup?

Assuming that your root MySQL user has unix_socket authentication enabled, then NO; a non-root, non-sudo user can NOT access your MySQL root user account at all.

If someone can get root (Linux user) access to your machine, then they can access your MySQL root user account, regardless of which authentication method you use. E.g. the root user can (re)start MySQL with authentication disabled and log in with no authentication at all.

So using the unix_socket authentication method does NOT make your MySQL setup any less secure, just more convenient. It could actually be argued that it makes it more secure because regardless of how you configure MySQL, the root user can only connect via localhost - no root user remote connections are allowed. Note that in this context, a direct connection to localhost counts as localhost; e.g. via SSH.

Using a password instead (which BTW, can be done if you wish) gives NO real advantages. Unless of course you wish to allow the root user to connect remotely (NOT recommended).

BTW, with unix_socket authentication enabled, from the root (Linux user) account you can start the MySQL shell (as the root MySQL user by simply running:

mysql

AFAIK that should also work from a sudoer user account too. I.e.:

sudo mysql

Can a non-sudo user login to the mysql server with my current setup?

No. But anyone with physical access to your system can when you are logged into the desktop.

I myself would do a

ALTER USER 'root'@'localhost' IDENTIFIED BY '{password}';

at the mysql prompt. That will force a password for root@localhost. On Ubuntu you can also do

sudo dpkg-reconfigure mysql-server-5.7

(adjust the 5.7 to your version).


Thunderbird :: Stuck at Google sign-in After updating my personal Gmail account password, I am unable to reconnect my Thunderbird to my Gmail account. I get to the Google login page, but when I click 'Next' nothing happens.

I have uninstalled, purged and ran it after a fresh install from a download through the shell, but I get the same issue. Not sure if this is a bug or something else. I ran it from command line; turned off the firewall; and checked dmesg, but none yielded any useful information.

Update: I figured that since I was able to set up Thunderbird once on Ubuntu 16.1, then a fresh install--without running apt-get update and upgrade--should do it. But to no avail.

I also tried setting up a new Gmail account, again no avail. This is frustrating. I really like using Thunderbird to manage my Gmail.

Update2: I have another computer with Linux Mint, it has the exact same issue. Is this something wrong with Gmail? Does it have to do with permissions?

Here's the screen where I get stuck:

I had asked the same question today and got this answer:

https://askubuntu.com/a/910630/621017

It worked for me, but I had to reboot after uninstalling and only then reinstalled TB.

You can use VPN to change your IP address to a country (e.g. Hongkong) where the default login page is still the old one.


Setting up webserver with ISPConfig : mail configuration I have installed my Ubuntu 12.04 web server following the guide available on how to forge.
Then, I have created one client in ISPConfig. Using this client, I have a domain (example.com) and a mailbox (client@example.com) in the e-mail configuration of ISPConfig.

I do not use any DNS system on my server (though Bind has been installed by the procedure) and I have setup my registrar's DNS (OVH) for the domain as follow :

.example.com      NS      Their main server name
.example.com      NS      Their secondary server name
.example.com      MX 1    example.com
.example.com      MX 100  example.com
.example.com      A       MY_SERVER_IP
www.example.com   A       MY_SERVER_IP
mail.example.com  CNAME   example.com
smtp.example.com  CNAME   example.com

I can see the mailbox using the webmail, but :

– I can't use it to send mails (composing a new mail and hitting send doesn't do anything)
– When I send mails to client@example.com, the webmail doesn't report anything in the inbox.

When I try to setup the mailbox (IMAP) using a client (Apple mail) I can go through the IMAP setup (apparently, mail is able to contact the server mail.example.com and log in) but I can't setup the SMTP on smtp.example.com or on mail.example.com or on example.com. The request times out.

What's wrong with my setup ?

Here are the latest mail logs.

I have replaced my domain by example.com and the IP address from my router at home by MY_HOME_IPV4_ADDRESS. That's probably either attempts from Apple mail to check smtp and imap for the mailbox I tried to configure, or to send an e-mail towards client@example.com.

Remark: Of course, my server is configured with the real domain name, not with example.com

In /etc/postfix/master.cf, uncomment the lines:

submission inet n       -       -       -       -       smtpd

[...]

smtps     inet  n       -       -       -       -       smtpd


How to list Compiz keybindings in use? Other than looking though each active plugin and  manually searching for keybindings / keyboard-shortcuts  in use by compiz, is there a 'simple' way to gather this information?

i.e. Some panel that displays all currently active keybindings in use (by compiz), or some terminal command to do same.

Keyboard-shortcuts does not appear to list certain specific compiz shortcuts.

Thanks

Here's a (very long) one-liner that returns all shortcuts from all active plugins:

for i in $(gconftool-2 --get /apps/compiz-1/general/screen0/options/active_plugins|sed "s/\[\|\]//g"|sed "s/,/ /g"); do echo "# $i:"; gconftool-2 -a /apps/compiz-1/plugins/"$i"/screen0/options | grep "_key\|_button\|trigger_\|initiate\ \|panel_first_menu\|keyboard_focus\|execute_command\|show_launcher" | grep -v "Disabled\|=[[:space:]]*$" | sort; done; echo -e "\n# metacity overrides:"; gconftool-2 -a /apps/metacity/global_keybindings | grep -v "disabled\|cycle\|switch_panels" | sort; gconftool-2 -a /apps/metacity/window_keybindings | grep -v "disabled" | sort

Update: Above version now gets all non-empty/disabled keybindings (key, mouse, key+mouse) from all active plugins.

However, the value of the key X-GNOME-WMSettingsModule in /usr/share/applications/compiz.desktop makes Metacity override several Compiz keys. You will notice the italic labels in ccsm - that's when the value comes from Metacity and not Compiz.

As I found no easy way to fix this, I simply added all Metacity shortcuts to the end of the output.

i got a nice webpage for this ;)

https://web.archive.org/web/20110430205154/http://ranjith.zfs.in/ubuntu-10-04-compiz-fusion-keyboard-shortcuts/


Disabling Optimus / Graphics cards I have a Dell XPS 15 L502x. I using Ubuntu 14.04 duel booted with window 7. I looking to get more life out of my battery while in Ubuntu. I have no need for the nvdia card while using Ubuntu since this is where I do my work.

What I would like to know is if this guide on this Page can be applied to 14.04 since it makes no mention of this version in the list and if so will it benefit my battery by disabling the nvidia card?

also to note I have not installed any drivers I'm using a the ones that ubuntu installed during the OS installation.

Trying it can't do any harm.

Use the following command before and after the switch. >ou should see a drop/rise in mW being used:

# grep rate /proc/acpi/battery/BAT0/state

switch off your NVIDIA card using

# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

If your laptop now uses less mW, then you get a longer battery life.

If you are using a NVIDIA binary driver (you can check by searching for the Additional Drivers program and looking at which driver is selected), then you can use the Nvidia X server settings to change which gpu is used. To launch the Nvidia X server settings, either search for "Nvidia" in the dock or launch the program from the terminal using "nvidia-settings". There will be a tab that allows you to select the correct gpu (sorry, I don't know which one exactly).


I can't uninstall Ubuntu and I have a single boot I'm new to the PC-building world and I built my first PC. I didn't want to pay for Windows so I found Linux was free and Ubuntu was the best one. Well now I have Windows 8 on a USB drive and I can't uninstall Ubuntu.

There's no need to “uninstall” Ubuntu. Just let the Windows installer erase your harddisk.

If for some reason Windows can't erase the disk, boot a Ubuntu live CD (or USB), start GParted and erase your disk from there (Device → Create Partition Table..., select type msdos), after doing that the Windows installer should work fine.

you can not uninstall something with out a device that you used to install it, need to boot from the device that you have ubuntu installed, if you had a disk or a flash drive you need change it to boot from it, then just format the drive and you will be good for a clean install of Windows 8, hope this helps :)


FGLRX disturbs TTYs and Plymouth graphics I just installed Ubuntu Trusty on my new SSD, enabling UEFI, which was disabled previously. After the installation finished (and I finally found a workaround for a strange HP UEFI, which denied booting Ubuntu), I noticed the following problems during Plymouth's animation and when switching to
TTY1-7:

Each screen line is shifted to the right relative to the one above, like you can see in the image below. This results in an ugly boot splash and barely usable (only if I know the commands by heart) TTY.

This only appeared after installing fglrx. Before, when using xserver-xorg-video-ati, everything was fine.

Has anyone experienced this before? How can I fix it?

Image: TTY1 filled with a hexdump

Device: HP ProBook 455 G1
OS: Ubuntu 14.04 64bit
FGLRX Version: 2:13.350.1-0ubuntu2, installed via Additional Drivers

EDIT: Now using FGLRX Version 14.301.1001, installed from ATI installer, problem persists.

EDIT2: Video modes listed by videoinfo (former called vbeinfo):

Adapter `Bochs PCI Video Driver`:
  No info available
Adapter `Cirrus CLGD 5446 PCI Video Driver`:
  No info available
Adapter `EFI GOP driver`:
* 0x000 1366 x  768 x 32 (5464)
  0x001  800 x  600 x 32 (3200)
  0x002 1024 x  768 x 32 (4096)
  0x003  640 x  480 x 32 (2560)

I tried every one of these, the only one that worked was 0x002 1024x768. But how can I enable 1366x768 without the distorted screen?

PS: I previously used Ubuntu on the same computer, but without UEFI and on a HDD. Then it worked, too

Turns out is is some strange incompatibility with fglrx in HP's UEFI BIOS:

If I only use Legacy BIOS, the bootsplash is shown correctly
If I use UEFI BIOS with Legacy support, the bootsplash is always 1024x768, no matter which resolution
If I only use UEFI BIOS, the screen is distorted, as seen above, except when I choose 1024x768.

Unfortunately, there is no fix for this (except using Xorg's driver) (And I can't even do a BIOS upgrade, because the exact same computer model is needed, but with Windows, to create the upgrade EFI file... VM's don't work)

Update: After a BIOS update, the problem does not occur anymore once the fglrx/radeon driver is actually loaded, so by embedding it in the initramfs, the problem can be circumvented easily.

Have you to enter this in the terminal or drop shell from recovery:

 update-grub
 update-grub2
 Plymouth-upstart-bridge
 grub-install
 grub-mkconfig

and then enter this from the terminal:

 sudo apt-get install --reinstall ubuntu-desktop

and it might work fine this way.