How to get GUI sudo password prompt without command line?

TL;DR: Try installing the policykit-1 and policykit-1-gnome packages.

You probably need polkit (a.k.a. PolicyKit).

Most graphical system administration utilities in Ubuntu, including the Software Center, can usually be run without sudo or anything quite like it. You just run them the same way you'd run any program.

When it comes time to perform a task requiring root privileges, they use polkit to perform the required actions. polkit is a separate mechanism from sudo, for allowing administrators to perform actions as root. It's installed on desktop Ubuntu systems but by default is not part of Ubuntu Server installations.

Thus the normal behavior of the Software Center is that you can invoke it simply as software-center, it will not prompt you to authenticate at that time, but then when you tell it to install or remove software, it will prompt you (graphically) to authenticate.

It sounds from your description like your system started as an Ubuntu Server system with no GUI, and then you installed a GUI. Probably the policykit-1  and policykit-1-gnome  packages have not been installed. If you install the, polkit will most likely start working for Software Center and other such utilities.

sudo apt-get update
sudo apt-get install policykit-1 policykit-1-gnome

Then you should be able to just run:

software-center

(Or select the Software Center graphically as provided for by whatever desktop environment you installed.)

If you want a fully functional Ubuntu desktop system, I recommend installing the metapackage for whatever "flavor" of Ubuntu you want to turn your system into. Basically, if you want a regular Ubuntu desktop system, install ubuntu-desktop .

sudo apt-get update
sudo apt-get install ubuntu-desktop

This should fill in the various gaps, like not having polkit, that come with installing a more minimal GUI on your server system. On the other hand, if you prefer a more minimal GUI, you can just install those polkit packages.

For more information, see How do you run Ubuntu Server with a GUI?

sudo with graphical authentication.

If you really do need run commands as root but get a graphical authentication dialog, what you're looking for is gksudo (or gksu). This is provided by the gksu  package. It is a graphical frontend for sudo.

Typically gksudo is used to run graphical applications as root (or some other user besides the user launching them). But you can also use it to run non-graphical commands--provided the commands can be run with sudo.

You can run gksudo from a terminal but you don't have to. You can run it from the Alt+F2 (run command) dialog or put it in the Exec= line of a .desktop file (or any of the other ways you run graphical programs).

Note that you should consider using gksudo to run graphical applications as root even when you are running them from a terminal, because commands like sudo ... where ... is a graphical application can actually break the per-application configurations of the non-root users running them. (Fortunately this is fixable.)  sudo gedit is particularly notorious.

For more information on the problem with sudo for graphical applications and what to do instead, see:

Why should users never use normal sudo to start graphical applications?
RootSudo in the Ubuntu help wiki
man sudo for the -H and -i options. sudo -H ... and sudo -i ... do not authenticate graphically, but like gksudo ... they don't have the problems of plain sudo ....

There's also polkit-based graphical way ...for non-graphical commands.

gksudo works fine for running both graphical and non-graphical programs. You should probably use that.

But an alternative, using polkit instead of sudo and only working for non-graphical programs, is pkexec.

For example, if you run pkexec touch /root/foo.txt, you'll be prompted with a graphical authentication dialog, and if the authentication succeeds, touch /root/foo.txt is run, creating (or freshening) foo.txt in the /root folder.

pkexec will use a non-graphical dialog, requiring a terminal, in the event that it cannot create a graphical dialog. But this is unlikely to happen if you're running it through a facility provided by your graphical shell or desktop environment.
Why does pkexec work only for non-graphical programs? Actually it also runs graphical programs, but only if polkit has been specially configured to allow it--which is not usually done. See man pkexec (and the upstream version, with screenshots), this answer and that answer for some details, if you're interested.

