How to remove the "For Purchase" section from the Software Center? The Software Center has a section of For Purchase programs —see screenshot below—,
which is annonying me every time I want to install something.

Is there any way to remove or hide these programs from the Software Center?

  Links to answers:

  For 13.10 and higher →
  For 13.04 →
  For 12.10 →
  For 12.04 →
  For 11.10 and lower →
  Please leave a comment or send a mail to jmendeth@gmail.com
  if it's not working for you or you're having trouble!

For 12.04

Derived from  Pavlos G. answer and inspiration from Darmien answer.
Different version? Go to the list.
See the end of the post if you are in trouble and want to revert the changes.

1. Ignore the purchasable apps

Open a terminal (Ctrl + Alt + T) and type:

gksu gedit /usr/share/software-center/softwarecenter/db/update.py

And press Enter. You'll be prompted for your password.
Then an editor will appear. Locate the following lines (hint: Ctrl + F may help):

        doc = make_doc_from_parser(parser, cache)
        if not doc:
            LOG.debug("make_doc_from_parser() returned '%s', ignoring" % doc)
            return
        term_generator.set_document(doc)
        name = doc.get_data()

Immediately after those lines, paste the following (including the spaces!):

        if doc.get_value(XapianValues.PRICE) not in (""): return

Note: if you want to keep stuff that doesn't cost money, but has to be "purchased"
(like trials, magazines and other propietary stuff), replace ("") with ("0.00", "").

Save the file (Ctrl + S), open the Software Center and… voila!
There are no commercial programs!
You can close the editor and the terminal now.

2. Remove the "For purchase" channel (optional)

To also remove that "For purchase" item in the menu, open a terminal and type:

gksu gedit /usr/share/software-center/softwarecenter/backend/channel_impl/aptchannels.py

Locate these lines:

        if get_distro().PURCHASE_APP_URL:
            channels.append(for_purchase_channel)

And disable them by putting a # in front of every line:

        #if get_distro().PURCHASE_APP_URL:
        #    channels.append(for_purchase_channel)

Save and enjoy a software center without ads!

Side notes: The. files. are. packaged.

What does this mean, you ask? This means that,
whenever you upgrade your Software Center, the changes
will be reverted and you'll have to do this steps again.

Undo the modifications

If you want to restore the original state of the files,
open a terminal and type:

sudo apt-get install --reinstall software-center && exit

Again, you will be prompted for your password, this time on the terminal.
Type it and press ENTER. Don't worry if nothing appears when you type, it's to hide your password.
The terminal will automatically close when finished.

You can do this more simply by selecting View -> Canonical Maintained Software instead of All Software. This has the benefit of not being overwritten by software updates.

This may hide some additional items but at least it gets rid of the annoying magazines and for sale software in my experience.


Ubuntu 20.04 Server install from USB - Sorry there was a problem completing the installation New NUC10 (BXNUC10i5FNH4) with no operating system and downloaded a 20.04 Server ISO from Ubuntu. I used UNetBootin from https://unetbootin.github.io/ on Windows 10 to make a bootable USB stick for the 20.04 installer.
During the installation and after asking for my username and password, it displays an offer to install OpenSSH just before barfing with the sorry message (without waiting for my response to the OpenSSH offer) and splashes a Python traceback indicating a problem with subiquity.
I tried again with a 18.04 Server SIO to get the same error at a slightly different place but somewhere around where Heroku could be selected as an installation package (according to the Python traceback on 18.04)
I guess it is the new hardware and I'll be stuck until NUC10 is supported.
Can anyone help?

Thank you for your solution, but it did not help in my case. I tried several things:

Different USB Sticks
Different USB Ports
Different USB media creation tools on different operating systems (Rufus, Balena, Unetbootbin, Universal USB Installer)
18.04 Server

Nothing worked.
My solution/workaround:

Use Unetbootbin to create the media
Chose the legacy 18.04 Netinstall image
Upgrade to 20.04 with sudo do-release-upgrade

This was the only way I got it to work

I ran into this problem too. I tried the suggestions of using different methods of creating the install media, without success. I was attempting to install onto a Samsung 970 EVO Plus NVME drive. Out of curiosity, I tried a slightly older 970 EVO (non-Plus model) NVME I had and it worked perfectly, even with the original USB install drive.


How do I run a script on Unity login/logout? I have two scripts - one to mount some folders over SSHFS - and one to unmount.

I would like to launch the mount script when my default Ubuntu desktop is launched (after I log in at the graphical console) - and the unmount script when I "Log Out..." from the cog-wheel at the top-right of the desktop.

Please can someone tell me how to achieve this?  What are the most convenient/standard hooks to run commands on desktop launch / exit?

Considering your requirement of running a job when you login to Unity and not for other logins, an Upstart session job seems perfect.

You may have noticed it: processes that you run after a GUI login are under a second init process. This init is a proper Upstart init, and you can start and stop session jobs based on events emitted by it. No root privileges needed at all. Better yet (or worse depending on the perspective), this is not yet completely supported for headless systems. An SSH login didn't start the user init from a quick test that I made just now.

To create a session job, make a new .conf file in ~/.config/upstart. That's the default primary directory for Upstart session jobs ($XDG_CONFIG_HOME/upstart), create it if doesn't exist. Here's an example job:

tee ~/.config/upstart/myjob.conf <<EOF
description "My job"
start on desktop-start
stop on desktop-end

script
       firefox 'http://upstart.ubuntu.com/cookbook/#session-job'
end script
EOF

You can manually control it:

start myjob
# or
initctl start myjob

The service command are used to control system jobs (those in /etc/init.d or /etc/init). For controlling session jobs, one needs to use the initctl command, which is used to interact with Upstart.

See man upstart-events for more events you can use.

Here are some suggestions for running a script after login:

StackOverflow Linux script after bootup: Cliff notes is to put your *.sh file in /etc/profile.d.

If you want to run scripts upon bootup, here are some suggestions for that:

StackOverflow Linux script after boot: Cliff notes is to use /etc/rc.local or crontab.


I'm having trouble installing virtualbox 5.1 via the CLI .. my software install is not installing the Deb package I tried to follow another question that had the same problem but the command:

sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-5.1 dkms
returns E: Package 'virtualbox-5.1' has no installation candidate
Can anyone help me with this?

I had this all working then I rebooted and my virtualbox installation had vanished .... which I'm sure is a whole another can of worms. I just want Virtualbox installed. Please help.

Just FYI I try and install this through Ubuntu Software (after downloading 5.1) and the Install button goes gray for about two seconds then in my launcher an icon comes up and says "waiting to install"

A solution to either of these problems would suffice .. help.

Install gdebi:

sudo apt-get install gdebi

Then download the .deb file and run:

gdebi your_file.deb

(First cd to where your file is.)


How to install .exe file on Ubuntu without using Wine? I have a Matlab installation file in .exe format.

Is it possible to install Matlab on Ubuntu without using Wine?

There is a Linux version of MATLAB. Installing it is fairly simple.

What you have (the .exe) is an installer for the Windows version. Even if you could run it without Wine, its contents are for Windows, not Ubuntu. It's not going to work.

With Wine, it should be possible to get this working, but it's very likely going to be slower than a native install. If you're doing big things, that's going to be a real disadvantage.

I'd focus on getting hold of the right version. For MATLAB it appears the same license to any platform so if you have one, it should be possible (I'm not sure how feasible this will be in practise) to get hold of the right installer. Talk to MathWorks or your supplier and see if they can help.

If its Mono-compatable then...Maybe

But Wine is Really your best shot at getting ANYTHING windows related to work under linux


How to I check the battery level on a Microsoft Surface from a WSL Ubuntu shell? There are plenty of tutorials online for checking your battery level in a ubuntu terminal. The most common solution seems to be to use upower. However, when I run upower in a WSL Ubuntu shell in Windows 10 on my Surface Pro, I get this:

user@sp4-2637:~/the_thing$ sudo upower

(upower:665): UPower-WARNING **: Cannot connect to upowerd: Could not connect: No such file or directory

Running with sudo priviliges yields the same result.

On my laptop running native ubuntu I can query the battery level like this;

cat /sys/class/power_supply/BAT0/capacity

However, this results in the following on my Surface:

user@sp4-2637:~$ cat /sys/class/power_supply/BAT0/capacity
cat: /sys/class/power_supply/BAT0/capacity: No such file or directory

How can I query the battery level in a WSL ubuntu shell for a Microsoft Surface?

As I wrote this question I found the solution so I thought I'd share it.

I don't know whether this is a peculiarity of the Surface hardware or of the WSL ubuntu version, but the directory structure appears to be different on this setup:

user@sp4-2637:~$ ls /sys/class/power_supply/
ac  battery  usb

Rather than looking in the BAT0 directory I can find the battery level in battery:

user@sp4-2637:~$ cat /sys/class/power_supply/battery/capacity
100

If tlp is a package available on WSL Ubuntu shell you can run the command
sudo tlp stat -b


Stuck on splash screen on boot, can't type into tty terminal After some upgrades (I believe it was for Ubuntu 12.04, wasn't me that ran the upgrade), the boot process became stuck on the splash screen (purple, dots moving along). Presuming the desktop manager to have not started, I hit Ctrl Alt F2 to fix it but although it seemed correct based on the output to think that the desktop manager had not started, I was unable to type into the tty terminal to run any commands, thus preventing me from continuing the troubleshooting process. While I probably could boot using a LiveUSB and manually edit some configs to fix the initial problem, I would like to know how to reenable the tty terminal input.

Changing my keyboard converter from USB to PS/2 fixed the problem of being unable to type into the tty screen. Now I have an additional problem of being unable to log in correctly but I doubt that's related so this question is done with. Thanks mttdbrd for leading me on the right track.


Is there any application for vimium-like interaction with desktop using keyboard? Vimium plugin for chrome allows to follow any link on the web-page with the following actions:

Type f. It causes unique string to appear near every available link.
Type string associated with the link you wish to follow.

Such interaction is much quicker for me than using mouse.

Is there any application for interaction with desktop in similar way? The only necessary feature is simulating left or right mouse click within any visible and clickable element.