sudo vs. polkit (some technical details, only if you're interested)

A new gksu/gksudo will use polkit instead of sudo to do its work, though this version has not been widely adopted. I mainly bring it up to recommend the README file in its source code (written by Gustavo Noronha Silva), which explains the important differences between sudo and polkit. To quote from it briefly:

  PolicyKit solves the problem of an application needing higher
  privileges by providing facilities to let users authenticate
  themselves and for applications to verify authentication and
  authorization information. The application has to be structured in a
  way that all privileged operation is done by a (preferably) small
  D-Bus service, which is commanded by the unprivileged code. All
  "actions" that are performed need proper authorization, which is
  handled through Policykit.

  4. Why maintain gksu?

  So, this essentially makes gksu unnecessary, since applications no
  longer need to run as a privileged user, and user authentication is
  done by PolicyKit's Auth Agent. But applications need to be refactored
  to adopt this new structure, and there are some cases in which what
  you want is indeed something that runs programs as root.

These issues underlie the situation I believe you're in:

Software Center is designed to use polkit for privilege elevation, so that only specific actions need to be performed as root. For this, it needs polkit, which was missing (or broken) on your system.
Because it is designed to use polkit, there's no pre-made launcher to start the Software Center as root. polkit obviates the need to run graphical administration tools as root, most of the time.
But sometimes you really do need to run a graphical program as root. In that case, you can use gksu/gksudo.
(...Which may eventually use polkit behind the scenes--but the gksudo currently in Ubuntu is the traditional one that uses sudo).


gnome-terminal failing to launch in Ubuntu 18.04 (Chrome remote desktop broke gnome-terminal)

I was able to fix the issue by uninstalling Chrome remote desktop by running $ sudo apt remove chrome-remote-desktop

I found the solution on https://ubuntuforums.org/showthread.php?t=2383992


What is the attribute used to display the username for lightdm? Is it something I can change?

I don't think that you can, at least not in lightdm. lightdm gets the user list from Gnome's accounts-service over dbus which I assume populates the list from ldap somehow. Perhaps there's a way to configure it in ldap.conf?


I edited the symbolic link in /etc/systemd/system/getty.target.wants/getty@tty1.service adding the --autologin param to agetty.  This way:

ExecStart=/sbin/agetty --noclear --autologin <username> %I $TERM

I hope it helps o/


Here are the three solutions that have have worked for me.

Boot Linux from a Live cd or usb and make sure you’ve a working Internet connection and type the following on the terminal.

1. Solution

sudo apt-get install syslinux

If the package got installed, use the following command to write the MBR:

sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda

2. Solution

sudo apt-get install mbr

If the package got installed use following to write the MBR.

sudo install-mbr -i n -p D -t 0 /dev/sda

Common for both

Replace sda if you want to install the MBR to a different drive. Do not put sda1,sda2,  or sda3. Just put it as sda for the hard disk. Finally reboot and your Windows should boot.

3. Solution

Install Boot-Repair on ubuntu by following steps

Open the terminal and run the following commands

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair

After completing the installation you can launch it from System->Administration->Boot-Repair menu if you use Gnome, or search "boot-repair" in the dash if you use Unity. Then follow the following screenshots:

Method 1

Click on the advanced options

Tick the options shown below

Change the tab to Grub Location Tab and Tick The options Shown in the figure

Press Apply and Reboot the system

Method 2

Select the recommended Boot repair options as shown in the first screenshot


Is it safe to unset the msftdata flag on a ext4 partiton that was reformatted from ntfs?

Yes, it is safe, and no there is no real reason to: linux ignores this flag.


Disable password authentication to set proxy information

I found out a way to do this. Those settings are defined in /usr/share/polkit-1/actions/com.ubuntu.systemservice.policy file. So, to disable the password authentication  one should change the values of allow_active and allow_inactive in com.ubuntu.systemservice.setnoproxy and com.ubuntu.systemservice.setnoproxy to "yes".

This should not be the best way to do it (involves editing a xml file) but it worked.


xdg-open without an option to “remember”

Create following path and file:
sudo mkdir -p /etc/opt/chrome/policies/managed/
sudo touch /etc/opt/chrome/policies/managed/managed_policies.json

Open permissions for this file:
sudo chmod -R 775 /etc/opt/chrome/policies/managed

By default adding following content to this file should add the checkbox to remember your choice:
{
    "ExternalProtocolDialogShowAlwaysOpenCheckbox": true
}

This worked for all external website for me. For custom link, you may need to add those links to the whitelist:
{
    "ExternalProtocolDialogShowAlwaysOpenCheckbox": true,
    "URLWhitelist": [
        "telnet://*",
        "rvlink://*"
    ]
}

Same question on different community: Stop chrome from prompting when running external URL handler?


If there is a configure file in the folder you extracted "cruft-0.2.tar.gz" to, open a terminal to that directory (to that path) and run

 ./configure
 make
 sudo make install


screen shuts down when connecting to dock

Did you update the kernel to 4.15.0-44, which was offered yesterday through Ubuntu software update ?

It contains a bug in the graphics driver initialization, which has been reverted into a test kernel 4.15.0-45 available there, which seems to fix the issue for all affected users:

https://people.canonical.com/~khfeng/lp1813663/

Regards


I've played around with Big Blue Button in the past.  It's open-source web-based designed for distance learning (although I was testing for my company).  It has video, whiteboard, desktop sharing, audio, chat and is under pretty steady development.
The problems I had were mostly bandwidth.  You can build and deploy your own server but you'll need a good chunk of bandwidth to make it work well with lots of participants.  Also, if you don't have a static IP you'll run into issues with the way the system works.  It can run with Dynamic IP as I recall, but it takes some juggling.

Edit: It also has no front end, you'll need Moodle or something like it to set up meetings and invite participants.


I would strongly recommend not to use wubi anymore to install Ubuntu. newer versions of Ubuntu will not include the wubi anymore and in my experience it gives a lot of trouble. please follow these instructions instead.


Something similar happened to me. May be it is a problem of "slow questions". That is, questions to the database that imply searching or filtering by unindexed fields, huge joins or something like that.

May be you need to optimize your database design. In my case, after some minor changes, my Intel Atom based server has passed from a load of about 0.9 to a load of about 0.1 (serving 20k ~ 25k pages a day).


Has it worked on 14.04 for you before? Or are you new to Ubuntu?

Most steam issues related to the client itself stem from the fact that the client is 32-bit for your OS is 64bit which has some issues on linux-based distros. I solved this issue myself with sudo apt-get install ia32-libs which removed my error message - which, granted, wasn't the same as yours, but it might work.

Perhaps elaborate on your graphics driver. Can you provide the output of lspci -k | grep VGA -A2?


Which Filesystem Hierarchy Standard is in Ubuntu?

The current version is still 2.3 (2004) and Ubuntu, like Debian, is based on that. At the Linux Foundation it is noted that

  The FHS 3 specification is currently under development.

They aimed to release it by 1 July this year as this article describes, so the date you saw on wikipedia was merely this date they had earmarked. It hasn't actually been released yet at the time I am writing (12 September 2012). The changes haven't been decided fully, but there are some useful links in the link above (such as the fhs mailing-lists discussion and there is a discussion at lwn.net.

More details on the existing specifications are available at the Linux Foundation.

For more general information, two great questions on this site explain the filesystem hierarchy well:

How to understand the Ubuntu file system layout?
https://askubuntu.com/questions/165677/which-book-should-i-buy-to-learn-file-system-in-ubuntu


Issue installing Ubuntu 14.10 over 6 on older HP Pavilion tower

Make sure that you have your BIOS set to boot from CD-ROM before it attempts to boot from the hard drive. Then you should be fine. If all else fails just nuke the hard drive (that is what I had to do on my desktop because GRUB was being difficult).

Get Nuke Here: http://www.dban.org/download (Just get DBAN not the premium)


Android NDK in Adroid Studio 2.1 Preview 5 and Ubuntu 14.04

You can go to File > Project Structure and from the left panel select SDK Location as in the bottom image. There you can see or change the location of your SDK/NDK.


Ubuntu 16.04 LTS Unable to resize mouse pointer

You can try to use unity-tweak-tool.

sudo apt-get install unity-tweak-tool

In Appearance > Cursors there is a "Use large cursors" check box.

This makes a cursor that would be large enough for most disabled persons.


Can byobu (tmux) show a multiline status

Not easily, no.  Unfortunately, tmux only supports a single status line at a time.  That's a function of tmux, and not byobu.

What you can do, however, is configure multiple status lines and cycle through them using shift-F5.  You'll only be able to see one at a time, but you can cycle through them with a single keystroke.

You can define and customize these in your ~/.byobu/status file.  Here's a snippet:

# Tmux has one status line, with 2 halves for status
# You can have as many tmux right lines below here, and cycle through them using Shift-F5
#tmux_right="network #disk_io custom #entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname ip_address #time_utc date time"
#tmux_right="#network disk_io #custom entropy #raid #reboot_required #updates_available #apport #services #mail #users #uptime #ec2_cost #rcs_cost fan_speed cpu_temp #battery #wifi_quality #processes #load_average #cpu_count #cpu_freq #memory #swap whoami hostname ip_address #time_utc disk date time"
tmux_left=" logo #distro release #arch"
tmux_right=" network disk_io custom entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost fan_speed cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname ip_address #time_utc date time"


How can I download from 4shared.com via terminal?

Well,I just downloaded it.

In your first command you used

wget http://dc379.4shared.com/download/cm3oo7bA/Applied_radiological_Anatomy.pdf?tsid=20120817-033302-fa3ef03c

instead of that use only upto the .pdf extension. That is

wget http://dc379.4shared.com/download/cm3oo7bA/Applied_radiological_Anatomy.pdf


World of Warcraft on PlayOnLinux: graphics problem

Please install mesa-utils if not yet installed: sudo apt-get install mesa-utils to test for OpenGL support.

Run a check to see if you have OpenGL support: glxinfo|grep 'direct rendering' or /usr/lib/nux/unity_support_test -p.

And run glxgears to see how your video card renders and its FPS for the render.

If it appears you have OpenGL support and all is good then add to the WoW launcher the -opengl parameter. For example '.wine/drive_c/Program Files/World of Warcraft/Wow.exe' -opengl

and test to see the result.


Does the Linux kernel source code contain device drivers?

Device drivers are in the kernel.

Linus wrote the original Linux kernel by himself, and remains very much involved (last I heard about it anyway) but now there are thousands of people developing for the Linux kernel. These folks include employees of companies like Intel who write drivers for their devices for the Linux kernel (and get paid to do it).

Note that one driver can work for many different devices. For example, i915 is the kernel's Intel CPU driver. There doesn't need to be a driver for every single different Intel CPU.

Loosely described, Linux kernel development is a huge, widely distributed project overseen by Linus and other core developers, with people contributing as their full time job, part of their work, as a hobby or project, all communicating through mailing lists. Anyone can write a patch for the kernel, patch the kernel, and use and distribute their patched kernel. But if your patch is so great it really ought to be in the kernel by default, with some feedback and help from others, it might get merged into a future kernel release. This open and diffuse model of development, with many minds and perspectives on the job, accounts somewhat for how the Linux kernel manages to support such a wide range of hardware. Here's the documentation for kernel development.

As chilli555 pointed out you can download the kernel source code and find device drivers. To do this,  enable source repositories, create a directory in your home and enter it, and from there run (sudo is not needed):

apt source linux


How to retain LCD brightness after reboot

I don't know how this is done in Fedora, but to do this in Ubuntu:

First know the output name

xrandr -q

for example my output name is DVI-I-2

The brightness can be changed like this:

xrandr --output DVI-I-2 --brightness 1

Now add this command to your startup programs or to the /etc/rc.local file.


Long usb serial connection jobs stop at the 8 hour mark. I suspect timeout or maximum-resource-used issue

Most of your system's log files are kept in /var/log/ (or a subdirectory of /var/log) and can be viewed with Applications -> System Tools -> KSystem Log.

Or, if you are comfortable with the command line:

# Assume printer failed at `18:54:35`

sudo zegrep '[[:space:]]18:5[0-4]:' /var/log/* /var/log/cups/*

to see all the log entries from 18:50:00 to 18:54:59, which probably includes whetever is killing the print job.

With different regexps (see man grep and everything in See Also) you can extract different time ranges. Once you narrow in on which events you want to care about (or ignore), more complex regular expressions can do more.

Of course, before you do any of these commands, read man sudo, man zegrep and man grep until you understand what I'm asking you to do, and how harmful it is.


How can I fix this annoying "broken depenencies" error?

The repository is outdated. Basically, you either need to find the new repository and add it, reinstall the software with the new repository, or wait for the developer to fix it - which may not happen.

Remove the PPA via

sudo apt-get install ppa-purge
sudo ppa-purge ppa:openshot.developers/ppa

Sorry I cannot be of more help, but that's what the error states. In other words, it's safe to ignore as long as the software still functions to your intent, but probably won't be getting updated any time soon.


If I understand well your problem, you want to feed import.csv when ProcessType1 is not empty and validate.csv when ProcessType2 is not.

You can test if the variable is set and not empty with:

if [ -n "$VAR" ];
then
    echo "VAR is set\n"
fi

Your code could looks like:

#!/bin/bash

cd /path/to/manoj/version_2019_logs/

for file in log_Job_*/manoj.log; do

    ProcessType1="$(grep -F 'Running process mpeXbrlImport.xml' "$file" | awk '{print $5}' | cut -c 4-)"
    ProcessType2="$(grep -F 'Running process mpeXbrlValidate.xml' "$file" | awk '{print $5}' | cut -c 4-)"

    if [ -n "$ProcessType1" ];
    then
        #set of commands to get other variaqbles
        Var="$Filename","$ProcessType1","$TotalDuration","$Initialization","$MPEProcessDuration","$TotalPartitionDuration","$WaitPartitionDuration","$MainPartionDuration"
        echo $Var >>OutputFile_Import.csv
    fi
    if [ -n "$ProcessType2" ];
    then
            #repeat the set of commands and this time save with different variable names
            Var1="$Filename1","$ProcessType2","$TotalDuration1","$Initialization1","$MPEProcessDuration1","$TotalPartitionDuration1","$WaitPartitionDuration1","$MainPartionDuration1"
            echo $Var1 >>OutputFile_Validate.csv
    fi
done


How to migrate Apache Archiva repository from old server to new server

I also had gone through the same issue, In indexing of apache Archiva.
I was having apache archiva X.X.X on a server and I had need to upgrade it to latest one on a different server so required to use the old repository.
I had successfully configured the new apache archiva 2.3 on a new server and then migrated the old repository to new server.

I had followed the below mentioned steps and its worked for me:

Step 1: I moved the old repository to the newly setup server from /opt/apache-archiva-X.X.X/data/repositories/internal to the new server with same path.

Note : If you have different path then specify it in /opt/apache-archiva-2.2.3/conf/archiva.xml file and change accordingly:

<managedRepository>
<location>/opt/apache-archiva-2.2.3/data/repositories/internal</location>

<managedRepository>
<location>/opt/apache-archiva-2.2.3/data/repositories/snapshots</location>

Step 2: Search .indexer file in the above given path and remove it as old indexer file won't work with the new setup of apache archiva.

Step 3: Now goto browser and access the new archiva url and login as an administrator
Goto repository and scan for index and directory. It will create a new .indexer file in new setup.

Cheers !! That's all enjoy


I've cloned WinSplit Revolution with a lightweight C++ program whose only dependency is libx.  It should work under any window manager that is NetWM compliant, which OpenBox claims to be.  It is quite easy to build and install.

http://code.google.com/p/snappy-util/


How do I install Brother QL-700 label printer drivers in Ubuntu 12.04?

Running Ubuntu 13.10 amd64 I just followed the instrunctions on http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_esp1.html and it just works.

Caveat: turn off "Editor Lite" on the printer (hold little button on front until LED turns off) otherwise the printer will not be accssible to CUPS.


Brother MFC-J825DW network printer not detected on ubuntu 13.10

Download the CUPSwrapper driver and the LPR driver from the Brother website and follow the directions provided on the resulting download page.


Save a file ending in .conf with the following content in your /etc/X11/xorg.conf.d/

Section "InputClass"
    Identifier "Wacom Area configurations"
    # Match all Wacom input tools that have "BambooFun 6x8" in the "device name".
    MatchProduct "Wacom ISDv4 E6 Pen stylus"
    MatchDevicePath "/dev/input/event*"

    # Apply a custom configuration options. Any option will also apply to
    # all dependent devices, if applicable. So e.g. the pressure curve will
    # be available on the stylus and the eraser (but not on the pad).
    Option "Area" "0 0 27760 15690"
EndSection

The option part isn't the same for both Xorg and xsetwacom, so it would need you to check it out.

Source http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Xorg.conf.d


Go to https://sslvpn.demo.sonicwall.com/cgi-bin/welcome  log in with
demo/password
Click on NetExtender icon: this will download a tar.gz with the
client.
(Optional) sudo ln -s /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.6
(Optional) sudo ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.6
Untar the client, make install script executable (chmod u+x) and launch install

NB: When executing the installation script, do not allow root access

sudo ./install

--- Dell SonicWALL NetExtender 7.5.761 Installer ---
Checking library dependencies...
Checking pppd...
Do you want non-root users to be able to run NetExtender?
    If so, I can set pppd to run as root, but this could be
    considered a security risk.

Set pppd to run as root [y/N]? N
You have chosen NOT to allow non-root users to run NetExtender.
Copying files...

------------------------ INSTALLATION SUCCESSFUL -----------------------

To launch NetExtender, do one of the following:

Click the NetExtender icon under the Applications menu
 (look under the 'Internet' or 'Network' category)
 or
Type netExtenderGui

Solution tested from Ubuntu 13 to 18.04.


How can I read every DVD, even if encrypted by CSS or other?

You can't be sure that you will be able to read every DVD.

libdvdcss2 will allow you to play, copy and rip DVDs encrypted with CSS (Content Scramble System). This is by far the most commonly used DRM on DVDs.

However there are other methods which are much more nasty. The ones I have come across were where some sectors of the DVD were deliberately corrupted so that they couldn't be copied. For these I used ddrescue  which is a command line app similar to dd.

This program was designed for rescuing data from failing drives where there are accidental bad sectors. They can also be applied to get rid or the DVD DRM. If I remember rightly, this is the command:

ddrescue -d /dev/dvd ~/dvd_backup.iso ~/dvd_backup.log

You can then mount or burn the ISO file.


how to lock LUKS partition from terminal?

type in terminal:

qdbus --system org.freedesktop.UDisks /org/freedesktop/UDisks/devices/sdX org.freedesktop.UDisks.Device.LuksLock NULL

explanation:

qdbus: a communication-interface for qt-based applications

--system: connect to the system bus

org.freedesktop.UDisks: the service to connect to

/org/freedesktop/UDisks/devices/sdX: the path to the object

org.freedesktop.UDisks.Device.LuksLock: the method to call

NULL: method option

for more methods from this service: http://udisks.freedesktop.org/docs/1.0.5/Device.html

or just type the command without a method : qdbus --system org.freedesktop.UDisks /org/freedesktop/UDisks/devices/sdX


Just insert the following to the sshd config on the server (/etc/ssh/sshd_config)

PasswordAuthentication no

You might need to reload the ssh service

sudo service ssh reload

That should do the trick ;)

For more options type man sshd_config in to your terminal.


Go into /etc/network/interfaces and add

auto eth1
iface eth1 inet dhcp


Set desktop default to Unity 2D remotely?

You just need to run this command:

sudo /usr/lib/lightdm/lightdm-set-defaults -s ubuntu-2d


I did some research that may help.

There is a PPA for CDEmu. See What are PPAs and how do I use them?

So you don't need to compile/install it manually. Just open Terminal (Ctrl+Alt+T) and use

sudo add-apt-repository ppa:cdemu/ppa
sudo apt-get update
sudo apt-get install gcdemu

Hope that help.

Here is the instruction on German, but it is simple to understand.


Why does my custom prompt not show in Ubuntu/Bash on Windows 10?

In "Bash on Ubuntu on Windows", the opened shell is not a "login shell", which means .bash_profile isn't being read, as mentioned by @Zanna (thank you!).

You can use shopt to see whether your'e in a "login shell" or not:

shopt login_shell

Since I wish to keep things tidy and put customizations into their own files, I'm now sourcing a custom file from .bashrc:

  . ~/.bashrc_customizations


Unable to remove 'residual config' packages in Synaptic Package Manager

That is a known bug. You can remove the residual config files without synaptic using this handy one-liner:

aptitude -F %p search '~c' | xargs sudo dpkg -P

You may have to install aptitude if you haven't done that yet.


Failed to download repository information ubuntu 14.04

Please check your router and turn it off for 10 seconds and restart the router.
After that type ping 8.8.8.8.

If this works try to: sudo apt-get update && sudo apt-get upgrade -y

if not do:
ifconfig to see your connection information it will properly be eth0 and
sudo ifdown eth0 && sudo ifup eth0
ifconfig

if you got an ip address then try: sudo apt-get update && sudo apt-get upgrade -y

if not double check your router and connect the tcp/ip cable to to the wall and directly to your computer and type sudo idown eth0 && sudo ifup eth0 &&
ping 8.8.8.8


Is there any way to connect to Windows PowerShell from the terminal?

There's a commercial proprietary tool called PowerShell SSH Server (read TechNet description) that will let you log in over SSH.

There's also a free proprietary tool freeSSHd - you can run it and replace the standard cmd command shell with PowerShell.

Finally, if you'd prefer a free software (open source) solution, you can install the Cygwin SSH server and run PowerShell under that. (Apparently this is slower.)


gnome-terminal starts with "grep: write error: Broken pipe" message

After hours of struggling with the problem I found a working workaround (I hope so)

Problem seems to be deeper and complicated. Many people met the same bug. Fixing it is beyond my coverage.

Closest workaround posted here how-can-i-fix-a-broken-pipe-error by Andrew Beals at bottom like :

ls -lt $PWD|dd obs=1M | grep -m 1 ^d | cut -b 51-

is not neat.

When I intuited that it's related to pipe buffer I gave a shot to unbuffer command like :

 unbuffer ls -lt $PWD| grep -m 1 ^d | cut -b 51-

It works well.

I hope somebody posts the real cause of the problem.

EDIT: A bash Guru would suggest this simple solution , redirecting stderr to /dev/null

 ls -lt $PWD 2>/dev/null | grep -m 1 ^d | cut -b 51-


Getting a PS3 / Windows USB controller to work on Ubuntu

Does it work anywhere else? What is the output of sudo lsusb ? Did you try a motherboard port (instead of the case ones... just checking). Since no leds light up, could be even a crappy cable - some cheap cables from e.g aliexpress are not very good to say the least.

...I of course also assume it's not an official Sony controller.


Would you recommend to install libcupsys2_1.3.9-17ubuntu3.9_all.deb?

This package doesn't do anything. It doesn't install any files, it just marks libcupssys2 as installed so that the canon package doesn't complain.

All the required files all already installed by the libcups2 package.

BTW, in my last system (10.04) I've been able to install Canon drivers without need to do this trick. Please check the canon site, as it's likely that the last drivers work without it.


iptables doesn't redirect http traffic to my Squid proxy!

I think you are missing the destination port, try following

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3128

Without dport, you are forwarding traffic with destination port 3128 to local port 3128. What you want is traffic with destination port 80 forward to local port 3128.

Additionally, to show nat rules, use

iptables -t nat -L

However, the above rules will not work for a transparent proxy setup on the same machine of the browser, because PREROUTING chain alters packges before routing from a remote client and it will not do anything for locally generated packets. Thus we should use OUTPUT chain for packets locally generated which are going out from the system.

Try following instead

iptables -t nat -A OUTPUT -p tcp -m owner ! --uid-owner proxy --dport 80 -j REDIRECT --to-port 3128

It will only redirect traffic for processes other than the ones owned by proxy user.

Without -m owner ! --uid-owner proxy, it will not work because the rules will also caught the proxy server outgoing traffic and end up in a loop.


HTML5 as default for video in Firefox (and banishing flash!)

you could try this which worked for me:

in firefox enter the about:config page.

find the entries specified below and set them as I've set them below whichs did the trick for me:

media.mediasource.whitelist = false
and
media.mediasource.webm.enabled = true

Regards,
Troels


"panic occurred switching back to text console"

It seems it's a bug in kernel 3.0 and it happens in many netbooks. I've read that if you upgrade your kernel version up to the 3.1 branch it won't happen again.

--

Parece que es un bug en la versión 3.0 del kernel y que les pasa a muchos netbooks. He leído que si actualizas el kernel hasta una versión 3.1 deja de pasar.


To tell pulseaudio that headphones are always plugged in, edit the /usr/share/pulseaudio/alsa-mixer/paths/analog-output-lineout.conf file.

Try to find the following lines in the file:

[Jack Headphone]
state.plugged = no
state.unplugged = unknown

And, if they exist, change state.plugged = no to state.plugged = yes.

Next, try find the following lines:

[Jack Front Headphone]
state.plugged = no
state.unplugged = unknown

Similarly, change state.plugged = no to state.plugged = yes if the lines exist.

Next, find these lines (if they exist):

[Element Headphone]
switch = off
volume = off

Change switch = off to switch = on here.

Also try to find these lines:

[Element Headphone2]
switch = off
volume = off

If they exist, change switch = off to switch = on.

Save the file and, finally, restart pulseaudio:

$ pulseaudio -k
$ pulseaudio --start


Is there a way to make ntpd -gq run faster

Things are easy when you post your config:

change:

 server pool.ntp.org

To:

 server 0.COUNTRY-CODE.pool.ntp.org iburst
 server 1.COUNTRY-CODE.pool.ntp.org iburst
 server 2.COUNTRY-CODE.pool.ntp.org iburst
 server 3.COUNTRY-CODE.pool.ntp.org iburst

Where country code is us / ca / uk / fr

The meat of this response is the iburst, the extra two server lines allow the clock to be set if one server is unreachable.

Also install fake-hwclock so the time persists somewhat across reboots. It wont be 1970 every time the machine comes on.

UPDATE: I saw your answers. Why not run a local ntp server so the time is super quick to set and you dont have to worr about connecting to ntp servers on internet?


Does Ubuntu 12.04 LTS runs on my computer? I need help

The only problem I see is the RAM, a little short. You could try anyway to burn a DVD or create a bootable USB with the iso file downloaded from the website and run the live desktop before you install.

Also, you could try other flavours like Xubuntu or Lubuntu which are basically the same as ubuntu but with different desktop interfaces.

Don't forget to download the 32-bit version of the iso you choose, since 64-bit versions are not supported by your CPU (somebody correct me if I'm wrong).