autohotkey a good hint for binding wishes wish hotkeys, a tutorial for windows ms like work-style
(https://luna-net.org/elements/ahk_sc/instr/docs/Tutorial.htm)
and the manpages for the nearly same named autokey for debian like work-style

keyboard automation and utility for GNOME and GTK with input:
commandline execution utility for AutoKey

man autokey-gtk

man autokey-gtk

man autokey-gtk

konqueror address-row with

man://autokey-run

and

man://autokey-gtk

man://autokey

the actual thread:
https://stackoverflow.com/questions/28335627/is-it-possible-to-map-vim-key-bindings-for-windows-just-like-vimium-for-chrome
and:
find it out:
https://metager.org/meta/meta.ger3?eingabe=vimium+autohotkey


GRUB problems after Windows 10 update After a Windows 10 update, I'm experiencing a problem with GRUB: the system boots directly into Windows and i don't have the chance to select Ubuntu. I tried to use a live USB of Boot-Repair (first the recommended option and then with the "purge the grub" option flagged). I also tried to use these commands in an administrator command prompt (Windows):

bcdedit /set {bootmgr} path \efi\ubuntu\shimx64.efi
bcdedit /set {bootmgr} path efi\ubuntu\grubx64.efi

Here is the Boot-info summary

Any tips?

I see that /efi/boot/bootx64.efi is present. Some EFI systems will ignore OS boot options if the device boot path is present.

If the systems firmware allows OS boot selection, rename /efi/boot to test booting via OS.

If the firmware only allows Device boot selection, then /efi/boot/bootx64.efi needs to be replaced with /efi/ubuntu/shimx64.efi. Relocate the original file in case you want to restore it later. Then copy shimx64.efi to the /efi/boot/ directory and rename it bootx64.efi.


Command to switch to next/previous application I'm interested in a command to switch to the next/previous application window in Ubuntu 16.04. I know I can do that through Alt+Tab ↹, but I want to know which command is run on the background when the combination is pressed.

One interesting behavior that would be useful (but not necessary) is that this command would not only raise the next application in the Alt+Tab ↹ list, but also raise each window of the same application each time it is invoked, if one application happens to have more than one window open.

Any help on this is appreciated. Thanks!

The shortcuts control the window manager, to do the same using terminal commands there's wmctrl. Here are some usage examples:

list  the  windows  being  managed by the window manager

wmctrl -l

switch to the desktop containing Firefox, raise the window and give it focus

wmctrl -a firefox

move Firefox to the current desktop, raise the window and give it focus

wmctrl -R firefox

Toggle “fullscreen” and “stay above“ mode for currently active window

wmctrl -r :ACTIVE: -b toggle,fullscreen,above

Select a window by clicking on it, maximize it horizontally and make it invisible for the taskbar

wmctrl -r :SELECT: -b add,maximized_horz,skip_taskbar

Read man wmctrl and wmctrl‘s homepage for more. The window properties available for the -b option may partially be specific to the window manager in use, use wmctrl -m to get its name and search from there – or just try it out.

In Ubuntu 17.04 these keyboard commands are active...

ALT+TAB = switch open applications

ALT+` = switch open windows (displayed first by ALT+TAB)

ALT+ESC = switch open windows directly

To check for other useful keyboard commands, open the keyboard settings and check the shortcut settings.


Can't install Ubuntu 20.04 on my laptop I've tried dual booting and installing Ubuntu 20.04 with the recommended methods on the internet using the latest Rufus with GPT (my system is UEFI), disabling Secure Boot, Fast boot, using "nomodeset" in the Grub bootloader (I have a AMD processor HP ENVY), but it always stops at this error screen while booting.

This black screen appears while I boot Ubuntu from my USB drive, and it hangs it here, nothing afterwards.
I could install Ubuntu in VirtualBox on my laptop, but it has been weeks I've been trying to install it from my 16GB USB stick, but I had no success.

I suspect that the Live USB is not properly formatted. Try using rufus with the dd option.


Libre Office and Firefox icons gone on BQ M10 HD tablet I recently updated my BQ tablet and for some reason the Libre Office icon and the Firefox icon have gone. I can choose Libre Office to open files but I can't create new ones without going into a saved file and clicking on new file. I can't access Firefox at all. Is there a fix for this that works on the tablet version of the OS?

Do you know that new Libertine Scope (with all Ubuntu desktop apps) has been added as part of the Ubuntu Touch OTA-12? You will find LO and Firefox icons there.

The new scope can be activated by swiping up from the bottom of the screen on any scope. You will be in the scope management page. Scroll down until you find the scope named Desktop Apps (the one with the big X as the icon) star it and then move it to just below the Apps scope, and you should be set to go.

Possibly not the answer you may of been looking for but you could try going into the software centre and uninstalling and then installing them again. This should give you your icons back, so at least you can access them easier. As a long term answer. I would log a bug for this in Launchpad so a permanant fix can be given.


How to remove a directory without a name? ls -l output:

drwxr-xr-x 10 mnevile mnevile 4.0K Sep  9 15:45
drwxrwxr-x 18 mnevile mnevile 4.0K Jun 16 16:01 movies/
drwxrwxr-x 16 mnevile mnevile 4.0K Aug 19 10:52 music/
drwxrwxr-x 16 mnevile mnevile 4.0K Aug 19 10:52 tv/

How to remove a folder with no name?

First you should know that this directory has a name but it's made of non-printable characters .

You can try this scenario:

Find out file inode:

ls -il

Output should be like this example :

261145 drwxr-xr-x 10 mnevile mnevile 4.0K Sep  9 15:45

Note: Here, 261145 is the inode number.

Then you can try:

find . -inum 261145 -exec rm -rfi \{\} +

looks like it is a directory with spaces .
I would cd to that directory and use ./" " or ./\


How to remove files with no permission I have leftovers of PyLotRO, a Windows emulator, but I can't move all files to the trash bin.

How do I change permissions and delete them?

Determine where the folder is and change the permissions using chmod
sudo chmod -R 777 /path/to/folder/foldername

Then press Enter. For example if  the folder was called BLAH and was located at /home/user then you would type
sudo chmod -R 777 /home/user/BLAH

That should change the permissions for the folder and all its files and sub directories to read/write/execute. Then you should be able to delete them. Also be aware that Linux is case sensitive so you do have to use a capital -R in the line and if your directory has caps you have to  use caps the exact same way it show or it will fail
Since you said you can find the folder in terminal you can use this command
sudo rm -rf /path/to/folder/foldername

That will delete the folder and its subdirectories as root.
It will ask you for a password and when you type it in it will look like nothing is happening . It doesn't show any indication that you are typing it in. Just type the password and press Enter and it will delete the files for you.

If you wanted to use your GUI file manager (nautilus, thunar, caja, dolphin, etc) you could use the "root account" to delete the files.

Most file managers probably have an "Open Folder as Root" or similar option, or just run the file manager with sudo (, from a terminal would work.

For thunar: sudo thunar. Or for nautilus: sudo nautilus , etc

If you're using nautilus, the answers here should help: How do I open a folder as root?

Then browse to the offending files and delete them.

In a terminal, just sudo rm should work too


Why doesn't rc.local run all my commands, and what can I do about it? I have the following rc.local script:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

sh /home/incero/startup_script.sh
/bin/chmod +x /script.sh
sh /script.sh

exit 0

The first line, startup_script.sh actually downloads the script.sh file to /script.sh referred to in the third line.

Unfortunately, it appears that it is not making the script executeable or running the script. Running the rc.local file manually after having started works perfectly. Can chmod not be run at startup or something?

You can skip all the way down to A Quick Fix but that's not necessarily the best option. So I recommend reading all this first.
rc.local doesn't tolerate errors.
rc.local doesn't provide a way to intelligently recover from errors. If any command fails, it stops running. The first line, #!/bin/sh -e, causes it to be executed in a shell invoked with the -e flag. The -e flag is what makes a script (in this case, rc.local) stop running the first time a command fails within it.
You want rc.local to behave like this. If a command fails, you do not want it to continue on with whatever other startup commands might be relying on it having succeeded.
So if any command fails, the subsequent commands will not run. The problem here is that /script.sh did not run (not that it failed, see below), so most likely some command before it failed. But which one?
Was it /bin/chmod +x /script.sh?
No.
chmod runs fine at any time. Provided the filesystem that contains /bin was mounted, you can run /bin/chmod. And /bin is mounted before rc.local runs.
When run as root, /bin/chmod rarely fails. It will fail if the file it operates on is read-only, and might fail if the filesystem it's on doesn't supported permissions. Neither is likely here.
By the way, sh -e is the only reason it would actually be a problem if chmod failed. When you run a script file by explicitly invoking its interpreter, it doesn't matter if the file is marked executable. Only if it said /script.sh would the file's executable bit matter. Since it says sh /script.sh, it doesn't (unless of course /script.sh calls itself while it runs, which could fail from it not being executable, but it's unlikely it calls itself).
So what failed?
sh /home/incero/startup_script.sh failed. Almost certainly.
We know it ran, because it downloaded /script.sh.
(Otherwise, it would be important to make sure it did run, in case somehow /bin was not in PATH--rc.local doesn't necessarily have the same PATH as you have when you're logged in. If /bin weren't in rc.local's path, this would require sh to be run as /bin/sh. Since it did run, /bin is in PATH, which means you can run other commands that are located in /bin, without fully qualifying their names. For example, you can run just chmod rather than /bin/chmod. However, in keeping with your style in rc.local, I've used fully qualified names for all commands except sh, whenever I am suggesting you run them.)
We can be pretty sure /bin/chmod +x /script.sh never ran (or you would see that /script.sh was executed). And we know sh /script.sh wasn't run either.
But it downloaded /script.sh. It succeeded! How could it fail?
Two Meanings of Success
There are two different things a person might mean when s/he says a command succeeded:

It did what you wanted it to do.
It reported that it succeeded.

And so it is for failure. When a person says a command failed, it could mean:

It did not do what you wanted it to do.
It reported that it failed.

A script run with sh -e, like rc.local, will stop running the first time a command reports that it failed. It doesn't make a difference what the command actually did.
Unless you intend for startup_script.sh to report failure when it does what you want, this is a bug in startup_script.sh.

Some bugs prevent a script from doing what you want it to do. They affect what programmers call its side effects.
And some bugs prevent a script from reporting correctly whether or not it succeeded. They affect what programmers call its return value (which in this case is an exit status).

It's most likely that startup_script.sh did everything it should, except reported that it failed.
How Success Or Failure Is Reported
A script is a list of zero or more commands. Each command has an exit status. Assuming there are no failures in actually running the script (for example, if the interpreter couldn't read the next line of the script while running it), the exit status of a script is:

0 (success) if the script was blank (i.e., had no commands).
N, if the script ended as a result of the command exit N, where N is some exit code.
The exit code of the last command that ran in the script, otherwise.

When an executable runs, it reports its own exit code--they're not just for scripts. (And technically, exit codes from scripts are the exit codes returned by the shells that run them.)
For example, if a C program ends with exit(0);, or return 0; in its main() function, the code 0 is given to the operating system, which provides it to calling process (which may, for example, be the shell from which the program was run).
0 means the program succeeded. Every other number means it failed. (This way, different numbers can sometimes refer to different reasons the program failed.)
Commands Meant to Fail
Sometimes, you run a program with the intention that it will fail. In these situations, you might think of its failure as success, even though it is not a bug that the program reports failure. For example, you might use rm on a file you suspect already does not exist, just to make sure it's deleted.
Something like this is probably happening in startup_script.sh, just before it stops running. The last command to run in the script is probably reporting failure (even though its "failure" might be totally fine or even necessary), which makes the script report failure.
Tests Meant to Fail
One special kind of command is a test, by which I mean a command run for its return value rather than its side effects. That is, a test is a command that is run so that its exit status can be examined (and acted upon).
For example, suppose I forget if 4 is equal to 5. Fortunately, I know shell scripting:
if [ 4 -eq 5 ]; then
    echo "Yeah, they're totally the same."
fi

Here, the test [ -eq 5 ] fails because it turns out 4 ≠ 5 after all. That doesn't mean the test didn't perform correctly; it did. It's job was to check if 4 = 5, then report success if so, and failure if not.
You see, in shell scripting, success can also mean true, and failure can also mean false.
Even though the echo statement never runs, the if block as a whole does return success.
However, supposed I'd written it shorter:
[ 4 -eq 5 ] && echo "Yeah, they're totally the same."

This is common shorthand. && is a boolean and operator. A && expression, which consists of && with statements on either side, returns false (failure) unless both sides return true (success). Just like a normal and.
If someone asks you, "did Derek go to the mall and think about a butterfly?" and you know Derek didn't go to the mall, you don't have to bother figuring out if he thought of a butterfly.
Similarly, if the command to the left of && fails (false), the whole && expression immediately fails (false). The statement on the right side of && is never run.
Here, [ 4 -eq 5 ] runs. It "fails" (returning false). So the whole && expression fails. echo "Yeah, they're totally the same." never runs. Everything behaved as it should be, but this command reports failure (even though the otherwise equivalent if conditional above reports success).
If that were the last statement in a script (and the script got to it, rather than terminating at some point before it), the whole script would report failure.
There's lots of tests besides this. For example, there are tests with || ("or"). However, the above example should be sufficient to explain what tests are, and make it possible for you to effectively use documentation to determine if a particular statement/command is a test.
sh vs. sh -e, Revisited
Since the #! line (see also this question) at the top of /etc/rc.local has sh -e, the operating system runs the script as though it were invoked with the command:
sh -e /etc/rc.local

In contrast, your other scripts, such as startup_script.sh, run without the -e flag:
sh /home/incero/startup_script.sh

Consequently they keep running even when a command in them reports failure.
This is normal and good. rc.local should be invoked with sh -e and most other scripts--including most scripts run by rc.local--should not.
Just make sure to remember the difference:

Scripts run with sh -e exit reporting failure the first time a command they contain exits reporting failure.
It's as though the script were a single long command consisting of all the commands in the script joined with && operators.

Scripts run with sh (without -e) continue running until they get to a command that terminates (exits out of) them, or to the very end of the script. The success or failure of every command is essentially irrelevant (unless the next command checks it). The script exits with the exit status of the last command run.

Helping Your Script Understand It's Not Such a Failure After All
How can you keep your script from thinking it failed when it didn't?
You look at what happens just before it's done running.

If a command failed when it ought to have succeeded, figure out why, and fix the problem.

If a command failed, and that was the right thing to happen, then prevent that failure status from propagating.

One way to keep a failure status from propagating is to run another command that succeeds. /bin/true has no side effects and reports success (just as /bin/false does nothing and also fails).

Another is to make sure the script is terminated by exit 0.
That's not necessarily the same thing as exit 0 being at the end of the script. For example, there might be an if-block where the script exits inside.

It's best to know what causes your script to report failure, before making it report success. If it really is failing in some way (in the sense of not doing what you want it to do), you don't really want it to report success.
A Quick Fix
If you can't make startup_script.sh exit reporting success, you can change the command in rc.local that runs it, so that command reports success even though startup_script.sh did not.
Currently you have:
sh /home/incero/startup_script.sh

This command has the same side effects (i.e., the side effect of running startup_script.sh), but always reports success:
sh /home/incero/startup_script.sh || /bin/true

Remember, it's better to know why startup_script.sh reports failure, and fix it.
How the Quick Fix Works
This is actually an example of a || test, an or test.
Suppose you ask if I took out the trash or brushed the owl. If I took out the trash, I can truthfully say "yes," even if I don't remember whether or not I brushed the owl.
The command to the left of || runs. If it succeeds (true), then the right-hand side doesn't have to run. So if startup_script.sh reports success, the true command never runs.
However, if startup_script.sh reports failure [I didn't take out the trash], then the result of /bin/true [if I brushed the owl] matters.
/bin/true always returns success (or true, as we sometimes call it). Consequently, the whole command succeeds, and the next command in rc.local can run.
An additional note on success/failure, true/false, zero/nonzero.
Feel free to ignore this. You might want to read this if you program in more than one language, though (i.e., not just shell scripting).
It is a point of great confusion for shell scripters taking up programming languages like C, and for C programmers taking up shell scripting, to discover:

In shell scripting:

A return value of 0 means success and/or true.
A return value of something other than 0 means failure and/or false.

In C programming:

A return value of 0 means false..
A return value of something other than 0 means true.
There is no simple rule for what means success and what means failure. Sometimes 0 means success, other times it means failure, other times it means that the sum of the two numbers you just added is zero. Return values in general programming are used to signal a wide variety of different sorts of information.
A program's numeric exit status should indicate success or failure in accordance with the rules for shell scripting. That is, even though 0 means false in your C program, you still make your program return 0 as its exit code if you want it to report it succeeded (which the shell then interprets as true).

change first line from:
#!/bin/sh -e
to
!/bin/sh -e


Installed Ubuntu 14.04 - cannot connect to internet with wired or wireless connection I just installed Linux and Ubuntu 14.04 alongside my Windows 8 on my HP Pavilion. First, I had problems with the graphics card and it said it could only operate in low graphics mode.But it just stall when I tried this.

I have Googled some potential fixes for this, but they all require an Internet connection which I am unable to obtain. I can boot in recovery mode, but I can't connect to either a wired or wireless connection. It can see both but can't connect, just keeps trying to connect.

Any help on either issue would be greatly appreciated.

$ sudo lshw -c network
  *-network
       -description: Wireless interface
       -product: RT3290 Wireless 802.11n 1T/1R PCIe
       -vendor: Ralink corp.
       -physical id: 0
       -bus info: pci@0000:08:00.0
       -logical name: wlan0
       -version: 00
       -serial: 54:35:30:80:eb:01
       -width: 32 bits
       -clock: 33MHz
       -capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       -configuration: broadcast=yes driver=rt2800pci driverversion=3.13.0-29-generic firmware=0.37 latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:18 memory:c2610000-c261ffff
  *-network
       description: Ethernet interface
       product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:09:00.0
       logical name: eth0
       version: 08
       serial: a0:1d:48:e4:ff:c4
       size: 100Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8106e-2_0.0.1 04/23/13 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:59 ioport:4000(size=256) memory:c2504000-c2504fff memory:c2500000-c2503fff

$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr a0:1d:48:e4:ff:c4
          inet6 addr: fe80::a21d:48ff:fee4:ffc4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36631 errors:0 dropped:0 overruns:0 frame:0
          TX packets:189 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2200377 (2.2 MB)  TX bytes:38826 (38.8 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:191 errors:0 dropped:0 overruns:0 frame:0
          TX packets:191 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:13717 (13.7 KB)  TX bytes:13717 (13.7 KB)

wlan0     Link encap:Ethernet  HWaddr 54:35:30:80:eb:01
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I figured it out. Thanks everyone for your help.

It was a combination of two problems:

https://superuser.com/questions/756145/ubuntu-14-04-wired-connection-detected-but-no-internet-access

That worked after I did some other stuff to allow the changes to be saved, and then I went to the settings and used the proprietary drivers as suggested below, although it didn't work the first time. I had to reinstall in order to achieve success.

Going on assumption that you're plugged into a router that gives out IPs automatically (DHCP), try sudo dhclient -r then sudo dhclient eth0 if successful try ping 8.8.8.8 post results if it didn't work

I can simply solve the problem by doing the following:

gksu gedit /etc/NetworkManager/NetworkManager.conf

Then I just change "false" in the file to "true" and then save and restart (only network manager restart can also work)


Why does Pidgin refuse to connect to Facebook Chat? I have searched around the net for a solution to my problem. I gave myself an account user name for facebook so I could use the chat in Pidgin 2.10.3. However, no matter what I do, Pidgin refuses to enable the account and it gives me the same message:

  username@chat.facebook.com/Pidgin disabled
  Not Authorized

I used the tutorial on at this blog:
http://poppleit.com/how-to-howto-use-facebook-facebookchat-facebook-chat-with-pidgin-instant-messenger-14-07-2012/#comments

The settings have changed recently.

open pidigin accounts and edit the facebook account to the following:

  Protocol: XMPP

  Username: xyz (This might not be the username that you enter at facebook login page - But the one which you see on your timeline link - https://www.facebook.com/xyz)

  Domain: chat.facebook.com

  Resource: Pidgin (this is what is missing most of the time)

  Password: xyx

  Local alias: xyz

On the advanced tab:

    Connect port: 5222

    Connect server: chat.facebook.com

Like the link Alan provided: http://ubuntuforums.org/showthread.php?t=1683460
So credit for the link goes to him.

What worked for me was logging out in my browser and logging in with my username (as opposed to logging in with my email address which I did previously). Crazy that this works. But well, it works, so...


Unable to delete USB Drive partitions (Block size error) I have been unable to format/delete the partitions on my Sandisk Cruzer Force 32 GB USB Drive. I get the following error when deleting any of the partitions on it.

`Error deleting partition /dev/sdd2: Command-line `parted --script "/dev/sdd" "rm 2"' exited with non-zero exit status 1: Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes.
(udisks-error-quark, 0)

Is there any way I can completely format all of my drive and turn it into one large partition? I haven't found a solution to this particular error here yet, so I thought I'd actually ASK for once

The problem you are describing was caused by a low-level device tool (like dd) writing blocks at the wrong size directly onto the device.

To fix this, you need to re-write the device blocks to the appropriate size.  This can be done with dd.
Double check your output device before running the command

sudo dd if=/dev/zero of=/dev/sdd bs=2048 count=32

Once the dd command is done, you should be able to access your device through gparted.

Use fdisk command to delete the partition and create again.

Run command:

sudo fdisk /dev/sdxY

(In my case, partition is 'sdb1' - replace with the correct name)

Command (m for help): d to delete the partition, choose 1 or 2.

Type w to save and exit.

Now eject the usb and connect again to check changes.


Ubuntu 16.04 "Nvidia GPU Driver" can not use proprietary driver After a fresh install (16.04) to my notebook which have Nvidia GT 750m, I want to change GPU driver from "Software & Updates" --> "Additional Drivers". System identifies my graphic card, no problem but when I select a proprietary driver and apply changes. After a few seconds, change bar stops and nouveau selected by default again.

I tried from terminal;

sudo apt-get install nvidia-361

but output says "you have held broken packages"

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

The following packages have unmet dependencies:
 nvidia-361 : Depends: lib32gcc1 but it is not going to be installed
              Depends: libc6-i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Then issue is not about nvidia-361, all drivers are same.

In ubuntu 16.04, if Software & Updates -> Additional Drivers, is started from menu or Unity launcher, choosing a proprietary driver doesn't work. Upon selecting a new driver and clicking apply changes, progress bar moves forward for sometime, then goes back and the previous driver is selected again.

It looks like the issue is that Software & Updates is initialized without super user privileges. The solution is, open a terminal and type:

$ sudo software-properties-gtk

And type password if required.
Then select the proprietary driver and click apply changes.

This method solved me the problem.

PS : Edited after seeing the comments.

You have a problem with the package system, not with the driver itself. It is quite a common problem. One of the solutions is:

sudo apt-get clean
sudo apt-get install -f
sudo dpkg --configure -a

Another possible solution is to use synaptic package manager to fix the broken packages (it will prompt you to do that automatically) and then you'll be able to install nvidia-361.

Source: Package system is broken. How to fix it?


How do you view file permissions? I want to know how to see the permissions a particular file has. Which command should I type in the terminal? However, I don't want to change it.

If you want to see the the permission of a file you can use ls -l /path/to/file command.

For example

   ls -l acroread
   -rwxr-xr-x 1 10490 floppy 17242 May  8  2013 acroread

What does this mean ?

First - represents a regular file. It gives you a hint of the type of object it is.
It can have following values.

d (directory)
c (character device)
l (symlink)
p (named pipe)
s (socket)
b (block device)
D (door)
-  (regular file)

  r represents read permission.
  w represents write permission and
  x represents executable permission.

First combination of rwx represents permission for the owner .
Second combination of rwx represents permission for the group .
Third combination of rwx represents permission for the other of the file.

Octal notation

Permission of file can also be represented in octal notation.
In octal notation

Read or r is represented by 4,
Write or w is represented by 2
Execute x is represented by 1.

Sum of these three is use to represent the permission.

stat command can be used to view file permission in octal notation

  stat -c "%a %n" /path/of/file

For example

   stat -c "%a %n" acroread
   755 acroread

Here you can see

For owner it is 4+2+1=7 (111 in binary)
For group it is 4+0+1=5 (101 in binary) and
For other it is 4+0+1=5 (101 in binary).

You can also see file permission by right-clicking the file and selecting properties and there you will find permissions.


How to restore deleted startup applications I am running Ubuntu 14.10 I have accidentally remove some of my startup applications from the "Startup Applications Preferences" GUI, and I don't know what they were, is there a log somewhere which will tell me which ones I removed? Or a way of restoring them?

I read here that I could restore them by copying all the entries here:

/etc/xdg/autostart/

To here:

~/.config/autostart

Would that work? Or would that still not restore the deleted ones?

These are the ones which I have left:

Very simple: restore from your last back-up the directory /home/szUserName/.config/autostart/*  where szUserName is your actual user name.

For more information on back-ups, please read the following Q&A: What's a good back-up strategy for 1 desktop PC?.

You're definitely user type 4!  ;-) >:-)

Open doom'day Terminal by Alt+F5 or Alt+any function key up to F7.

Install trash-cli tool.

Head over to the autostart directory.

Run:
sudo trash-restore

Restore all your deleted autostart files one by one. If you have deleted them permanently, then there is no way coming back, but if you just moved them to trash, then it will help.


How to completely uninstall Java? How can I completely remove all traces of Java on my system?

I already know how to install it in case I need it again.

Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):

dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove

Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too):

dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge

Remove Java config and cache directory:

sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf

Remove manually installed JVMs:

sudo rm -rf /usr/lib/jvm/*

Remove Java entries, if there is still any, from the alternatives:

for g in ControlPanel java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so; do sudo update-alternatives --remove-all $g; done

Search for possible remaining Java directories:

sudo updatedb
sudo locate -b '\pack200'

If the command above produces any output like /path/to/jre1.6.0_34/bin/pack200 remove the directory that is parent of bin, like this: sudo rm -rf /path/to/jre1.6.0_34.

Agreed with Eliah. "apt-get purge" command can remove those packages completely.

Assuming you have previously installed a copy of java-6-sun package, a followup will help getting rid of broken symbolic link:

sudo update-alternatives --config java

And then select a correct path which you want to link up as default Java calling path.

Then have a check on the version of Java with this command:

java -version


Midi files not working on Rhythmbox  nor VLC Rhythmbox 2.96 doesn't run any midi file on Ubuntu 12.04, even after installing GStreamer and Ubuntu Restricted Extras.
Rhythmbox-Message: Missing plugin: gstreamer|0.10|rhythmbox-metadata|audio/midi decoder|decoder-audio/midi
[0xb5504e40] main decoder error: no suitable decoder module for fourcc `MIDI'. VLC probably does not support this sound or video format.

You can play midi with VLC. Just install vlc-plugin-fluidsynth

sudo apt install vlc-plugin-fluidsynth

Install Gstreammer 0.10
Open your Terminal, copy and paste:
sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-gnonlin gstreamer0.10-sdl gstreamer0.10-plugins-bad-multiverse gstreamer0.10-schroedinger gstreamer0.10-plugins-ugly totem-plugins-extra
sudo apt-get install gstreamer-dbus-media-service gstreamer-tools ubuntu-restricted-extras
that should do it


Need Help using a Japanese Keyboard(Not IME) in Ubuntu 12.10 I am using an old X60 that I bought from Japan. Naturally, it has a Japanese keyboard.

When installing 12.10, I chose the closest keyboard layout I could find: Japanese(OADG 109A).
But somehow my keyboard doesn't respond to the Japanese switch key so I'm stuck with typing in English only.

I have installed the Japanese language and Japanese Anthy(ibus). Those work fine.

What I really want is to type in Japanese via the Hiragana printed characters on the keyboard.

This is the first time I am using a Japanese keyboard, so any help would be appreciated.

Go to System Settings -> Keyboard -> Keyboard Layout and try adding and trying other layouts, see if any of them work.

Here, I just tried with one named Kana, and it types directly in Japanese.

I would try and reinstall Ubuntu but when you select your keyboard, try 'detect keyboard layout'.


Switch between normal and 10-feet interface Sometimes when I watch a movie or TV episode on my computer, I'd like to sit on my couch. Now sometimes you want to check some random fact being mentioned on wikipedia, or someone writes to me via instant messaging. I don't want to get up, my mouse & keyboard are wireless, but the fonts are just to small to see. In Firefox, you can at least ctrl++, but that is no help in skype or pidgin. Is there a quick way to switch between normal & enlarged fonts, possibly even buttons & icons etc.? Btw. I'm using xmonad, but I'm open to other suggestions if need be.

This is an advanced trick, without the full details as I am posting in haste:

Configure the system to launch two different X servers, one at full resolution, and one at lower resolution.  Use the Control-Alt-Fkey sequence to switch between them.

Make a shortcut in the shortcut section of the keyboard-settings. You can make a chortcut for zoom in, zoom out, text size etcetera.


How do I find the path to pg_hba.conf from the shell? I would like to obtain the path to pg_hba.conf from the shell. The path varies between versions of PostgreSQL. For instance, for 8.4 and 9.1:

/etc/postgresql/8.4/main/pg_hba.conf
/etc/postgresql/9.1/main/pg_hba.conf

I have tried the pg_config command, but it does not seem to include this information.

This is so that I can use a uniform command for opening pg_hba.conf and other PostgreSQL configuration files for editing.

I'm using bash.

pg_config is for compliation information, to help extensions and client programs compile and link against PostgreSQL. It knows nothing about the active PostgreSQL instance(s) on the machine, only the binaries.

pg_hba.conf can appear in many other places depending on how Pg was installed. The standard location is pg_hba.conf within the data_directory of the database (which could be in /home, /var/lib/pgsql, /var/lib/postgresql/[version]/, /opt/postgres/, etc etc etc) but users and packagers can put it wherever they like. Unfortunately.

The only valid ways find pg_hba.conf is to ask a running PostgreSQL instance where it's pg_hba.conf is, or ask the sysadmin where it is. You can't even rely on asking where the datadir is and parsing postgresql.conf because an init script might passed a param like -c hba_file=/some/other/path when starting Pg.

What you want to do is ask PostgreSQL:

SHOW hba_file;

This command must be run on a superuser session, so for shell scripting you might write something like:

psql -t -P format=unaligned -c 'show hba_file';

and set the environment variables PGUSER, PGDATABASE, etc to ensure that the connection is right.

Yes, this is somewhat of a chicken-and-egg problem, in that if the user can't connect (say, after screwing up editing pg_hba.conf) you can't find pg_hba.conf in order to fix it.

Another option is to look at the ps command's output and see if the postmaster data directory argument -D is visible there, e.g.

ps aux  | grep 'postgres *-D'

since pg_hba.conf will be inside the data directory (unless you're on Debian/Ubuntu or some derivative and using their packages).

If you're targeting specifically Ubuntu systems with PostgreSQL installed from Debian/Ubuntu packages it gets a little easier. You don't have to deal with hand-compiled-from-source Pg that someone's initdb'd a datadir for in their home dir, or an EnterpriseDB Pg install in /opt, etc. You can ask pg_wrapper, the Debian/Ubuntu multi-version Pg manager, where PostgreSQL is using the pg_lsclusters command from pg_wrapper.

If you can't connect (Pg isn't running, or you need to edit pg_hba.conf to connect) you'll have to search the system for pg_hba.conf files. On Mac and Linux something like sudo find / -type f -name pg_hba.conf will do. Then check the PG_VERSION file in the same directory to make sure it's the right PostgreSQL version if you have more than one. (If pg_hba.conf is in /etc/, ignore this, it's the parent directory name instead). If you have more than one data directory for the same PostgreSQL version you'll have to look at database size, check the command line of the running postgres from ps to see if it's data directory -D argument matches where you're editing, etc.

To know where the file is
simply type:

pg_lsclusters


Useful apt (dpkg) commands Please post your less-known, but useful apt commands involving apt-*, dpkg, or aptitude.

Some command I often use:

to see dependencies and reverse dependencies:

apt-cache [--important] [--installed] [--recurse] depends $package
apt-cache rdepends $package

To remove a package, all autoremove packages, and all related config files:

sudo apt-get --purge --auto-remove purge $package

To see actual apt configuration options:

apt-config dump | less

To modify an option on the command line

$ apt-config dump | grep -i recommend
APT::Install-Recommends "1";
$ sudo apt-get -o APT::Install-Recommends="0" install $package

This was just and example of specifying APT options through the command line, to avoid installing recommended packages, you can use:

sudo apt-get --no-install-recommends $package

To see all local/obsolete packages:

aptitude search ~o

To see removed packages with residual configuration:

aptitude search ~c

and to remove them

sudo aptitude purge ~c

To obtain a list of all installed packages (dpkg -l can sometimes give truncated columns output)

dpkg --get-selections | awk '{ print $1 }'

or

dpkg-query -Wf '${Package}\n'  # other fields available, see man page

To dissasemble, modify then riassemble a package

dpkg-deb -x file.deb ./dir
cd dir
dpkg-deb -e ../file.deb
# apply your modification, then...
cd ..
dpkg-deb -b dir file-new.deb

dpkg -i --force-architecture something.i386.deb

For installing some i386 debs on amd64.


Sound not working at all in Skype I can't get sound to work at all in Skype (version 4.2.0.11). Video works fine, but when I try a test call it just says "Problem with audio playback". I'm running Xubuntu 13.04. There are many many options in the settings for sound (image attached) - have tried all of them and none work. Any suggestions gratefully received!

I had the same problem. I chose HD-audio generic... and it started to work.

plinovodja

Well, this will sound stupid, but first few times I tried to change configuration I didn't notice " Apply" button in the bottom...


16 TB what filesystem I should use I need a 16 TB volume by 6 drives x 4TB. I use the last version of ubuntu. I need the filsytem very stable. How I can created this volume. I should use ext4, xfs, zfs, btrfs, with mdadm ?

Thanks a lot.

Edit

I don't need compatibility with OSX and windows. This drive I will use for backups, I will use freefilesync or unison. I need standard permissions. I quite nervous to use "news" filesytems.
 The filesytem it might store small|large files, such a .txt or ISO with some TB.
Thanks

I recommend using btrfs with raid6. You do not need anything else.
So if for example you have sda,b,c,d,e,f and each have one partition:

mkfs.btrfs /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
mkfs.btrfs -f -d raid6 -m raid6 -L 'writeyourlable' /dev/sd[a,b,c,d,e,f]1
mount -L 'writeyourlable' /whereever/you/want

Documentation is a bit sparse but that will give exactly 16TB with 2 drives fault tolerance.

Also, btrfs has other usefull features like snapshots and subvolumes that you might need with a 16 TB virtual drive.

I don't need compatibility with OSX and windows. This drive I will use for backups, I will use freefilesync or unison. I need standard permissions. I quite nervous to use "news" filesytems.

Thanks


Ubuntu 13.10 won't boot and hangs on a black screen I installed Ubuntu 13.10 64-bit today and I sat on the internet most of the day after installation. I shut the computer down and went bowling with my family. When I came back, I turned on my computer and it came to the boot screen as usual, but then the screen went black and stayed black. Can this be solved or do I have to install Ubuntu 13.04. My dad does not know about this and I do not want to get yelled at for an hour, so I need an answer before midnight mountain time, otherwise I will install Ubuntu 13.04 so I won't get yelled at in the morning.

You don't really give enough information to diagnose fully, but your symptoms sound like this issue, which can be solved by switching from UEFI to legacy BIOS mode:

Black screen after upgrading from 13.04 to 13.10
https://bbs.archlinux.org/viewtopic.php?id=167463

Because you are on a time constraint my advise would be to simply re-install. Otherwise you will have to troubleshoot your system to find out the problem. It may be a simple fix but there is no guarantee. In the future you should test the upgrade using a LiveCD. Take this as a lesson.


How to make Unity remember brightness settings? This question has been asked many times for Ubuntu 11.10 but it always has been closed and linked with this link, but that accepted answer is from 2010 and that setting doesn't work anymore for Ubuntu 11.10. Furthermore, the brightness setting doesn't exist anymore in "Energy" options. It is now on "Screen" options and it doesn't seem to remember the setting after reboot.

So, how to make Unity remember brightness settings?

The short answer is: you can't. Gnome power manager doesn't save the brightness setting.
The best you can do is to automatically set it to a reasonable default at startup.

For 11.10, the only solution I have found that works is the one given here:
http://blog.ishans.info/2011/09/25/set-brightness-automatically-at-the-startup-in-linux/

Save http://ishans.info/attachments/article/65/setBrightness.py locally, change the brightness percentage in the last line to your preferred value, and add a new startup application to run:

python /wherever-you-saved-the-script/setBrightness.py

You may try this one! This one solved my problem :D

http://ubuntuguide.net/how-to-save-screen-brightness-settings-in-ubuntu-12-04-laptop


Ubuntu 16.04.1 freshly installed loops on login As the title of the post says; I just installed the tested  (thank goodness!) driver for my NVIDIA graphic card, then, when I rebooted, I was stuck in a login loop. What could I do?
Thanks in advance.

(sorry if my English isn't good. I'm not a native speaker)

I just reported the bug in Launchpad — actually someone else did this in June, I just added me in the queue, so that the bug become "Confirmed" from the "New" status.

(https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-361/+bug/1594586)

Press Ctrl+Alt+F1 to switch to text terminal and rm ~/.Xauthority file then reboot. It should help.


Microsoft proxy server not working with CNTLM and apt-get I'm trying to connect an ISA proxy server with CNTLM. But syntax of ISA proxy looks different. I can't find a way to set proxy for apt. my CNTLM is listening on 127.0.0.1:41040, and /etc/apt/apt.conf is like this:

Acquire::http::Proxy  "http://urmia.ac.ir\username:pass@127.0.0.1:41040/";

Which urmia.ac.ir is the domain of ISA in my university. I'm getting 407 error. CNTLM says

HEAD: HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )

You put the username and password (in hashed form, preferably) in CNTLM's configuration file. Apt doesn't need to know your username and password.

Configuring cntlm can be a little finicky, you need to play around with "Auth" flags, until it works reliably. Here's a howto I wrote for users at my university.

You have to fill information in /etc/cntlm.conf.


Unable to install Ubuntu 12.04 lts 64 bit I am unable to install 12.04 LTS 64 bit on my 64 bit m/c having Windows 8.

I have a partition of 95 GB NTFS where I want to install it.

I tried the windows installer, but when asked for reboot, it cannot reboot. Only a beep comes with black screen.

I tried the USB installer, but in vain. Here I get the home screen to choose options but when I choose either to run or install it, a beep is all that is made and nothing happens.

Please help me install Ubuntu.

please, try to format that partition as FAT32 or Ext4, then try to install. NTFS formated disk is compatibile with windows, and in most cases with windows only. so you need or FAT32 or Ext4 formated that partition for linux.


Did not install rEFIt, can't boot back into OSX El Capitain Ubuntu 15.10 Recently I partitioned my Macintosh SSD to dual boot Ubuntu and OSX although I forgot to install rEFit. Now when I turn on my computer it automatically boots into Ubuntu properly. Although If I boot and hold down alt it gives me one option which is to boot from "Macintosh SSD". Once selecting this my computer comes up with normal loading page and then goes to a circle with a line through it. Is it possible to boot back into OSX without reformatting my Macintosh SSD?

Commonly if you don’t install refit/refind you can always boot OSX  in the way you described.

The icon you see indicates that the bootloader cannot  find / boot OSX
probably files or partition have been wiped / damaged

Does the HFS file system even seem to be there if you check in Linux?
try booting from a OSX Install stick to see if it even detects the contents of your OSX partitions or just do a repair / install from there.

You could reinstall Ubuntu from a live session, and chose this at the installation something else, and mark the root only, and it might work fine this way.


How to Zip and Unzip a directory and its files in Linux I am a newbie in Linux.Whats is the complete process to zip and unzip a directory and its files.Please mention if any installation has to be done.

You say you are a newbie. Maybe you got Windows-experiences. If you do not have the packages installed yet, you need to

sudo apt-get install zip gzip tar

first (or by a graphical pkg-manager).

Then, for an entry it would be the easiest way to use zip/unzip:

zip -r my_arch.zip my_folder

where -r means "recursive".

To unzip you simply use

unzip my_arch.zip

Zip stores relative path names by default. There are several parameter-options available for zip. For that read: the manual (man zip). For a starting this will do.

Most often you will see .tar.gz endings in linux-world. That's the product of two tools: TAR (the tape archiver) and GZIP (the GNU-Zip).
Tar has got the call option to automatically gzip/gunzip files after "taring".

tar -cvzf may_arch.tar.gz my_folder

where

-c means "create"
-v means "verbose" (sometimes bothersome and slowing down...)
-z means "use (GNU)zip"
-f XYZ declares the name of the output file. (You should chose a helping name like XYZ.tar.gz)

There may also be .tar.bz2 endings. This is the product of the -j parameter instead of the -z parameter: you will choose compression with BZIP2 (-> man bzip2).

To extract you simply use -x (eXtract) instead of -c (Create):

tar -xvzf may_arch.tar.gz

Happy "zipping"!

I know several ways, but since you're new on linux. So I'll tell you how to zip a file using GUI method (the easiest way).

Create a new folder and fill it with anything you want, for example many of file (In my case, I'll fill it with theme folder) :

Right click the folder you want to zip and select "Compress..." option :

You can choose which file format you want by clicking combobox next to "Filename" textbox. Also you can set the folder you want to zip location.

Clicking "Other options" will lead you to password section, in other word you can set password for your preferred file so someone (include you) have to enter password before unzip the file.

Click create if done


Should I restart my PC if Unity crashes during upgrade? I am suffering from the bug which crashes Ubuntu when I click Alt+Tab: https://bugs.launchpad.net/unity/+bug/975168 .

While I was doing a do-release-upgrade -d just now to install 12.04, I accidentally clicked Alt+Tab. Now Unity crashed, Alt+Ctrl+F2 doesn't work. All I have is a blank screen. Usually Unity used to restart by itself but it didn't this time.

So my question is, since the upgrade has already finished downloading the packages and was installing them during the crash, should I leave the PC alone as it maybe still installing in the background? Or should I restart it (by holding the power button or Ctrl+Alt+Delete)?

The exact same thing happened to me. Here is my story:

During upgrade Unity crashed and I basically had access to nothing; Couldn't even open a terminal with Ctrl+Alt+T. The hard disk was still working, so I figured the update was still running, and I left it.
Eventually the disk activity stopped, so I had to assume the update was complete and forced a log out with Alt+SysReq+K, then a restart.
Upon loading Ubuntu again, I noticed I was getting an incorrect screen resolution so I knew something was up. I managed to log in, then ran Updates and was given an error about the upgrade being interrupted.
I had to open a terminal, first tried: sudo apt-get install -f, but this told me that I needed to run sudo dpkg --configure -a
This seemed to resume the upgrade process where it had left off, so I left it for another while. I got a few console prompts about replacing my desktop defaults file, so I guess when I had restarted previously it was waiting for some such reply (but I had no way of seeing it).
After this completed, seemingly with no errors, I ran sudo apt-get install -f again just to be sure. After that I rebooted and everything seemed dandy. Phew.

Of course if someone else has this problem their results may very, but maybe this will give someone some hope if their Unity crashes during the update (grr).

Here is what I did and I managed to restart unity and continue upgrade normally

Press Ctrl + Alt + F1 and logged in
killall unity-panel-service
killall compiz
ps ax | grep unity and killed everything with kill -9 pid#
Ctrl + Alt + F7
done


Tinny sound on Lenovo U510 I want to ask, how can I tweak my sounds from speakers. It now sounds so tinny, like the sound comes from a tin can. In Windows, I don't have any problems with it, but in Ubuntu it sounds just awful.

In search of a solution, I spent approximately six hours. I tried to reinstall the alsa drivers, tweak settings in alsamixer and I also try to restart pulseaudio. Nothing worked for me.

The off sound can be heard when someone in the track (sound) speaks a bit louder. When someone speaks normal, it's little bit better, and when I lower the volume it sounds even less tinny, but it can still be heard.

Do you have any tips?

I'm having this issue on a Lenovo Ideapad U510 with Intel Core i3. I am running Ubuntu 14.04.

lspci:

00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM77 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)
02:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)

and information from alsa-info.sh is located here: http://www.alsa-project.org/db/?f=907d60a47fd8c280bc33db9997d83a196dca96eb

you can try with alsamixer with the terminal. You can change the type for channel and have the level sound for the speaker changed.


How I can set program autostart to my second desktop? In Lubuntu we have folder /home/username/.config/autostart. Its OK, but how I can autostart app on my "invisible" desktop and in fullscreen (like after pressing F11)?

You Want to look into a program called devilspie. Ubuntu-Link

It is in the repos so a simple sudo apt-get install devilspie will do it.

According to the desktop entry spec, there don't appear to be any position-based properties in the standard entry keys.

If the specific application you're running accepts positional parameters though, you might be able to get it to work that way in the Exec entry.


How do I create a bootable USB on Ubuntu from Hiren's Boot CD ISO for Windows? Trying to create a Hiren's BootCD on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But since it is my Windows computer that I'm trying to fix I need an alternative. Please Help?

Unetbootin does the job of making a bootable USB, but for recent versions of Hiren's CD to work, a small fix must be made for the menu to work:

Open the Software Center and install UNetbootin .
Create the bootable USB using the Diskimage option and selecting the downloaded ISO.
After the USB is created, mount it in Nautilus (just click the USB drive icon),  go into the HBCD folder, rename the isolinux.cfg file to syslinux.cfg and copy it to the root of the USB, overwriting the existing file. Change the first line of syslinux.cfg from DEFAULT /HBCD/Boot/menu.c32 to DEFAULT menu.c32.