Good luck!


How do I find out what is planned for the next version?

One way to keep track of news of new features is to read one of many well-known blogs or news sites that are Ubuntu-specific during each release's development cycle. Examples include OMG! Ubuntu and Web Upd8.

If you don't mind wading through mounds of technical stuff, there are blueprints for Ubuntu at Launchpad that could offer some clues as to what will come in the next release.

Lastly, there is the Ubuntu Contributors Channel on YouTube, which keeps a large collection of video recordings from the Ubuntu Developer Summits, as well as interviews with some of the developers.


How about this command?

sudo apt-get update && sudo apt-get remove --purge edubuntu-desktop && sudo apt-get install ubuntustudio-desktop


My laptop touchpad is not working properly using ubuntu 18.04

You can try sudo apt install xserver-xorg-core to install the missing dependency,
if there are errors try sudo apt -f install and report the output.
Otherwise retry sudo apt install xserver-xorg-input-synaptics.


For me it worked using LXDE instead of Unity.
Install it with the command sudo apt-get install lxde-core and on your next login you should be able to select the desktop environment.

Note that you might have to reinstall LoL while running LXDE. And never execute it in Unity again. I don't know why, but it didn't work for me any more after I tried to.


Is recovery mode supposed to hang after fsck?

It definitely is not "supposed" to do that - but it happens.
Workaround: in the recovery menu just select Drop to root shell prompt

and inside try