Now the USB boots and menu works fine :)

You can make a bootable USB on Ubuntu from any (bootable) .ISO image using dd command:

dd if=./someisofile.iso of=/dev/sdb

however, I'd like to warn you that dd is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the of one.

If you google for something like "dd iso usb", you'll fins quite a few tutorials, for example this one from Fedora, this one from Linux Mint, or this one from ArchLinux


Touchpad scrolling is not working in my laptop I am using Ubuntu 14.04 in my Lenovo B50-70 LAPTOP. But, scrolling in touchpad is not working.my laptop having Ps/2 Elantech touchpad id=12

I ran into the same problem but found a solution. Install this software by entering the following Synaptiks Touchpad command into the terminal.

sudo apt-get update

sudo apt-get install wget gdebi
wget http://http.us.debian.org/debian/pool/main/s/synaptiks/kde-config-touchpad_0.8.1-2_all.deb

sudo gdebi kde-config-touchpad_0.8.1-2_all.deb

Once the terminal is done doing its thing, type Synaptiks into the Unity dash and you'll see it come up, click on it and you can adjust the touchpad settings and enable vertical/horizontal scrolling. :)


Is using a VirtualBox safer than using WINE? I'm having to get a copy of Windows XP from the nether regions of the net and want to run it through a virtualbox.  Would that be safer as to a WINE installation? Safer as in "not possible to get any infections?"

Any help is appreciated.

(The only reason I'm getting a copy off the net is because I can't find my old copy of the XP disc - that's why I'm going this route)

Just to clarify, WINE is not actually used to install Windows. You don't need a windows installation to use WINE and windows programs under WINE. It can be considered to be an independent compatibility layer for windows programs.

If for any reason WINE won't do what you need it to, and you need to install windows, then Virtualbox is absolutely the best option for you. Windows will be completely separated from Ubuntu, so even if you pick up a virus or other threat while running Windows, it won't have any impact on your Ubuntu install.

Also as an aside, technically speaking it's very very difficult for windows malware to work under WINE but under certain circumstances it might be possible.

I think that Windows malware will not work under Wine , it must be specially designed for Wine because Linux dont have same comands as Windows but still if there will be some Wine malware it will not mess with your system only with your files in user home folder.


How to make Ubuntu server 18.04 use dns-nameservers from /etc/network/interfaces? On Ubuntu server 18.04 I've disabled netplan and using /etc/network/interfaces.

sudo apt-get -y install ifupdown

cat <<EOM  | sudo bash -c 'cat > /etc/network/interfaces'
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.5.5
netmask 255.255.255.0
gateway 192.168.5.254
dns-nameservers 192.168.5.53 192.168.5.5
EOM