sudo fdisk -l

to get a list of drives and partitions

mount

should give something like

/dev/sdb5 on / type ext4 (rw,errors=remount-ro)

and then with the partition you just found

sudo fsck -f /dev/sdb5
sudo mount /dev/sdb5 / -o remount,rw

fsck -f forces a check, even if there is no indication of a problem on the partition.
Now your root partition is error free and mounted (rw). You would now be able to do anything there with root permissions - so be careful!


Less graphics power all the sudden (Intel HD 3000)

I know Intel has had a number of issues with the Linux kernel driver,
As these articles will show.

Tweaks To Extend The Battery Life Of Intel Linux Notebooks

RC6 power savings Disabled For Linux 3.2

however if you are comfortable with adding kernel command-line parameters you might try using the i915.i915_enable_rc6=1 or the pcie_aspm=force option to get your graphics back up to par. Just be on the lookout for possible overheating and/or lockups.


The correct way of switching between multiple versions of an installed software is using:

sudo update-alternatives --config <package>

So, for java, you need to execute:

sudo update-alternatives --config java

which should return you the versions installed, which in my case is:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1053      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode
  2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1053      manual mode

In order to switch between versions you can enter the selection i.e. 0, 1, 2 in this case, depending upon the version you want to switch to.

However, in case of python, python2 and python3 are not alternatives, so you won't find this option, you will need to create aliases for this.

So, if you want python to refer to python version 2.xx and python3 to refer to python version 3.xx, you can open your ~/.bash_aliases file and enter the following:

alias python=`/usr/bin/python`
alias python3=`/usr/bin/python3`

This file may be empty if you have not created aliases before, which is fine. You may even want the alias the other way around, i.e. python to refer to python3 and python2 to refer to python2, you can tweak the alias as you want.

As you can see, it depends if the versions installed are alternatives of each other- if they are alternatives, you can use update-alternatives, if not, you will have to tweak using aliases or soft-links. There may be better, cleaner solutions, but I am not aware of those.


Does installing a KDE application under Ubuntu mean more CPU load and/or memory usage even when it's not running?

Short answer: NO.

Unless you load a KDE application, libs will not be loaded, nothing will run.
Even if you load KDE applications, the rest like Nepomuk won't run. So basically that means no extra load.
Only kdelibs get loaded most of the time. No plasma, no plasmoids, no stuff like that.
If you start a KDE application AT startup, then the boot will be of course, longer. As Ubuntu will have to load the kdelibs just to run your application. (How longer? Depends on your storage speed.)
There will be no overhead or CPU load increase because you run KDE apps. They will run just as fast as they would run under KDE. You might want to check "systemsettings" and "qt4-qtconfig" though, to set up a lightweight theme/disable animations, and so on.
Loading up Kate gave me ~80MB more memory usage. Closing it dropped this to 40MB. Applying the manual drop cache gave back all the memory.

Corrrection:
You guys were right. Kdeinit4 indeed stays in memory.
To read about it, check man kdeinit4.

There is a way to kill it to free up every last bit of memory.
It eats no CPU though.
Idles with a ~40MB of memory usage.


If your doughter users a separate user account, it would be possible to auto-kill the network manager applet only when she loggs in. That will remove it from the pannel completely, but will not affect an already established connection.

Managing network connection without the applet would be problematic, but if necessary, you could always restart is by pressing alt-f2, typing nm-applet and hitting Enter. To kill it again, run pkill nm-applet.

Now, to make it auto-kill, add a startup application, name it, for example, nm-applet-killer, and in the Command feild, enter the following:

bash -c 'sleep 30 && pkill nm-applet'

The sleep X part is the timeout in seconds, and can be adjusted as needed.


How to make ubuntu one sync existing files and folders inside a shared folder

Their is a bug in Ubuntu 11.10 that causes new Cloud Folders (folders set to sync) to not sync their contents until you restart Ubuntu One.
https://bugs.launchpad.net/ubuntuone-client/+bug/869920
The fix for this bug should appear very soon in your regular updates. In the meantime you can restart the Ubuntu One processes by opening a Terminal and running the following commands one at a time.

This command will quit the Ubuntu One syncdaemon.

u1sdtool -q

This command will start the Ubuntu One syncdaemon.

u1sdtool -c


rkhunter psswd and group file changes warning

You need to ask yourself:

did I add a user?
did I install software that might have added a user?

Best method to use is to list the /etc/passwd file on your screen with

more /etc/passwd

and to check for unexpected usernames.

These notices from rkhunter are more than likely caused by an out of date reference file. You might want to do a ...

sudo rkhunter --update
sudo rkhunter --propupd

after you install new software. The 1st creates a new database reference file and the 2nd marks that reference file as a starting point.

If a rootkit is found it is likely to throw more alarms than just a notice regarding /etc/passwd. That is just a file holding your "users" and it is not enough to start a rootkit.