sudo ifdown --force eth0 lo && sudo ifup -a

sudo systemctl stop networkd-dispatcher
sudo systemctl disable networkd-dispatcher
sudo systemctl mask networkd-dispatcher
sudo apt-get -y purge nplan netplan.io

But apparently the systemd-resolve doesn't take into account the dns-nameservers field.

In the /etc/resolv.conf it puts only this:

nameserver 127.0.0.53

Output of ls -la /etc/resolv.conf is:

lrwxrwxrwx 1 root root 39 Oct  2 15:28 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

Output of the sudo systemd-resolve --status | grep -A3 Server is empty.

I can define DNS servers in /etc/systemd/resolved.conf like this:

[Resolve]
DNS=192.168.5.53 192.168.5.5

Then the output of sudo systemd-resolve --status | grep -A3 Server is:

     DNS Servers: 192.168.5.53
                  192.168.5.5
      DNSSEC NTA: 10.in-addr.arpa
                  16.172.in-addr.arpa

And they are used correctly and appear in /etc/resolv.conf.

How to make the dns-nameservers config line work?

You need the package resolvconf, too.

So, to get rid of netplan completely:

Configure /etc/network/interfaces
Install ifupdown and friends: $ sudo apt install ifupdown resolvconf
Remove netplan: $ sudo apt remove nplan netplan.io

network interfaces files have been changed a lot on ubuntu 18.
I suggest you to check this website or another one to correctly configure your network adapter