discovered this is correct.
I`m used zsf. This is ZSYS he creates one snapshot for restoring the system when used the apt


How to Mount and Unmount encrypted folder in Ubuntu 18.04?

https://www.howtoforge.com/tutorial/how-to-encrypt-directories-with-ecryptfs-on-ubuntu-16-04/

That howtoforge page says:

  When you do this for the first time, you will have to answer a few questions:

So, presumably, when you do it the second time it won't ask you "a few questions", but only one question: "Passphrase:"


Skype 4.2 won't launch on Lenovo y510p Ubuntu 14.04

Try starting Skype from a terminal window with this command:

LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype

and let us know what happened.

Edit:

Since it worked, this is one way to fix the start of Skype more persistently:

Create a file named ~/bin/skype
Give it this content:

#!/bin/sh
exec env LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/bin/skype "$@"
Make it executable using chmod +x ~/bin/skype
Log out and log in again


Node modules have 755 permissions, what permissions should I set so that npm don't require sudo?

You don't need to alter permission of npm to be able to use it without sudo. TO set up npm to run without sudo follow these steps:

Option 1:

Get path of npm directory:

npm config get prefix

If you got /usr go to option 2 else change owner of npm directories to yours:

 sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

Option 2:

Create directory for global installations:

mkdir ~/.npm-global

Configure to use that directory:

npm config set prefix '~/.npm-global'

Open or create ~/.profile and add this:

export PATH=~/.npm-global/bin:$PATH

Add this also to your ~/.bashrc file (optional) :

export PATH=/home/username/.npm-global/bin:$PATH
export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript:/home/username/.npm-global/lib/node_modules

Refresh the files:

source ~/.bashrc

Test by running:

npm install -g jshint

source:

https://docs.npmjs.com/getting-started/fixing-npm-permissions

http://www.competa.com/blog/how-to-run-npm-without-sudo/


The directory is created once you deleted your first file.


Is it safe to disable the guest account in 12.04 LTS

AFAIK, Yes.

I can't think of any side-affects possible, just the gained security of not having guest access to your system. Granted, I'm a bit of a noob when it comes to internal matters of the system like this, but it would make sense that it wouldn't.


how to append difference in a file to another file

I found the answer on the net, it's comm utility.

Show lines that only exist in file a:

 comm -23 a b

Show lines that only exist in file b:

 comm -13 a b

Show lines that only exist in one file or the other:

 comm -3 a b | sed 's/^\t//'

I use it like this:

EDIT:
I forgot to mention, ClipIt "history" file  in data format so it must be converted to text at first because comm can not compare binary data files.

 strings history >>file1

 comm -23  file1 file2 >>file2

Another workaround for ClipIt history limit; I grabbed the source code of it and increased the max values. It's working for the time being


I have lost partition table for my USB Flash drive

You should be able to restore it with testdisk. Testdisk is in the Ubuntu repositories, install it with software center or apt-get

sudo apt-get install testdisk

Testdisk is a command line utility, there is a step-by-step guide (with pictures) here

http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step


You can install some Firefox or Chrome plugin for doing that, such as Video Download Helper.

Or, for Youtube an other popular websites, you can use KeepVid, wich works on the browser.

For the second question, I suggest you to create a new one. I hope it works to you!


The MAAS server shouldn't need to see the machine where juju is installed; instead, the machine running juju needs to be configured to use the MAAS server.

Please note that there's an error on that page: you almost certainly want to omit the admin-secret and default-series settings in the environments.yaml file.


How to remove black icons (Lock Screen, Log Out, Power Off, Suspend, Switch User) from GNOME Dash?

Here is the  gnome-shell-extension Hide System Actions  that will hide the below entries from Gnome's overview search..


How can I fix a very broken Ubuntu installation without losing data?

A reinstall is definitely your best option for getting Ubuntu working again.

Using the Live CD you can copy your data onto an external USB device (a stick or hard drive, for example).

If you do not have any external storage, and there is enough space on your existing hard drive, there is another more risky option; resize the existing partition and create a new partition to reinstall onto. Here are some instructions on doing this:

https://help.ubuntu.com/community/HowtoPartition/ResizingPartition

and here:

Why I'm seeing a lock besides the partition I'm trying to modify with gparted?

But be warned, resizing is potentially risky; if something goes wrong during the process, it could leave your data in an irretrievable state. Copying to another storage medium is definitely safer, because you can check the copy before deleting the original.


kubuntu find not working properly in home directory

I'm going to reflect some bias here, a bias which appears to be unpopular.  you see, I've been using Kubuntu and Ubuntu for various parts of a decade.  I cut my teeth on Kubuntu for over a year, and for about the past 9 years, I've been using Ubuntu instead.  I simply found too many unnecessary and nonsensical obstacles in Kubuntu that Ubuntu simply didn't have.

I don't claim to understand why Kubuntu seems determined to make people feel stupid, but I run into this a lot.

If you have a spare pc, or even a spare hard drive you can use for test purposes, please repeat your tests on Ubuntu and write back to tell us if you have the same problems in Ubuntu.  I doubt you will, but I'd like confirmation.


Select which terminal emulator is opened on shortcut

Apparently, konsole was set as the default program once the other was no longer available. I used

sudo update-alternatives --all

to reset it to what I was used to. (Thanks @DavidFoerster for the suggestion)


Ubuntu 20.04 - no menu bar in LibreOffice

Removing completely the indicator-appmenu applet from the panel solved the issue! The menu is back where it should be.
The question is, was the applet in the panel from the beginning (in that case it's actually a bug, it shouldn't be there) or I accidentally put it there while configuring the panel...


WiFi Connection not working for Ubuntu 12.04?

I suggest you take a look at this thread http://ubuntuforums.org/showthread.php?t=2194306
Entry #6 is probably what you are looking for.

This is apparently a common problem with HP. By removing the hp-wmi module as described in #6 your WiFi switch will probably work again.


In your case the swapfile is "/swapfile" – but you could change that to your liking, just replace "/swapfile" with your desired destination.

Best location is of cource opinion-based, but I would prefer fast storage (i.e. SSD - but keep in mind it has limited life span, so that is highly opinion-based), if the system swaps a lot.

EDIT:
If you'd like to use that sawp file every time you boot, you can add an entry to your /etc/fstab like

/swapfile    none    swap    sw      0 0

EDIT2:
You might consider using a drive wich isn't under constant high IO-load because of something else.


My laptop has both a 500 GB HDD and a 32 GB SSD, what's the best way to partition my Ubuntu Installation, and How?

Basically, This is more about how you use your system. Since you have tagged your question with "dual boot", I consider you will have Win7 or Win8 as your second OS. If you do not intend to use Ubuntu as your primary OS or do not want to install too many games/softwares then meeting the minimum Ubuntu Requirement+3GB on SSD will be enough for you.

Note, Software like Browser (Firefox) office suite (LibreOffice) is already included in the minimum requirement. In my opinion 10GB will be more than enough.

Windows8: 16GB (min. requirement) + 6GB-10 GB (for user files and software)
Ubuntu: 5GB (min. requirement) + 3GB-5GB (for user files and software)

Check this:
https://help.ubuntu.com/community/Installation/SystemRequirements
and http://windows.microsoft.com/en-us/windows-8/system-requirements

You should install softwares to HDD, which you don't use regularly or need storage in GB. Also move all user files like music, docs to HDD.


Try this

Username: ubuntu

Password: ubuntu

or

Username: ubuntu

No Password

Source: https://community.spiceworks.com/topic/560473-ubuntu-14-4-01-login


How to display partition used/free space in Nautilus like in Windows?

The default file manager, Nautilus , doesn't have such functionality. To my knowledge there's  no file manager out there that provides such functionality either.

You can, however, visualize usage by right clicking on each mounted (!) disk partition in the right side panel, via Properties menu:

There are  alternative ways, for instance via Disk Usage Analyzer, as Ben suggested. I've written a Udisks Indicator, which shows mounted partitions and their usage in top-right panel, so that could be another alternative. Screenshot is below.

There's also df and more user-friendly pydf program, which will allow you to show mounted filesystem usage in command line

$ df -h | grep '^/dev'
/dev/sda1       110G   62G   43G  59% /
/dev/sdb6       399G  149G  230G  40% /mnt/HDD
$ pydf
Filesystem Size Used Avail Use%                              Mounted on
/dev/sda1  110G  61G   43G 55.9 [###############...........] /
/dev/sdb6  399G 149G  230G 37.3 [##########................] /mnt/HDD
/dev/sda1  110G  61G   43G 55.9 [###############...........] /var/lib/docker/aufs

There's plenty of other alternatives , but if you want it done specifically via Nautilus, then answer is unfortunately it's not possible. But you can always submit a feature request to the developers, which I think would be a quite useful feature to have, and community might agree with you.


Screen man page mentions the following syntax:

  screen [ -options ] [ cmd [ args ] ]

And this:

  In addition, new windows can be created by running a command like:

          screen emacs prog.c

  from  a  shell prompt within a previously created window.  This will not run another copy of screen, but will
         instead supply the command name and its arguments to the window manager (specified in  the  $STY  environment
         variable)  who will use it to create the new window

So put your codeblock into a script , and launch from a terminal it like so

screen myScript.sh


Why connection with sakis3g not detected by network manager

Add it to the code in Launcher.. When you click connect launcher that will too execute and stop network manager.. Thats how i use..


PC: Have you tried turning it off and on again
Me: Yes
PC: Ok,  then I have no I idea what wrong and I will not work.
Me*(4 days later)*: Lets do that again, this time keep a monitor connected and turned on.
PC: fine, I can work with that.

Apparently a restart with the external monitor attached solves the problem :)

I don't know the root cause of why this happened but will update this answer if I find out more.


There are a few possibilities to do this.

First would be to install Ubuntu using Wubi. Wubi installs ubuntu in a single file which acts as a partition.
The other way would be to install Ubuntu on a ext4 partition and then install the boot on the partition instead of the MBR and then follow instruction on this link. I would recommend ext3fsd instead of Ext2 IFS for the previous link as the former seems more recent and and better support for ext4. Installing the FS driver would allow windows to access the partition to boot it and then edit boot.ini to add linux partition to it.


How do I make a bootable USB from Windows?

With UNetBootIN, for example. I like Pendrive Linux Easy USB Creator very much, but it doesn't support béta's without some tips 'n tricks. Testing an alpha isn't as simple as you think by the way, some experience is useful ;)

Download for Windows

Unetbootin is available for Windows, Mac, Linux (Lots of distros)


Auto restarting asterisk and mysql using upstart

Just add the respawn-option to your upstart-job (for mysql or asterisk).

You may also additionally add the respawn limit-option:

respawn limit COUNT INTERVAL

"If the job is respawned more than COUNT times in INTERVAL seconds, it will be considered to be having deeper problems and will be stopped."

E.g.

respawn
respawn limit 3 60

So your process will be automatically restartet if it crashes, but if it crashes more than 3 times in 60 seconds, it will not be restarted any more.

Documentation: Upstart-Cookbook

Here is an example upstart-job for asterisk, taken from http://www.digium.com/

# asterisk
#
# Upstart control file for the Asterisk PBX
#
# To install, rename this file to 'asterisk' and copy it to /etc/event.d/
# On Debian: copy to /etc/init/
#
# To start asterisk manually:
#     sudo start asterisk
#
# To stop asterisk manually:
#     sudo stop asterisk
#
# Asterisk is started with an "interactive console", though redirected
# to/from /dev/null . The concept of a main console is bad. OTOH, the main
# process should not detach from the console if we work with upstart and
# alike.
#
# The username 'asterisk' is currently hardwired here, and likewise the
# varrundir.
#

description "Asterisk PBX"
#version     "1.8"

start on runlevel [2345]
stop  on runlevel [!2345]

pre-start script
  # Since Ubuntu clears /var/run on reboot, create this before we try to start
  if [ ! -d /var/run/asterisk ]; then
    mkdir -p asterisk /var/run/asterisk
    chown asterisk: /var/run/asterisk
  fi
end script

respawn
exec /usr/sbin/asterisk -U asterisk -g -f


How to load unity-launcher in standalone session?

That setup is actually using the Unity 2D launcher. The Unity launcher and top panel are tied together in a Compiz plugin and can not be used separately. Luckily, the 2D launcher aims to be nearly identical to the normal one.

In order to use the Unity 2D launcher with a different panel, you need to create a custom session which you will load a login time.

First you need to create a desktop file that LightDM will read. Open your new file with a terminal using:

gksu gedit /usr/share/xsessions/custom-session.desktop

Then add this text:

[Desktop Entry]
Name=Custom Session
Comment=This is my custom desktop
Exec=/usr/local/bin/custom-session
Type=Application

This will add a new login option to the login screen. It will run the contents of /usr/local/bin/custom-session Now create that file:

gksu gedit /usr/local/bin/custom-session

Add:

#!/bin/bash
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
compiz --replace ccp & wmpid=$!
sleep 1
if [ -f ~/.custom-session ]; then
source ~/.custom-session &
else
xterm &
fi
wait $wmpid

This will launch a compiz and run the contents of ~/.custom-session which will define the other programs you want to have started. But first, lets make this executable:

sudo chmod 755 /usr/local/bin/custom-session

Now we'll create ~/.custom-session:

gedit ~/.custom-session

Now we'll add the programs that need to run on login:

#!/bin/bash
gnome-settings-daemon &
unity-2d-panel &
nautilus -n &
nm-applet &

You'll also need to add what ever program you want to provide the top panel to that file.


I've altered a program found on internet and created WLStream. It enables you to stream audio from a Windows output device so Pulse Audio will be able to play it back on a Linux host. The communication between the two is done with plink from Putty. There's a delay in the audio stream caused by the network, I'm sure if you alter the privilege on the TCP packet sent from plink or change your router's configuration as you would for VOIP it'll reduce the audio's stream lag but my research didn't go any further. WLStream can be compiled using Visual Studio 2017 and there's a pre-compiled from the last version here.


How to find lines matching a pattern and delete them?

Try sed:

sed -i '/^HERE IT IS/d' <file>

WARNING: Its better to take a backup when using -i switch of sed:

sed -i.bak '/^HERE IT IS/d' <file>

The original file will remain as <file>.bak and the modified file will be <file>.


Clementine works perfectly for me. Rhythmbox screwed up my playlists, duplicating existing items in them multiple times.


Zombie process (kill both child and parent process)

You can't kill a Zombie, its already dead. It is just talking an entry in the process table before the parent process do wait(2) to read it's exit status.

On a different note, to kill the parent process of any process (including Zombie), you can easily use a combination of commands ps and kill:

ps -p <pid> -o ppid=

will give use the PPID (Parent Process ID) of the process having PID (Process ID) <pid>.

So for example, to find the PPID of process having PID 2345:

ps -p 2345 -o ppid=

You can pass it to kill using command substitution $():

kill "$(ps -p 2345 -o ppid=)"

On the other hand to kill a process using its PPID, use pkill:

pkill -P <PPID>

For example to kill the process having PPID 1234:

pkill -P 1234

Also unless absolutely necessary do not use SIGKILL (kill -9) as it does not let the process to do any cleanup and might result in unwanted effects.


Is it possible to post images with Gwibber?

The latest version Gwibber 3.1.0 can upload images to imageshack, shorten the url and put the link into the messagebox. You'll find a "+" icon next to the send button to upload the image. In order to install this version in Ubuntu Natty and prior, you've got to use the Gwibber-Daily-PPA.

sudo add-apt-repository ppa:gwibber-daily/ppa
sudo apt-get update && sudo apt-get dist-upgrade

Ubuntu Oneiric 11.10 will ship with a version of Gwibber which is new enough for this feature, so that you won't have to deal with the PPA anymore.


How to Alt-Tab switch between windows without popup?

A quick look at the CompizConfig Settings Manager (CCSM) suggests this is not possible for the default Unity switcher. I don't see any settings there related to time-out, so I'm afraid the simple answer is "no", unless someone can tell you about hidden settings somewhere.

What you could do is switch to an alternative switcher. In CCSM you can disable the Unity switcher and replace it with e.g. the Static Application Switcher. That one allows you to set the Popup Window Delay which enables you to hide the window list for the first X seconds. I've left it at the default value of 0.2, which is high enough for the popup not to show up if I know where the window I want is, but low enough to show the popup if I don't know where to find that window.

Just keep in mind that this alternative switcher doesn't look as pretty as the default switcher. However, it does offer a wealth of other functions (for example, this one allows you to click the window you want to switch to). Also remember that CCSM can be a dangerous programme and might break Compiz if you select the wrong window.

If you want I could upload a screenshot, just let me know :)


It's in the universe repo. You can switch to that by executing:

sudo add-apt-repository universe
sudo apt update

You can then install all the available packages the normal way:

sudo apt install pcs


(Before doing anything with the disk.img, I would back it up.)

If the disk image is of the whole disk (eg, /dev/sdb), rather than just one partition (/dev/sdb1) you cannot mount the image directly (since the file will start with the disk partition table rather than the data partition). You can check if the image contains recogniseable partition headers with:

fdisk -lu disk.img

Which should indicate the presence of probably a single FAT32 partition, and tell you the offset in the img file (the number in the Start column). Then you can try and mount that partition using:

mount -o loop,offset=START disk.img MOUNTPOINT

Where START is the offset in bytes found with fdisk and MOUNTPOINT is somewhere to put it.

If the disk image does not contain any recogniseable partitions there may still be readable bits of data. Tools like photorec can be used to search the disk image for anything that looks like a recognisable file and try and extract it. See DataRecovery for more information on tools like this.


Unfortunately, there is no fix. Hopefully, the kernel will add better support one day, but for now, the most you can do is use cpulimit -l 50 on your browser, and hope for the best.


Same thing happened to me after updating to 17.10. I've found the solution on this thread

I hope you can fix your problem.


Gimp starts but then doesn't open (Ubuntu 14.04 LTS )

I think finally uninstalling and installing again did the deal. Gimp is working properly again. Thank you.


Unable to connect to localhost after installing Apache

try using http:// for localhost instead of https://

http://localhost

https:// is for secure servers also the default local ip address is 127.0.0.1 not 127.0.1.1


How to make Unity's Dash save the results filtering?

I do not think you can. These seems to be stored in memory only and lost every time the service is restarted.

You could however uninstall scopes that you do not want to use. You could also disable "remote" scopes by going to system settings, privacy, and turning off "Include Online Search Results".

Failing that, you could always remove the .service files from /usr/share/dbus-1/services/

I STRONGLY recommend AGAINST doing that, but it is an option.

You can also file a feature request with the lense/scope maintainer.

I believe the ability to save previous seach results and filters would be done at the lense/scope level and not at a unity level. Though they may not be true.

TL;DR; You can't as of today.


Your PC does not meet the minimum system requirements for the software:

OS              : Ubuntu 16.04 or Steam OS 2.0
Processor       : Intel Core i5-2500K/AMD FX-8350
Memory          : 8 GB RAM
Graphics        : Nvidia GeForce GTX 680/AMD R9 270X graphics card or better*
Storage         : 67 GB available space
Additional Notes: *NVIDIA graphics cards require driver version 375.26. AMD graphics cards require MESA 13.0.3 or better. Intel graphics cards will not be supported on release.

Source: http://store.steampowered.com/app/236870/

There's no point in complaining to the developers.


Ubuntu detects that I don't have at least 4.4 GB free space, what should I do?

To format the hard disk select erase entire disc and install ubuntu after selecting install ubuntu. This will erase and reformat the entire hard drive before installing Ubuntu.

If you want to install Ubuntu alongside windows,
you should load windows and delete some files (5-10gb minimum) to create space,
then defragment your hard drive before installing Ubuntu.


Setting up an ark server through google cloud ubuntu?

From what I've been reading the Google Compute instances don't support the appropriate GPU passthrough to enable game streaming. Their instances are optimized for rendering and calculations and don't have the right setup for gaming yet (no monitor/output attachment).


/usr/local/bin first in PATH, but executable in /usr/bin found first

The explanation was given by the hash command:

  hash command maintains a hash table, which has the used command’s path
  names. When you execute a command, it searches for a command in the
  variable $PATH. But if the command is available in the hash table, it
  picks up from there and executes it.

  You can delete a particular command from a hash table using -d option

So I did:

buildbot@ip:~$ hash
hits    command
   3    /usr/bin/which
   1    /usr/bin/vim
   2    /usr/bin/cmake

buildbot@ip:~$ $ hash -d cmake
buildbot@ip:~$ hash
hits    command
   4    /usr/bin/which
   1    /usr/bin/vim
buildbot@ip:~$ cmake --version
cmake version 2.8.7
buildbot@ip:~$ which cmake
/usr/bin/cmake

Why is it not finding /usr/local/bin/cmake?

$ /usr/local/bin/cmake --version
-bash: /usr/local/bin/cmake: Permission denied

So this user didn't have permission to access that file.

I reinstalled cmake and that fixed it.


This is done pretty often, so it's on the Ubuntu site:
http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows


How do I swap between Unity-2D and Ubuntu Classic?

Sure.
First logout. Then as shown below in image, select Ubuntu Classic instead Ubuntu 2D

Ubuntu 11.04

Ubuntu 11.10


sources list path error - how to reset it?

Go to /etc/apt folder. Check what happened to the original sources.list file. If installing OwnCloud renamed your sources.list file, then simply rename it back. Also, check if the sources.list file was damagingly modified - if so, then delete it and generate a new sources.list file.  If your sources.list file was deleted, then I suggest you generate another sources.list file using this website. And then put that file in /etc/apt. If you want more information about this then here is the official Ubuntu Documentation about sources.list and a related question on Ubuntuforums. I suggest you read them first before proceeding.  Hope this helps. :D


Is it normal for my memory usage to be 8gb?

There is (Most times) a problem called memory leak in programs. Browsers like Chrome, Opera, IE, Firefox and others are known for this (Firefox was the king of it until recent versions). Leaving Chrome/Chromium, even without doing anything on them after checking several pages will slowly start to increase the memory usage for "no apparent recent". The memory leak increases or has a bigger chance to increase (And increase faster) if the application you use uses more memory. In your case you have also Virtualbox and even if I set virtualbox to a guest of 1GB, about 30 minutes later you will see that the 1GB just went to 1.2GB,  then 1.4GB and so on. This is just common bugs that need fixing. The same goes for Nautilus and any other app that has a lot of activity.

Would be nice to know how long you had them opened. If it is less than an hour then there might be something really wrong there but if it is more then am sorry but it is something I have adapted to. Normally I close virtualbox every so often. Same for browsers.

This might not explain an almost 100% drain but if given enough time it will be the first reason.

Would also be nice to see top output, if you are using PAE on a 32 Bit Ubuntu with 8GB Ram or a 64 Bit and any other tools loading in the background.

INFO - http://en.wikipedia.org/wiki/Memory_leak (Did not know the actual term Memory Leak existed. I thought I have made the name up.)


Somewhere node.js and npm was not compatible with the given configuration that why it was creating problem. I have update both and got the successful installation.


How do I install Ubuntu on a new partition?

First you need to resize your windows 7 partition and create a new partition for installation.

If you are more familiar with windows you can do it from windows disk management utility or using gparted in ubuntu.

Take Backup before doing anything else. Also create recovery media s for restoration. You might loose ability to use recovery partition in easy way

In Windows

Open Run prompt by pressing Win + R. Type diskmgmt.msc to open up the management console.
Right click on C: drive containing Windows 7 and choose shrink. Follow the wizard to shrink it as much as possible.There will be unallocated space now. Close the window.
Now to create an extended partition. (There difference between primary partition and logical partition,to avoid multiple OS installation problem we are creating this) To do so, press Win, search for cmd. Now right click on it and choose run as administrator.
In console type diskpart, when diskpart changes the prompt. type following commands one by one

select disk 0
create partition extended

Now again open disk management by following step 1.
Right click on the unallocated space and select New simple volume, change the amount of space you want to be in ubuntu drive. choose do not format this drive in the next step. We will use this volume as for ubuntu installation.
The rest of unallocated space you can create as many parition as you want by following the sixth step and formatting to ntfs (if you want them to use in windows).

A good partition tutorial is here if you are in any doubt

Now get back to ubuntu installation:

Boot up using the live cd/usb. Now choose something else option.
Gparted tool will open with your current disk configuration. Figure out the space you reserved in step 6 for ubuntu. Click on that, choose delete. It will became free space.
Creating swap space: click on the free space , the click on add. Now select file system as SWAP and size as 1GB (swap space is alternative to RAM, depending upon ram size you can decide )
Creating the ubuntu disk: Now after adding swap space, there will be free space. Click on that, again click add. This time choose file system as ext4 and for mount point
select  /  from the drop down.

A reference image of my system :

Now go forward with your install. Ubuntu and windows duel boot will ready in minutes. :)


Don't you forget to enable it effectively in Firefox, because after 52 version, you need to create a value at about:config

Type about:configat address bar and accept risks :);
Create a new  Boolean Preference value, by right-clicking on name title.
Type plugin.load_flash_onlyand set it false


Rename all the files "file.txt" in directory with multiple subdirectories

Yet another one to avoid absolute path trickery:

find directory1 -name file.txt -execdir mv {}  new_file.txt \;

execdir will run the specified command from the subdirectory containing the matched file. This even eliminates the need for quoting the filename, which we know to not contain any spaces.


You need to edit the /etc/hosts and the /etc/hostname file as well. The /etc/hosts file maps IP addresses to hostnames and the /etc/hostname file contains only the hostname. After editing the /etc/hosts file, edit the /etc/hostname file and write your new hostname in it. To apply changes:

systemctl restart systemd-logind.service

You can also use the following command to change the hostname:

hostnamectl set-hostname new_host_name


Most lightweight screen recorder/caster software?

A hardware option, such as an HDMI (or other compatible) video recorder can simultaneously record your screen without affecting system performance.

Hardware isn't a software solution, and yet it is the most "lightweight screen recorder".


Do you search the location on disk, or applications to change them?

 locate icons | egrep "icons$"

will find a lot of directories with icons.


mobile broadband signal strength indicator in ubuntu 15.10 weaker than in window 10

It's not a issue with Operation System . Windows have slow refresh rates than linux.This may make you feel that it's getting more signal strength on Windows than linux infact linux has better Services and memory management to provide you more speed than windows.


Why won't my ~/.Xmodmap file load on login?

I know it's silly but as a workaround you could just autostart xmodmap ~/.Xmodmap.

Also you could check /etc/gdm/Xsession for the line usermodmap="$HOME/.Xmodmap" and if it isn't there just append it at the end of the file. If you're the only user of the system just put your changes into /etc/X11/Xmodmap.


What kind of code do keyboard "custom shortcuts" accept

The first thing I've been taught to do when I use Debian or Ubuntu is to create a shortcut (in my case Ctr+Alt+T) to open a terminal. To do this I create a new keyboard shortcut (in the X system's options>keyboard) with the code x-terminal-emulator

There's two types of shortcuts. Some of them are managed by desktop environment - things like Ctr+Alt+T. Different desktop environments manage different set of shortcuts. Such desktops as GNOME, Unity, LXDE, MATE, etc - they have code built-in for that and you can't really change those shortcuts without recompiling the desktop environment code. Desktops like Openbox, Blackbox - they don't manage these shortcuts. What you've been taught should be considered within context of your desktop environment. You should not need to declare shortcut for x-terminal-emulator for the desktops like GNOME and others I've mentioned earlier, because they already manage that.

  However, when I try to create shortcuts for other commands I can use from the terminal (such as firefox or echo "$"), the shortcut does not work.

Custom shortcuts - what you declare yourself - operate on executables, that is you have to specify valid file existing on disk, such as /bin/bash or at least a command that exists in one of directories listed under $PATH variable. The desktop environment will run execve() syscall to start that app when you press the shortcut. This is also the reason why echo $? doesn't work - there is no shell to understand what $? means. The shell variables only have meaning inside shell. So what do you do? Tell the shortcut to start the shell ! Usually this is done via bash -c 'echo $?' for short commands or use a script with appropriate #! line at the top of the script. So key thing to remember shortcuts don't run shell commands, they run executables. To give a practical example where bash -c '...' is used, see How to create a shortcut that executes an xdotool command to simulate a key press?

AS for why firefox didn't work for you, firefox may be checking for existing open windows or there is another error. Consider doing bash -c 'firefox > 2>&1 foxlogfile.txt' to find out the cause of the issue or any errors that may appear.

  I can't seem to find good documentation about what kind of command the create shortcut does take, but it does not quite seem to accept bash commands.

The short answer - there's no such documentation, really. So long as you remember that shortcuts use executable files instead of shell commands, that's all you really need. And of course you need to know what is the method of declaring shortcuts on your desktop - Openbox method is different from GNOME for example.

P.S: Actually, there is a third type of shortcuts but they're not related to desktop environment, i.e. they are not GUI shortcuts. bash reads ~/.inputrc file, where you can declare certain commands to be executed for particular key combination. However, this is outside the scope of this question and is a different topic. See this for an example.

P.S.2: Desktops based on GNOME, such as Unity, utilize GSettings and DConf database to apply particular settings to each user of desktop. As such, shortcuts under those environment can be controlled and set via command-line, but the same concept applies - they have to be either executables or something the desktop environment recognizes because it's in desktop environment's code. See this article about one of my scritps to disable Super key under Unity and Jacob Vlijm's answer for setting shortcuts via terminal ( remember this applies to GNOME-based ones only).

See also

Do GUI based application execute shell commands in the background?


I am thinking that you could look into the BASH history file? From the BASH MAN page "On startup, the history is initialized from the file named by the variable HISTFILE (default ~/.bash_history)."


pc directly booting into Ubuntu after dual boot

I think GRUB is not working in your system.
Make sure you installed Windows first, then Ubuntu, leaving a linux-swap partition available.
If GRUB doesn't open for you, try repeatedly pressing Esc when booting, then you should get the GRUB menu and see your Windows partition there. If GRUB doesn't open yet, then hold Shift while booting to get GRUB.
If your issue is that Windows does not appear on GRUB, please inform it.


Regarding the ldconfig issue, the solution was offered by Mr.steeldriver in
the comments below:
AFAIK that's normal - if you want to "see" something, run it in verbose mode, like sudo ldconfig -v – steeldriver 1
THANK YOU VERY MUCH !
The change reqired as described below:
cat /etc/hostname              #You get your hostname here
sudo nano /etc/hosts           #You make changes here (save after CTRL X)

127.0.0.1 localhost #Original code
127.0.0.1 localhost localhost.localdomain ubuntu-server #Changed code with hostname


¨USB device: card reader¨ is draining the battery even if it is not used

I'm using the following command to disable the card reader on my MBP 11.1 with Ubuntu 15.04:

echo 1 > /sys/bus/usb/devices/2-3/remove

In case you have another MBP revision or different Ubuntu version, you may have to use another device ID.

Also, I believe that WiFi, not the card reader, is the main battery-eater, appearing to consume aroung 11-15W (powertop 2.7) even with power management enabled.


How to disable mouse touchpad while typing on Dell XPS 13 (Ubuntu 16.04 LTS)

To Disable Touchpad Goto ->
System Settings -> Mouse & Touchpad : in the Touchpad section switch from ON to OFF


I don't know if my idea is the most elegant, but it works:

tree / | tail -1 > output

It will take a while until the tree will finish, but you will get a number of directories and a number of files, in your file "output".


Try this:

1.Open Disks

2.Mount the NTFS (Windows) partition

3.Access the windows partition

Normally it should be possible only with the filemanger PCManFM.


Create subdirectories named as files in a main directory and move files to corresponding subdirectory

Here's how, handling funny filenames:
#!/bin/bash
files="$(\
    find . -maxdepth 1 -type f -print0 | \
        xargs -0 -r stat --format=\"%N\" \
 )"
for i in $files ; do
  mv "$i" "X_$i" && \
    mkdir "$i" && \
    mv "X_$i" "$i/$i"
done

find . -type f -print0 | \
        xargs -0 -r stat --format=\"%N\"

Read man find xargs stat


The "official" way would be to setup a systemd service that executes this command when the system starts up. The "easy" way would be to set up a cron job that runs the command on reboot. The venerable cron is nowadays setup trough systemd by default on an Ubuntu install, so officially supported. A third, easy easy way would be to run the command from the venerable rc.local script. This, however, is not anymore by default setup in a default Ubuntu install since several versions.


The OPs solution didn't work for me, but has given me a push to the right direction. Indeed, if the IR cam is separate from the main one, it can be detached by removing power from it.

Quick google for "ubuntu disable usb device" has shown this page - https://karlcode.owtelse.com/blog/2017/01/09/disabling-usb-ports-on-linux/

In short - find the USB port to which the camera is connected (1-1.6 in the example below, but it for 1-5 for my laptop):

$ for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done
/sys/bus/usb/devices/1-1.2/product
Dell USB Entry Keyboard
/sys/bus/usb/devices/1-1.6/product
Webcam SC-13HDL11624N
/sys/bus/usb/devices/2-1/product
Amazon Kindle
/sys/bus/usb/devices/2-2/product
USB Receiver
/sys/bus/usb/devices/usb1/product
EHCI Host Controller
/sys/bus/usb/devices/usb2/product
xHCI Host Controller
/sys/bus/usb/devices/usb3/product
xHCI Host Controller

Then power it down:

echo '1-1.6' | sudo tee /sys/bus/usb/drivers/usb/unbind

Or do this on reboot via cron:

sudo crontab -e

and add the following there:

@reboot echo '1-1.6' > /sys/bus/usb/drivers/usb/unbind

(of course, replacing "1-1.6" with "1-5" or whatever port your camera is connected)

Similar question and solution is - Is it possible to turn off a specific USB port so it doesn't accept any device?


How to check if the X11 display manager is installed?

To see if you have x11 installed, simply run this command from a terminal:

dpkg -l | grep xserver-xorg-core

and if you get something like:

ii  xserver-xorg-core                      2:1.19.5-0ubuntu2                                          amd64        Xorg X server - core server

then you have the server installed.


Ubuntu 20.04 server blocks at boot cloud-init and login

So after L O N G hours of trying to understand what was going on, I finally got it working. The error was in the network-config file. I had a symbol which was not marked as a comment and hence the cloud-init was not starting correctly because the network-config file had threw an error. However this is NOT mentionned in any status ! There is only a warning. So be extremely carefull at how your network-config file is written. If there is an error there, the cloud-init doesn't boot correctly, and for some reason, both ubuntu login and password are not accepted.


"Error Loading Operating system" when booting from usb to install 12.10 64bit

First you have to make you USB bootable with UNetbootin and then in your BIOS set boot priority to boot first from your USB. Then it should work fine. After you install Ubuntu, remove your USB and pc should boot into the Ubuntu installed on your drive.


Installing Ubuntu over windows and existing partitions

During install Ubuntu will ask you how you want it to be installed.
You can choose to install it in an existing partition, leaving the other partitions untouched.
You can choose to let ubuntu take the whole disk.
Or you can choose to do it manually which is not really difficult.

You can always cancel the install at this point if you change your mind and nothing will be changed.

But beware:
After you made your decisions and commit the changes they will be
written to disk.
But Ubuntu will warn you when this is about to happen so don't worry.

Good luck :-)


having trouble installing Ubuntu 13.04 on Windows 8 machine (HP ENVY 17t j000)

How I did it (though with Mint, not Ubuntu):

http://larrymulcahy.blogspot.com/2013/08/hp-envy-17t-j000-laptop-2.html

I'd be eager to hear if anyone has got the hybrid graphics feature of
this hardware to work in Linux.


Silhouette Cameo Stencil Machine on Ubuntu

Tux Plot v4 Pro can be used for the Silhouette Cameo Stencil Machine and is available from its Homepage

Tux Plot


Give mkusb a try, you can install it to 16.04 and use it to install 14.04, Live or Persistent to a USB drive.

It is great for making bootable pendrives with persistence partition, (if desired), and a Windows/Linix accessible partition in the left over space. The pendrive can also be used to install Ubuntu, but this feature is not forced on the user.

https://help.ubuntu.com/community/mkusb


Should I use autoremove in these packages?

Run this command in Terminal:

uname -r

Only if the output is not:

3.16.0-40-generic

... you can remove the packages.

Afterwards, reboot the machine and try again, maybe you have upgraded your kernel without rebooting after upgrading.


Installing Ubuntu in most cases does not require any drivers as Ubuntu comes with open-source drivers for most of the hardware.  So you can install Ubuntu along with your current operating system (dualboot) or erase the current operating system and install Ubuntu.
More instructions on installing are available here:
1.Ubuntuwiki

2.Ubuntugraphicalinstall


How do I set up a firewall/iptables using rc.firewall?

Test this:

Open a terminal.

Run it:

sudo -i
mv /etc/rc2.d/rc.firewall /etc/init.d/
chmod 755 /etc/init.d/rc.firewall
update-rc.d rc.firewall defaults


If GUI is troubling you, login through CUI(Ctrl+Alt+F1)

Check if "ppa-purge" package is installed or not.

Run

dpkg -l | grep ppa-purge

If it returns the value, "ppa-purge" is installed. If not, install it as follows;

sudo apt-get install ppa-purge

After that run the following commands;

sudo ppa-purge ppa:gnome3-team/gnome3-next
sudo ppa-purge ppa:gnome3-team/gnome3-staging
sudo ppa-purge ppa:gnome3-team/gnome3

sudo apt-get remove gnome-shell ubuntu-gnome-desktop

Reboot system and login through Unity.


How to make folders like "System Volume Information" or "RECYCLER" hidden, just like it is on windows?

Just create text file .hidden on your external hard drive, and add folders you wish to hide, like this:

found.000
$RECYCLE.BIN
RECYCLER
System Volume Information

After that make sure to refresh the view (F5) and the folders should now be invisible.

PS. if you wish to see/hide hidden files/folders press Ctrl+H.


User account doesn't display anything except background and cursor

Your original problem could have been solved by opening a terminal and issuing the command:

unity --reset

It's likely that your easiest course of action at this point is to:

Boot from live installation media (CD/DVD/USB)
Select "Try Ubuntu without making changes to your computer"

Mount the drive that contains your user files, back them up by copying them to the aforementioned windows partition or other available media as desired.

Reinstall.

In future, I highly recommend backing up regularly and prior to making any changes to your system.


Is it possible to reorder my workspaces?

I have been looking for an answer to this question for quite a long time but recently I had stumbled upon the answer myself.

Solution:

When you hit Windows+S to go to workspace switcher, in that view you can quickly double click on any visible window in any workspace and drag that window to any other workspace.

This way you can re-order workspaces.

I am a huge user of workspaces on a daily basis and I find this little trick very helpful to re-order my workspaces.

Hope it is helpful.


Problem running OBS in ubuntu studio 19.10

Open your prefered text editor
Write in there LIBGL_ALWAYS_SOFTWARE=1 obs
Save the file on desktop with name run_obs_studio.sh
Right click on file, Click Properties, go to Permissions tab and make it executable.
Launch the file and you are done.

This work around fixed the same issue happened with my installation.


I want to amend each line in a Text file using sed or alternative solution

With sed:

sed 's/.*/<before> & and <after each line>/' input.txt > output.txt

Explanations

s/x/y/ – substitute x by y
.* – take the whole line
& – get matched text

The rest is just the text you want to add before and after &.


First and foremost have you tried setting the system up to just mirror the contents on every screen? That would make it redudant to have any primary screen in place.

However

You can try to use xrandr to set your primary screen:

to install xrandr run

sudo apt-get install xrandr

in your terminal or find it in the software center

to find your current configuration run this command in your terminal

xrandr --current

here you should see every display output named

find the one you want to use like HDMI-0 for example

set your primary output display

xrandr --output <output device name> --primary

example case would be then "xrandr --output HDMI-0 --primary"

to apply the changes you made on every relog you can add them to the .xprofile file in your home directory run this in terminal to edit it

gedit ~/.xprofile

here add the complete xrandr command you used.
example case would be:
"xrandr --output HDMI-0 --primary"

After you are finished with your changes to .xprofile run

chmod +x ~/.xprofile

to allow the system to run the file when the time comes and reapply the changes.


Did you tried to download to different folders ?, it seems that it don't have write permission to folder where you tried to download file and you can view/edit because it is downloaded to /tmp directory...(I cant test my theory because I don't have access to any ftp at the moment)


Can I set up my xfce workspaces differently?

If we limit the setup to have a different set of launchers per desktop it is not very complicated. What we need is a script, running in the background to keep track of the current workspace and automatically alter the set of launchers accordingly.

1. A set of launchers per workspace

Let's say I have four workspaces, I want the following launchers to be available on the different workspaces:

workspace 1 > workspace 2 > workspace 3 > workspace 4 >

Workspace 1: Firefox / Idle
Workspace 2: Gcolor2 / Gimp Image Editor / Inkskape
Workspace 3: Abiword / Gnumeric / Mail Reader
Workspace 4: Mines / Sudoku

How to set up

The script uses wmctrl:

sudo apt-get install wmctrl

In your home directory (not in a subdirectory, but on the "first" level), create a directory (exactly) named:

desktop_data

inside this directory, create for each of your desktops, a folder named (exactly):

desktop_1
desktop_2
desktop_3
desktop_4

Create launchers for all applications (for all workspaces) on your desktop and copy them to the corresponding folders.
Copy the script below into an empty file, save it as change_launchers.py. Test-run it by running in a terminal window the command:

python3 /path/to/change_launchers.py

If all works fine, add it to your startup applications

The script

#!/usr/bin/env python3
import subprocess
import os
import time
import shutil

home = os.environ["HOME"]
desktop_dir = home+"/"+"Desktop"
data_dirstr = home+"/desktop_data/desktop_"

get = lambda cmd: subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8")

def get_desktop():
    return [l for l in get("wmctrl -d").splitlines() if "*" in l][0].split()[-1]

while True:
    curr_dt1 = get_desktop()
    time.sleep(1)
    curr_dt2 = get_desktop()
    # alter the set of launchers when workspace changes
    if not curr_dt1 == curr_dt2:
        datafolder = data_dirstr+curr_dt2
        for f in [f for f in os.listdir(desktop_dir)if f.endswith(".desktop")]:
            subject = desktop_dir+"/"+f
            os.remove(subject)
        for f in os.listdir(datafolder):
            subject = datafolder+"/"+f; target = desktop_dir+"/"+f
            shutil.copyfile(subject, target)
            subprocess.call(["/bin/bash", "-c", "chmod +x "+target])

Note

In different localized versions of Ubuntu, the name of the "Desktop" folder may differ (In Dutch: "Bureaublad"). If in your Ubuntu version the name of the desktop folder is not "Desktop", change it in the line:

desktop_dir = home+"/"+"Desktop"

2. Extending possibilities, launchers and links

If we add a few lines to the script, the setting-per-workspace options can be extended with a altering set of links to directories:

On one workspace we have a e.g. a link to the Documents folder, combined with launchers of office applications:

On another workspace we have a link to the Pictures folder, combined with launchers of Image editors:

How to setup

The setup is pretty much the same as in option 1, but additionally, in the data folders (see option 1), create links to folders (using ln -s <source> <destination>) you'd like to be available on the corresponding workspace:

The script

#!/usr/bin/env python3
import subprocess
import os
import time
import shutil

home = os.environ["HOME"]
desktop_dir = home+"/"+"Desktop"
data_dirstr = home+"/desktop_data/desktop_"

get = lambda cmd: subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8")
def get_desktop():
    return [l for l in get("wmctrl -d").splitlines() if "*" in l][0].split()[-1]

while True:
    curr_dt1 = get_desktop()
    time.sleep(1)
    curr_dt2 = get_desktop()
    # alter the set of launchers & links when workspace changes
    if not curr_dt1 == curr_dt2:
        datafolder = data_dirstr+curr_dt2
        for f in os.listdir(desktop_dir):
            subject = desktop_dir+"/"+f
            if os.path.islink(subject) or subject.endswith(".desktop") :
                os.remove(subject)
        for f in os.listdir(datafolder):
            subject = datafolder+"/"+f; target = desktop_dir+"/"+f
            if os.path.islink(subject):
                os.symlink(os.readlink(subject), target)
            else:
                shutil.copy(subject,target)


Systemd crashes after starting uWSGI service

Commenting out the RuntimeDirectory directive from emperor.uwsgi.service solved the problem for me.  I'm not certain why this fixes it, or if there are any negative ramifications to this change.

Incidentally, by enabling the emperor.uwsgi.service I was able to get it to start fine at boot, but stopping it locked up systemd and I had to force my VM to stop (couldn't reboot or halt) and then reboot it.


With two hard disks you have only two options for software RAID, which is RAID0 and RAID1.

RAID0 is pretty uncommon and only for setups where speed is important.
With RAID0 one will lose all data if one disk breaks.

RAID1 is mirroring, and perfect for your setup.
If one disk breaks you would have a mirrored copy on the other disk.

See also :

https://help.ubuntu.com/community/Installation/SoftwareRAID


Problem installing Oracle 10g Express edition

For:

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found

The solution is to simply edit it (as root) and remove a pair of square brackets on lines #108 and #110.

Type:

sudo -H gedit /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh

Scroll down until you find this:

if [[ -n "$LC_ALL" ]]; then
  locale=$LC_ALL
elif [[ -n "$LANG" ]]; then
  locale=$LANG
else
  locale=
fi

Then change it to this (remove a pair of brackets):

if [ -n "$LC_ALL" ]; then
  locale=$LC_ALL
elif [ -n "$LANG" ]; then
  locale=$LANG
else
  locale=
fi

Then click SAVE. Now try this command again to set your environment variables:

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

Nothing appears to happen when you do it but, it auto-sets your variables. DONE!

Enjoy.

Thanks to this blog: http://beardedmagnum.com/2007/09/15/oracle-xe-on-ubuntu/


Missing Human Icon Style after upgrading LibreOffice

Human icon theme for LibreOffice has been removed in 5.3 release, which is noted under "Feature removal" in the release note. The rationale is found in this commit description as quoted below.

  Drop 'Human' icon theme

  Was used in Ubuntu formerly, but they now switched to breeze.

  Human is mostly similiar to Tango, with some Ubuntu colors.

  So it should be enough to keep Tango.

There are two workarounds to get back the similar style:

Install Tango symbol style for LibreOffice (libreoffice-style-tango). This is available for all releases of LibreOffice.
Install Human symbol style for LibreOffice (libreoffice-style-human). This is available for LibreOffice 5.2 and older releases only. Requires downgrade, at least to LibreOffice 5.2 via PPA of 5.2.x series stable backports or DEB package of LibreOffice Still.

Tango is claimed to be "a good fallback, its high quality, consistent" icon set, when icons in Ubuntu Dapper were being worked back then. That claim remained true to this date.

LibreOffice 5.3 has better user experience in some sense and it is not worth to downgrade for using the unmaintained icon theme. Therefore, using Tango symbol style is the easiest workaround for being the closest alternative to Human symbol style.


Removed second monitor when laptop screen was disabled monitor stays off

Booting into failsafe mode AKA recovery mode by holding down the left Shift key as the computer starts to boot (If holding the Shift key doesn't display the menu press the Esc) should solve your issue.

Once you're in with a display you can do whatever suits you to get your screen back in normal boot mode.

you can for example reinstall graphics driver or change screen settings.


How to manage partition for setup ubuntu 12.10?

You can have only 4 (four) Primary Partitions on a disk. So you only need to create an Extended Partition and then have as many Logical Partitions in it as you might need if you will need more than 4 partitions on that disk. For Ubuntu it doesn't matter if it's installed on a primary or logical partition.

You can create something like 15GB Root partition (mounted as "/") and 15GB Home partition (mounted as "/home") (both Ext4 format) and then a Swap partition (twice or equal to the size of your RAM - there are different opinions). But you can also change partition sizes later although you'll need to boot from a live CD/DVD/USB (e.g. Parted Magic) to do it.