how to configure network ubuntu 18

Anyways you can also (and that's the easiest way) configure your ip and nameservers from the network manager on settings.


Alt+Tab doesn't work when Citrix is in full screen I am using 12.04 and in my work we connect to a Citrix XenDesktop. I've installed Citrix Receiver, using this Ubuntu help wiki page and it all works perfectly.

But, I have a problem. Alt+Tab doesn't work in full screen mode. There are several adjustments you can choose when logging in, with the Settings button in the top right corner.

I like to work with 95% full screen, with the windows key combination in "full screen mode only". This allows me to use the windows combinations when a work in full screen, inside the remote computer (inside Citrix).

I can Alt+Tab past the "Citrix computer" when I put it down to 95%. It also allows me to use the "Ubuntu menu" on the left side. But I really can't make this work in Ubuntu.

I've tried to put the windows key combination to "remote server only" and yes, it works inside the server, but also only there and the Ubuntu menu stops working (in example print Screen. I am using this for documentation).

When I try to Tab from one place to another, even when Citrix isn't in full mode, if I stop there and the continue "tabbing" it continues inside Citrix.

I want to use windows key combination, but only in full screen mode. Does anyone have a solution to fix in another way?

Finally it's now working. I'm actually accessing remote desktop through web browser Google Chrome on Ubuntu 12.04.

I changed all the setting in Citrix receiver, but didn't realize to change the setting on web page. That is,  after typing username/password for the remote URI in the browser, there is a tab called setting (before click Remote Desktop Connect on AmericasXA...).

I was able to change the window size to full screen from Seamless. That's it, Alt+Tab and other keys started working fine on the remote desktop.

Enable Alt+Tab application toggling in a Citrix XENAPP desktop session

Open regedit on the client device to edit the registry
Navigate to the key HKEY_LOCAL_MACHINE \SOFTWARE\Citrix\ICAClient\Engine\Lockdown Profiles\All Regions\Lockdown\Virtual Channels\Keyboard\
Open Key: TransparentKeyPassthrough
Set the value to: Remote
Exit the Citrix receiver if it is started and log back into your Citrix desktop.
When the Citrix desktop session is the active window, you will be able to toggle between the applications in that session with Alt+Tab


Connecting Microsoft Surface Precision Mouse I am having some issues getting my Microsoft Surface Precision mouse to work under Ubuntu 18.04. I am trying this on a fresh install and I am using a Bluetooth Low-Energy module since my computer doesn't offer native Bluetooth. I have been able to connect and use another generic Bluetooth mouse.

My issue is that it appears to connect:

However, when I click, it states that its connected, but not paired:

How can I get my mouse to work?

Install these two packages (possible already installed): sudo apt-get install bluez blueman
Open with supersu: sudo nano /etc/bluetooth/main.conf
Uncomment in line 67 uncomment [Policy] and uncomment in line 89 [AutoEnable=false] and change it to [AutoEnable=true]
Open with supersu: sudo nano /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules and uncomment the whole line (it's only one)
Save all up and restart the system
When you logged in click on the blueman bluethooth menu (thats new)

Click: Local Services -> Pan Support -> at the bottom of the window, choose blueman (dhclient) -> Apply
Hold the button on the bottom of the mouse until the blue light blinks on and off, and wait to get into pairing mode. Once paired, you’ll see it in Devices.
Highlight it and right-click the device entry for Designer Mouse and choose Trust

Note: if the mouse speed is too fast, change it in the mouse settings!


How can I install pdftk in Ubuntu 18.04 and later? Is there any chance of getting pdftk working in Ubuntu 18.04?
I need this for creating PDF files with a watermark in shell.

Or, does anybody know a working alternative to pdftk to generate a PDF with a watermark in shell?

I already check/try out all of them:

sudo apt list pdf*
Listing... Done
pdf-presenter-console/bionic 4.1-2 amd64
pdf-redact-tools/bionic,bionic 0.1.2-1 all
pdf.js-common/bionic,bionic 1.5.188+dfsg-1 all
pdf2djvu/bionic 0.9.8-0ubuntu1 amd64
pdf2svg/bionic 0.2.3-1 amd64
pdfcrack/bionic 0.16-1 amd64
pdfcube/bionic 0.0.5-2build6 amd64
pdfcube-dbg/bionic 0.0.5-2build6 amd64
pdfgrep/bionic 2.0.1-1 amd64
pdfminer-data/bionic,bionic 20140328+dfsg-1 all
pdfmod/bionic,bionic 0.9.1-8 all
pdfmod-dbg/bionic,bionic 0.9.1-8 all
pdfposter/bionic,bionic 0.6.0-2 all
pdfresurrect/bionic 0.14-1 amd64
pdfsam/bionic,bionic 3.3.5-1 all
pdfsandwich/bionic 0.1.6-1 amd64
pdfshuffler/bionic,bionic 0.6.0-8 all
pdftoipe/bionic 1:7.2.7-1build1 amd64

But did not find a working tool.

The pdftk package in Ubuntu (and its upstream Debian package) was dropped due to its dependency on the now deprecated GCJ runtime. I found a fork that depends on OpenJDK or similar instead.
Install from a future Ubuntu release (recommended)
Starting with Cosmic (Ubuntu 18.10), Ubuntu ships pdftk-java from the same source code as below as a replacement.  Attempting to install pdftk will install this package instead.  Users of earlier releases can download it manually from the package repository and install it with their favourite package manager.
Install from PPA (outdated)
I built a Deb package (for Bionic only) with suitable dependencies:
sudo add-apt-repository ppa:malteworld/ppa
sudo apt update
sudo apt install pdftk

The package contains a wrapper script placed in /usr/bin, so you can invoke it as normally:
pdftk <arguments> ...

Install from source

Install the build tools and dependencies:
sudo apt install git default-jdk-headless ant \
    libcommons-lang3-java libbcprov-java

Of course you can use a different supported JDK than the one supplied by default-jdk-headless.

Download Marc Vinyal’s pdftk fork:
git clone https://gitlab.com/pdftk-java/pdftk.git
cd pdftk

Place symbolic links to the required libraries into the lib folder:
mkdir lib
ln -st lib /usr/share/java/{commons-lang3,bcprov}.jar

Build the JAR package:
ant jar

Run the JAR package:
java -jar build/jar/pdftk.jar --help

(Optional) To run the JAR package, e. g. when you distribute it to other systems, you need at least a working (headless) JRE like from the default-jre-headless package as well as the Java libraries libcommons-lang3-java and libbcprov-java:
sudo apt install default-jre-headless libcommons-lang3-java libbcprov-java

Again you can use a different JRE than default-jre-headless. This pdftk fork also supports builds for older JRE versions (≥ 7 according to the documentation).

(Optional) You can teach Linux to execute JAR (Java Archive) files via update-binfmts(8). Most JREs shipped in Deb packages, including those in Canonical’s package repositories, take care of that during installation, though it appears to be buggy in some OpenJDK packages.

P.S.: I tried this with the non-headless OpenJDK 9 in Ubuntu Trusty but I see little reasons why it shouldn't work with headless OpenJDK 10 in Bionic.
Depending applications
A commenter raised the valid question whether the depending PDF Chain applications is affected by this change:

No, PDF Chain is a C++ application and not directly affected by the deprecation of GCJ. It needs a working pdftk executable but doesn’t care how it works under the hood. In any case, PDF Chain was dropped from Bionic as well as pdftk.

What a great opportunity to use some docker magic!

What I did was to use a docker container running ubuntu 16.04, install pdftk
inside it and run it there.

Here are the exact steps if you want to do the same thing:

Install docker if you don't already have it (https://docs.docker.com/install/)
Create a directory somewhere called pdftk
Create a directory called docker inside the pdftk directory
Copy this Dockerfile into the pdftk/docker directory: https://github.com/gkotian/gautam_linux/blob/master/docker/pdftk/Dockerfile
Copy this script also into the pdftk/docker directory: https://github.com/gkotian/gautam_linux/blob/master/scripts/dockershell
Make sure the dockershell script is executable
Into the pdftk directory, copy all the pdf files you want to work with
cd /path/to/pdftk
Run the dockershell script with the path of the Dockerfile: docker/dockershell docker/Dockerfile (this will take some time the very first time you run it)

Now you should have a prompt inside the docker container, from where you can run
pdftk. When you're done, type exit to exit the container and return to the
host machine. Any newly generated files will be present in the pdftk directory
(but they'll be owned by root, so you may need to change ownership as necessary).


Update to 20.10 failed according to lsb_release -a I tried updating my computer to Ubuntu 20.10, however it seems to have failed.
What I did:
sudo do-release-upgrade

This seemed to have worked, it ran through and the computer restarted with a gorilla welcoming me as new background image. However lsb_release -a tells me I'm still on 20.04:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS (fossa-bulbasaur X38)
Release:    20.04
Codename:   focal

Running sudo do-release-upgrade again ends in "aborting"
$ sudo do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]
Get:2 Upgrade tool [1’338 kB]
Fetched 1’339 kB in 0s (0 B/s)
authenticate 'groovy.tar.gz' against 'groovy.tar.gz.gpg'
extracting 'groovy.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://archive.ubuntu.com/ubuntu groovy InRelease
Hit http://security.ubuntu.com/ubuntu groovy-security InRelease
Hit http://archive.ubuntu.com/ubuntu groovy-updates InRelease
Get:1 http://archive.ubuntu.com/ubuntu groovy/main Sources [1’300 kB]
Get:2 http://security.ubuntu.com/ubuntu groovy-security/universe i386 Packages [13.8 kB]
Get:3 http://security.ubuntu.com/ubuntu groovy-security/universe amd64 Packages [17.3 kB]

[...]

Fetched 58.9 MB in 6s (9’192 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

Checking for installed snaps

Calculating snap size requirements

Updating repository information
Hit http://archive.ubuntu.com/ubuntu groovy InRelease
Hit http://security.ubuntu.com/ubuntu groovy-security InRelease
Hit http://archive.ubuntu.com/ubuntu groovy-updates InRelease
Fetched 0 B in 0s (0 B/s)

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

Calculating the changes

Calculating the changes

Restoring original system state

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

I don't know in what state my system currently is... The sources all have groovy packets, the background image changed, but the OS clearly still is 20.04.
Would be glad for some help on this...
OS: Ubuntu 20.04, 5.8.0-26-generic /
Hardware: Dell XPS 13 9310

User jos from the comment section is right. If you have the groovy repos in your /etc/apt/sources.list and do
sudo apt update
sudo apt dist-upgrade

you have technically an up-to-date Ubuntu 20.10 installation, regardless of what the text file says in /etc/lsb-release.
I don't know how you ended up with wrong lsb-release info. I would recommend you to cleanly install Ubuntu 20.04, as pointed out in your other question thread, as this gives you gives you a lot more possibilities currently to try things out easily with your Dell XPS 13, since Dell is officially supporting that release for that machine.


Log files are taking too much space and I can't delete\clear them After using Ubuntu for 2.5 months, my /var directory reached around 37 GB or RAM while my / directory is all 50 GB or RAM and the rest of space is for my /home.

I found that the following files are taking too much space in /var/log

-rw-r----- 1 syslog            adm   14G Feb  2 07:46 kern.log.1
-rw-r----- 1 syslog            adm   13G Feb  2 07:46 ufw.log.1
-rw-r----- 1 syslog            adm  5.9G Feb  2 07:46 syslog.1
-rw-r----- 1 syslog            adm  451M Feb  2 23:53 syslog
-rw-r----- 1 syslog            adm  451M Feb  2 23:53 kern.log
-rw-r----- 1 syslog            adm  441M Feb  2 23:51 ufw.log

Side question, what is syslog and adm ?!

Seeing ufw there, I checked it's configuration

$ sudo ufw status verbose
Status: active
Logging: on (full) <<<<<

So I set logging to low

$sudo ufw logging low

I read that logrotate should handle log rolling but it's configuration doesn't seem to handle the /var/log directory by default.

This is my /etc/logrotate.conf file content

$ cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here

I tried deleting the log-file-name.log.digit (i.e. kernel.log.1, ufw.log.1, whatever.log.0) but I couldn't. I tried sudo echo '' > kernel.log.1 but I failed too. It always says

$ sudo echo '' > kern.log.1
bash: kern.log.1: Permission denied

Restarting didn't help either. The logs directory wasn't cleared (I thought linux clears all the logs when it restarts, obviously I'm wrong), and I still couldn't clear\delete the mentions logs.

How can I clear those logs and make sure I never face this situation again ?

Using Ubuntu 13.10

Answer

sudo rm /var/log/*.1

But I suspect that what made my command faile is that I tried doing the same thing while I'm inside the directory /var/log (i.e. pwd = /var/log, then running sudo rm kernel.1.log). If someone faces the same situation, please try removing *.1 files while being in the /var/log directory (i.e. cd /var/log;sudo rm*.1) and report the results. Thank you.

Your current logs are fine, still, those without .1. That is good, and you can remove it with:

sudo rm /var/log/*.1

Now you command doesn't work because of this:

sudo 'Everything here runs as root' > Everything here run as user

So if you wanted to do what you tried the correct would be:

sudo sh -c "echo '' > kern.log.1"

This is because the pipe opens a shell with the current user.

You can truncate logs without deleting by

cat /dev/null > file.log

But backup and archive log before execute command is useful.


Ubuntu 14.04 subshell and variable expansion in custom keyboard shortcuts? How can I enable bash expansion by custom keyboard shortcuts in 14.04? Here's an example that I've been trying to get setup; I want to execute this exact command (which works from a terminal running bash):

gnome-screenshot --window --remove-border -f ~/Pictures/screenshot_$(date +%x_%H:%M:%S:%N).png

It doesn't work as is, and neither does:

gnome-screenshot --window --remove-border -f $HOME/Pictures/screenshot_$(date +%x_%H:%M:%S:%N).png

If I change it to the following:

gnome-screenshot --window --remove-border -f "/home/user/Pictures/screenshot_$(date +%x_%H:%M:%S:%N).png"

I end up with a file on my desktop called "screenshot_$(date +%x_%H:%M:%S:%N).png" (no subshell expansion). What am I doing wrong? What executes these commands if not bash? Why aren't the subshells or variables/tildes expanded?

The keyboard shortcuts field in Unity works in a similar manner to .desktop files, i.e. commands are executed without any form of subshell or variable expansion and can't access any environment variables.

I wasn't able to find an official specification regarding the keyboard shortcuts menu but I think it's save to assume that command execution follows similar guidelines to the Exec field in XDG .desktop files.

What this means, in practice, is that there are two ways you can make your custom command-line work with the shortcuts menu:

Transform your commands into a simple shell script and point the keyboard shortcut to the shell script.

For instance, you could paste the following into a new text file, name it something like custom_screenshot_script and make the script executable:

#!/bin/bash
gnome-screenshot --window --remove-border -f "~/Pictures/screenshot_$(date +%x_%H:%M:%S:%N).png"

Call bash to execute your command.

This is more tricky because you have to escape your arguments correctly. Something like the following should work:

bash -c "gnome-screenshot --window --remove-border -f \"~/Pictures/screenshot_$(date +%x_%H:%M:%S:%N).png\""

In my case I would make a script:

/bin/sh

Case (window_border) in
        ~./picture

    gnome-screenshot --window ~/picture/screenshot_$(date+%X_% H:$M:$:$S:$n)*png

    Bash -i remove-border -f window

    Bash --window --remove-border -f ''~/picture/screenshot_$(date+%X_%H:$M:$:$S:$N).png''

endl

and it might work Fine This Way.


Skype Video Call Screen keeps flashing and Camera Problem Operating System: Ubuntu 16.04.1.

Application: Skype 4.3 for Linux.

Whenever I start a Video Call, I can see the person on the other side but the screen keeps flashing ceaselessly.

Furthermore, the person on the other side and I, can only see a closeup of my face. So I need to move away from the screen in order for the other person to see my face.

sudo lshw | grep -A9 VGA
         description: VGA compatible controller
         product: Sky Lake Integrated Graphics
         vendor: Intel Corporation
         physical id: 2
         bus info: pci@0000:00:02.0
         version: 07
         width: 64 bits
         clock: 33MHz
         capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
         configuration: driver=i915_bpo latency=0

Help much appreciated.

Thank you.

I also have chipset Intel 915 and I had the same problem with video calls in Skype.

Upgrade to Ubuntu 16.10 (from 16.04.1) helped me and completely solved this problem.

I believe that problem is solved in new version of Linux kernel. You can also try this fix if you don't want to upgrade.

What worked for me, was using the nomodeset option in the grub bootloader. There are two methods to set nomodeset:

Temporary:

While booting press and hold shift in order to see the grub menu
Choose the entry you want to change (in a normal installation the first entry) and press e to edit it
Look for quiet splash and add nomodeset before it
Finally press F10 to boot.

If this worked for you, you can use the permanent way for all bootups.

Permanent:

edit /etc/default/grub (for example: sudo nano /etc/default/grub)
change the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="nomodeset quiet splash"
Finally update the grub config: sudo update-grub

The next time rebooting, you don't have to specify the boot option.

I run Ubuntu 16.04 LTS with 4.4 kernel on Lenovo i310 laptop.

The output for sudo lshw | grep -A9 VGA is the following:

  description: VGA compatible controller
  product: Sky Lake Integrated Graphics
  vendor: Intel Corporation
  physical id: 2
  bus info: pci@0000:00:02.0
  version: 07
  width: 64 bits
  clock: 33MHz
  capabilities: pciexpress msi pm vga_controller bus_master cap_list
  configuration: latency=0

This answer is partially copied from last answer at When I start my camera in video call on Skype 4.1. incoming video is flashing blue?


How do I share a file by link? My son made some "thank you" videos that he would like to send to his friends. Each friend gets a different video, and they all reside in a single directory.

Is there an easy way to email a link to each friend so they can see their video?
It's fine if they want to download the video, but I don't want them to be able to edit the original file
I don't want them to be able to "browse" or access the other files in the directory (or any other directory on my server, for that matter)
It would be nice if I could edit the appearance of the link (ie, not have the link as //server/file-location but maybe thankyou-video)

I realize that I can just upload to YouTube, etc, but I'm looking for a way to do this without third-party.

A follow-up question is whether I can do the same with an entire directory (ie, share a directory of photos with someone) without the other party having to use a third-party app.

Using 16.04 with desktop.

Is there an easy way to email a link to each friend so they can see their video?

No, not really. You need some kind of sharing service. This can be anything from Owncloud, hosted at a computer you own, to YouTube or Dropbox. But you need some kind of publicly accessible server. A desktop computer that is on at random times is not a good fit. You can also install apache, and simply drop the files into the webserver's root directory (typically /var/www/html on Ubuntu).

The answer depends a lot on if this is a one time thing. If so? Use dropbox, youtube or whatever third party service you want. Owncloud or apache requires some maintenance, and takes time to set up. WHich is fine, if you plan to reuse it, or want to learn...

  It's fine if they want to download the video, but I don't want them to be able to edit the original file

Forget it. Hollywood's been trying DRM for ages - they have not succeded. If people can watch it, they can copy it. If they can copy it, they can edit it.

  I don't want them to be able to "browse" or access the other files in the directory (or any other directory on my server, for that matter)

How you do this depends on what kind of service you use for sharing it. If you use an http-server, limiting directory listing would be one way to avoid it.

  It would be nice if I could edit the appearance of the link (ie, not have the link as //server/file-location but maybe "thankyou-video")

//server... implies Samba share. Don't use that over the Internet. Use HTTP(S). The appearance of the link is typically handled separately; many mail clients support HTML e-mails which lets you define the link text yourself.

It's a good idea to install an ftp server. Select a separate folder, which will be visible "from the outside", and in the settings allow only download. In this way, you can protect the source file from being replaced or edited.

In the same way, you can share other materials. Create several folders with restricted access by ip or password, and from your ftp server different people will be able to download what you want to show only to them.

If you want to be able to edit the appearance of the link, you will be helped by the installation of a DNS server, for example, bind9. It's light enough in the tuning.

You can not protect the already downloaded file.