Bash script to monitor file change and execute command I have a folder with a bunch of subfolders, these folders have asciidoctor formated filed with .adoc extension.

Every time I made changes to files (which is often) I need to run

asciidoctor -q filename.adoc

to compile it into HTML format.

I am trying to automate the process. so far I have come with this using entr:

ls *.adoc | entr asciidoctor -q *.adoc

but only works with existing folder not for subfolders. I have tried this variation, but it doesn't work:

find . -name '*.adoc' | entr asciidoctor -q *.adoc

Any ideas how I could implement this automate process for all the subfolders?

Linux provides a nice interface for monitoring all file system events like creating, modifying, removing files. The interface is inotify family of system calls, the userspace utilities leveraging these calls are provided by the inotify-tools package in Ubuntu (available on the universe repository). If you don't have it already, install by:

sudo apt-get install inotify-tools

inotify-tools provides inotifywait and inotifywatch binaries, we need the first one.

So you want to run the command asciidoctor -q some_file when any .adoc file is modified (some_file will replaced by that), if so assuming your .adoc files are in directory /foo/bar, you can set the watch:

inotifywait -qm --event modify --format '%w' /foo/bar/*.adoc

-q enables the quiet mode,  no info from inotifywait itself
-m enables monitor mode, otherwise it will exit after the first event
--event modify, we are only interested in modify event i.e. when a file is modified. Other possible values include open, close etc.
--format %w, we only want the file name that is modified rather than bunch of other info as we will use the file name as input to another command
/foo/bar/*.adoc will be expanded to all .adoc files under /foo/bar directory

Now the above will show you the filename whenever any is modified, now to run the command on the filename (assuming the command takes arguments via STDIN):

inotifywait -qm --event modify --format '%w' /foo/bar/*.adoc | asciidoctor -q

You can also setup a recursive watch on the directory, you will then need to use grep to filter the desired files only. Here setting the watch recursively (-r) on directory /foo/bar and using grep to filter only .adoc files:

inotifywait -qrm --event modify --format '%w%f' /foo/bar | grep '\.adoc$' | asciidoctor -q

When watching directories the output format specifier %w resolves to the directory name, so we need %f to get the file name. While watching files, %f would resolve to empty string.

Note that, you can also run inotifywait in daemon (-d) mode, you can also script the whole  thing, and/or run in background, and/or play with it more other options.

Also, you can replace asciidoctor with any other command of your choice, if you want.

Check man inotifywait to get more idea.

Well I recommend the following.

#!/bin/bash
#Script
for SRC in *.adoc;
      do
      asciidoctor -q $SRC
  done


Unknown Folder on System root /.rpmdb Can somebody explain what the /.rpmdb folder in the root directory is for? Which application creates it and is using it?

I can't say definitively what creates this directory, but it is likely that it is created either as a side effect of installing third-party Linux kernel drivers such as NVIDIA or VirtualBox using DKMS, or by some other unsupported installer script not provided by Ubuntu. This directory was most probably created as a side effect of an install process that happens to support both rpm-based and deb-based distributions. DKMS happens to be such an install script and can definitely create this directory under the right conditions. The directory can safely be deleted without harming your system, but it may be created again when updates are installed later. See bug #1069350 for an open bug report tracking this issue.

That's the short answer, now some more detail.

What is .rpmdb?

As you may know, rpm is a software packaging format and set of tools for installing packages and maintaining the database of installed packages and their interdependencies. It is used by many distributions but not by Ubuntu and other deb-based distributions. Unfortunately for Ubuntu, however, any use of the rpm command requires a valid "rpmdb" database to exist or to be created.

On rpm-based distributions this is not a problem because they have a system-wide rpmdb by definition. On Ubuntu systems, since there is no need for a system-wide rpm database, rpm is configured to use a database under each user's home directory, specifically $HOME/.rpmdb. This database is silently created as needed whenever rpm runs. Since it is in each user's home directory, there are no problems with shared permissions or requiring the database to be created by an administrator. Every user just gets their own private empty rpm database.

Why would rpm be run at all on Ubuntu?

It turns out that some projects like to create install scripts that will work on any distribution, whether that distribution is rpm-based, deb-based, or neither. DKMS is one such project, it allows third-party drivers to be built for whatever Linux kernel a system happens to be running, and it is written to work across distributions. In part of its logic to determine which distribution it is running on and which kernel version is present, it executes an rpm command to query the database. As I explained earlier, this will silently create a .rpmdb directory if one does not already exist in the current user's home directory. The database query should fail, since Ubuntu is not an rpm-based distribution, and DKMS continues on.

If you install any additional Linux kernel driver packages from Ubuntu such as VirtualBox, NVIDIA, ndiswrapper, or openswan, you are probably using DKMS to install those drivers for your kernel. This is typically done automatically when the driver is installed from the Ubuntu repositories. So any time either a kernel or driver update is installed, DKMS runs again to rebuild the driver for all available kernel versions. It has been shown that when those packages are updated, the /root/.rpmdb directory does in fact appear, which is in root's home directory since root is required to install updates.

I don't know of any other specific third-party installation scripts that may also execute rpm commands as a way of detecting the distribution type, but it's certainly possible. For example, you may want to install LargeProprietaryProgram from Initech, and to do so you run an install.sh script as root. This script may try to query an rpm database to see if you're running an rpm-based distribution, and /root/.rpmdb is created again.

So that explains why you may see /home/user/.rpmdb and /root/.rpmdb directories show up on your system. But why in the system root directory?

Why is .rpmdb created in the root directory?

The easiest explanation for this is that the $HOME environment variable is unset somehow in some process context that runs rpm. Let's use DKMS for the sake of argument because we definitively know it can run rpm commands. Because it typically runs when packages are installed or updated, it runs in the environment of whatever package manager you happen to use. If you use sudo apt-get to install packages, it will inherit a correct $HOME. If you use PackageKit, it may not have a $HOME variable at all. I am not sure what environment is provided by Synaptic or Ubuntu Software Center.

So if DKMS is running in an environment that does not have a $HOME variable, and because of the way the rpm database was defined, an empty rpm database will be created in /.rpmdb instead of /root/.rpmdb. This has been fixed in the rpm package for Ubuntu in the 14.10 development version, so it should now create /root/.rpmdb even if $HOME is not defined.

I hope this explains why there are directories called .rpmdb at all on an Ubuntu system, why they may get created seemingly automatically, and why one can be created in the root directory under the right set of conditions. It's nothing to worry about, there is nothing malicious in the existence of this directory, and it can simply be deleted if its presence is offensive to aesthetics or security scanners.

RPM (Red Hat Package Manager) is a package management system. It RPM was originally written in 1997 by Erik Troan and Marc Ewing for use in Red Hat Linux, but now is used in many GNU/Linux distributions.

Working behind the scenes of the package manager is the RPM database (RPMDB), stored in /var/lib/rpm. It consists of a single database (Packages) containing all of the meta information of the installed rpms. The database is used to keep track of all files that are changed and created when a user (using RPM) installs a package, thus enabling the user (via RPM) to reverse the changes and remove the package later.

Reference: http://en.wikipedia.org/wiki/RPM_Package_Manager


Unable to upgrade from 16.04 to 18.04, no real error? I received the notice that there's an update for my desktop install, but I'm unable to do so. There's no real error messages that I can see. I've run sudo apt autoremove, sudo apt upgrade, and sudo apt install, and it gives 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. This is my screen when I run do-release-upgrade:

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit http://archive.canonical.com xenial InRelease
Hit http://security.ubuntu.com/ubuntu xenial-security InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

Restoring original system state

Aborting
Reading package lists... Done
Building dependency tree
Reading state information... Done
=== Command detached from window (Mon Aug 20 20:34:56 2018) ===

This is my main.log:

2018-08-20 20:34:50,649 INFO Using config files '['./DistUpgrade.cfg.xenial']'
2018-08-20 20:34:50,649 INFO uname information: 'Linux egwene 4.4.0-133-generic #159-Ubuntu SMP Fri Aug 10 07:26:31 UTC 2018 i686'
2018-08-20 20:34:50,862 INFO apt version: '1.2.15ubuntu0.2'
2018-08-20 20:34:50,862 INFO python version: '3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609]'
2018-08-20 20:34:50,864 INFO release-upgrader version '18.04.24' started
2018-08-20 20:34:50,868 INFO locale: 'en_US' 'UTF-8'
2018-08-20 20:34:51,059 DEBUG Using 'DistUpgradeViewText' view
2018-08-20 20:34:51,111 DEBUG enable dpkg --force-overwrite
2018-08-20 20:34:51,150 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz'
2018-08-20 20:34:54,329 DEBUG lsb-release: 'xenial'
2018-08-20 20:34:54,330 DEBUG _pythonSymlinkCheck run
2018-08-20 20:34:54,331 DEBUG openCache()
2018-08-20 20:34:54,332 DEBUG No such plugin directory: ./plugins
2018-08-20 20:34:54,332 DEBUG plugins for condition 'PreCacheOpen' are '[]'
2018-08-20 20:34:54,332 DEBUG plugins for condition 'bionicPreCacheOpen' are '[]'
2018-08-20 20:34:54,332 DEBUG plugins for condition 'from_xenialPreCacheOpen' are '[]'
2018-08-20 20:34:54,333 DEBUG quirks: running PreCacheOpen
2018-08-20 20:34:54,333 DEBUG running Quirks.PreCacheOpen
2018-08-20 20:34:54,721 DEBUG /openCache(), new cache size 56038
2018-08-20 20:34:54,721 DEBUG need_server_mode(): run in 'desktop' mode, (because of pkg 'ubuntu-desktop')
2018-08-20 20:34:54,721 DEBUG checkViewDepends()
2018-08-20 20:34:54,721 DEBUG running doUpdate() (showErrors=False)
2018-08-20 20:34:55,529 DEBUG openCache()
2018-08-20 20:34:55,939 DEBUG /openCache(), new cache size 56038
2018-08-20 20:34:55,940 DEBUG doPostInitialUpdate
2018-08-20 20:34:55,940 DEBUG plugins for condition 'PostInitialUpdate' are '[]'
2018-08-20 20:34:55,940 DEBUG plugins for condition 'bionicPostInitialUpdate' are '[]'
2018-08-20 20:34:55,940 DEBUG plugins for condition 'from_xenialPostInitialUpdate' are '[]'
2018-08-20 20:34:55,940 DEBUG quirks: running bionicPostInitialUpdate
2018-08-20 20:34:55,940 DEBUG running Quirks.bionicPostInitialUpdate
2018-08-20 20:34:55,951 DEBUG abort called
2018-08-20 20:34:55,951 DEBUG openCache()
2018-08-20 20:34:55,951 DEBUG failed to SystemUnLock() (E:Not locked)
2018-08-20 20:34:56,356 DEBUG /openCache(), new cache size 56038

What could be the problem here?

Edit

Using the link provided by WinEunuuchs2Unix, here are my PPA links:

'http://us.archive.ubuntu.com/ubuntu/ xenial main restricted'
'http://us.archive.ubuntu.com/ubuntu/ xenial universe'
'http://us.archive.ubuntu.com/ubuntu/ xenial multiverse'
'http://security.ubuntu.com/ubuntu xenial-security main restricted'
'http://security.ubuntu.com/ubuntu xenial-security universe'
'http://security.ubuntu.com/ubuntu xenial-security multiverse'
'http://archive.canonical.com/ xenial partner'

try:

sudo apt-get install lsb-core

and then upgrade

Sometimes this package is missing or corrupted and the installer has hard time figuring out which version is currently running, There are lots of complains about that if you google it. The same might happen in Debian.

sudo apt remove --purge snapd

Tried all options from various threads but above has fixed the problem for me


Black screen on startup without upstart (Ubuntu 15.10) Currently when I try starting my computer in normal mode it will display the pulsating kubuntu logo and then a black screen will stay forever.

What I did to get here:
Installed Ubuntu 15.10, installed kde desktop right after.
I was playing around with compiling 64-bit and 32-bit stuff at the same time and in the process of installing 32-bit gcc or g++ or something like that it uninstalled some kde packages. It did warn me, yes. I take full responsibility for that. As I did not restart, the system ran fine for a few days until today it crashed and I restarted it. It did not boot to desktop, I got to enter my login and password to get a command line. It complained only about wine-staging:i386 being broken, kinda random, probably not relevant. So naturally I wanted to get rid of kde completely and get the defaults back so I installed ubuntu-dekstop. Restarted and that's it, black screen and nothing happens. But the strange thing is when I choose to boot with the upstart option it starts just fine. The question then is can I get normal boot to work again? And maybe get rid of the kubuntu logo on startup?

To solve the issue the correct version of libqt5x11extras5 needs to be installed.

sudo apt-get install libqt5x11extras5=5.4.2-2build1

5.4.2-2build1 is the correct version for Wily according to packages.ubuntu.com. Previously I had version 5.5.1-1 that caused segfaults.

The broken package is from Kubuntu-ppa Backports:
http://www.ubuntuupdates.org/package/kubuntu-ppa_backports/wily/main/base/libqt5x11extras5

hhmm, i386 broken......well that doesn't sound good at all. For a stable Desktop OS I'd honestly wipe it and install the most current Ubuntu LTS OS. Which is currently 14.04 until 16.04 releases (traditionally in late April and then again in October). While 15.10 is not LTS it is only supported for 9 months, it is expected to be buggy.

BUT if you do actually want to attempt to fix it start with:

sudo apt-get update

first then

sudo apt-get upgrade

secondly, then reboot lastly. That obviously updates and upgrades your os. If that doesn't help then try a more brute force attempt:

sudo history

That should (key word: SHOULD) house every command you've done in terminal. Which may help you isolate exactly what commands you ran, to figure out what commands to revert. This helped me isolate and fix issues with desktop not showing on Ubuntu 12.04 LTS Precise Pangolin.

IF you ran the commands as root (not recommended!!) you'll have to be root to see roots history. For that:

su -

login with your root PW
then run:

history

If those don't help; let me ask, are you running the 64bit version of Ubuntu on a 64bit CPU? or 32bit os on 32bit cpu? or 32bit os on 64bit cpu? or 64bit os on 32bit CPU?

Good luck with taming the wily werewolf.


Why is Ubuntu repeatedly asking me to upgrade? Hello there I have recently downloaded Ubuntu 12.04 and installed it alongside with my windows7. After I finished my installation it asked me to upgrade and I upgraded but after that my Ubuntu desktop became 12.10. Now again it asks me to upgrade to 13.04.

I am really confused cause as on the Ubuntu download center it is stated that Ubuntu 12.04 will have support till 2017.

What is really happening? Do I need to upgrade every time it asks me to upgrade or can I skip the upgrade. And what will happen to my first installed Ubuntu 12.04 version? Will it have support till 2017?

I am really a beginner with Linux and Ubuntu.

Ubuntu have two different release types

Normal releases come out every six months and the next one 13.10 is due out tomorrow.  Normal releases are supported for 9 months
LTS (Long Term Stable) releases come out every two years and are supported for 5 years.  12.04 is the latest LTS release and is supported until April 2017.

The reason for the two different release types is that LTS releases remain stable for a long time so are useful for business and for those users who don't want to keep updating their system.  The Normal releases allow users to try all the latest features so that when the next LTS release comes out everything has been well tested for users who prize stability over new features.

Many people such as myself only use LTS releases for day to day work and don't rush to install the next LTS release.

If you have only recently installed Ubuntu you may want to reinstall 12.04 so you don't have to keep updating.

Run the update manager select Preferences and make sure Notify me of a new Ubuntu version is set to For long-term support versions as shown.

You will then not be notified of a new version until April 2014 and you can choose to update at any time you choose from then until support runs out in 2017.

Read this Links you will came to know About the Difference Between upgrade and dist-upgrade

What is “dist-upgrade” and why does it upgrade more than “upgrade”?

Why use apt-get upgrade instead of apt-get dist-upgrade?

Click here


Skype 4.2.0.11 Crashes on Ubuntu 12.04 LTS 64bit During Video Call After Receiving IM Having an issue with Skype crashing while in a video call when anyone sends me an IM. I can have a Skype video call without any problems for any duration just as long as I don't receive any IM's during the duration of my video call. The moment that I receive an IM, Skype is guaranteed to crash within 1 or 2 seconds.

Searched this site along with others, contacted Skype, but I still can't get it to work properly.

Basic Computer info:

Memory: 7.7 GiB

Processor: Intel® Core™ i7-2630QM CPU @ 2.00GHz × 8

Graphics: Nvidia GeForce GT520M

OS Type: 64-bit

Disk: 27.1 GB

My video card actually doesn't come up under System Details, finding drivers for that has become a story in itself.

Hope someone out there knows what's up and can help me out! Thanks!

If you still have the problem, you should try this one:
http://community.skype.com/t5/Linux/4-2-0-11-1-for-linux-crashes-when-answering-calls/td-p/1655001 - worked for me


How to count number of files in a directory but not recursively Simple question I'm sure.  I've seen an answer that show how to do it including subdirectories, but I want to know how many files (not folders) are in the current directory only.  Thanks.

ls -F |grep -v / | wc -l

ls -F list all files and append indicator (one of */=>@|) to
entries
grep -v / keep all de strings that do not contain a
slash
wc -l count lines

To count total number of files with specific extension you may type:

ls|grep jpg |wc -l


Ubuntu 17.10 and later: can't change the input switching shortcut to alt+shift When I try to set the default combo for switching to different language layouts in my keyboard from Shift+Super+Space to Alt+Shift I can't.

I used to have this combo since Ubuntu 14 and even before that when I used to have Windows. Now for some stupid reason it does not allow (actually nothing happens its not like I get an error or the combo is used elsewhere). How could I bypass this bug?

You may use (GNOME) Tweaks to achieve your goal. First install it by running

sudo apt install gnome-tweaks

(on Ubuntu 18.04 and later) or

sudo apt install gnome-tweak-tool

Launch Tweaks and go to Keyboard & Mouse section. Click on the "Additional Layout Options".

A new window should pop up. Look for "Switching to another layout" and expand it. Then check the "Alt+Shift" option.

Ubuntu 20.20, gnome flashback, the gsettings option didn't work for me. This fixed the problem (copied from my other machine):
gsettings set org.gnome.desktop.input-sources xkb-options "['grp:alt_shift_toggle', 'grp_led:scroll', 'lv3:switch']"

Keyboard shortcuts still show Super+Space combination, and it still works, but Alt+Shift works as well.


Access RAID1 content from other Linux system of a dual boot I have prepared for a friend a little NAS made of Ubuntu Server 20.04 on an SSD and two HHD in RAID1.
The software RAID1 has been made during the Ubuntu installation, here some info about it:
$ fdisk -l
Disk /dev/sda: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EFRX-68N
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: ST4000VN008-2DR1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/md1: 3.65 TiB, 4000651739136 bytes, 7813772928 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

(I was expecting to see partitions here, but there seems to be no sda1 or sdb1...)
$ cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5]
[raid4] [raid10]  md1 : active raid1 sdb[1] sda[0]
      3906886464 blocks super 1.2 [2/2] [UU]
      bitmap: 0/30 pages [0KB], 65536KB chunk

unused devices: <none>

My friend is going to connect and transfer files to it with WinSCP from his Windows computer.
I still have to install Jellyfin so that he can browse his media easily.
Till here everything is ok!
But as my friend does not know anything about Linux and network as well, I am thinking of an option that could let him access the files on the RAID1 in case of a problem. Like if something prevent him from reaching the server from his Windows computer, if the RAID1 failed somehow or if I am not here to help.
So I ended up installing Linux Mint on a another partition of the SSD, so that he can boot to it in case of emergency, thanks to a dual boot option in Grub.
In order to access his content from Linux Mint, I see two options:

re-creating the RAID1
allow access to each drive of the RAID1 (/dev/sda and /dev/sdb)

Options 1) should be easily done by activating the RAID1 with mdadm --assemble --scan and then mount /dev/md1
I did not try that though, because in case of a RAID problem, I think it should be safer to be able accessing each member of the RAID separately.
That's where I am stuck...
I have tried adding the /dev/sda UUID in fstab
/dev/sda 3.7GB  UUID=xxx /mnt/local_disk1 ext4    errors=remount-ro 0       1

and then mount it with mount /mnt/local_disk1 /dev/sda, but this is what I get:
mount: /mnt/local_disk1 : wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.

I also tried to specify the file system with mount -t ext4 /mnt/local_disk1 /dev/sda, which gives me:
mount: /dev/sda : /mnt/local_disk1 is not a block device

Any idea of what I should do to let me access the content of /dev/sda from Linux Mint?
(Obviously without breaking the RAID1 of Ubuntu server ;)

Here under the Linux Mint situation:
$ lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
NAME          SIZE FSTYPE            TYPE MOUNTPOINT
sda           3.7T linux_raid_member disk
sdb           3.7T linux_raid_member disk
nvme0n1     119.2G                   disk
├─nvme0n1p1   512M vfat              part /boot/efi
├─nvme0n1p2    50G ext4              part
└─nvme0n1p3  68.8G ext4              part /

I finally took option 1) above, recreating the RAID1 in Linux Mint, which should be safer actually.
I only had to
$ apt install mdadm
$ reboot

And now I have
$ lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
NAME          SIZE FSTYPE            TYPE  MOUNTPOINT
sda           3.7T linux_raid_member disk
└─md1         3.7T ext4              raid1
sdb           3.7T linux_raid_member disk
└─md1         3.7T ext4              raid1
nvme0n1     119.2G                   disk
├─nvme0n1p1   512M vfat              part  /boot/efi
├─nvme0n1p2    50G ext4              part
└─nvme0n1p3  68.8G ext4              part  /

Just had to mount it and add it to /etc/fstab to let me access the Raid from Linux Mint.  : )
Both OS have identical mdadm.conf and fstab btw.


Files button on the side opens a new window instead of minimized window? If I open my hard drive from the hard drive icon (I have 2 hard drives) and then I minimize it, it minimizes to the files and when I try to restore it it opens a new file manager (this happens weather I open the drive from the file manager itself or if I open the drive from the Unity bar). In order to get back I need to Alt+Tab. Is there a way to fix this (Ubuntu 13.04 the best release ever)

I think this is a bug. It only happens (at least, for me) when Nautilus is viewing files on a separate drive (like an external drive, or a memory card).

There is a workaround until this is fixed though. All you have to do is simply hover your mouse over the "Files" icon in launcher, and scroll up or down. If you have more than one window open, it will scroll between them. This, I find, is a lot faster than using Alt+Tab.

Could you be more specific: how do you minimize and restore it? By clicking hard drive icon or 'Files' icon? Left or right mouse button with selecting it from drop down list?

In my case LMB click either on 'Files' or 'Hard Drive' icon restores the same window.

Maybe try to install all the system updates:

sudo apt-get update && sudo apt-get upgrade


Where are the button images for the Ambiance theme? I would like to know where the image files for the Ambiance theme's buttons can be found. (The buttons that are used for dialong boxes and the like; not the window control buttons.)

I've tried /usr/share/themes/Ambiance/gtk-2.0/, but that doesn't contain a "buttons" folder like the normal themes do.
I've tried to puzzle out the gtkrc file, but to no avail.

Yes, I know you can just use a screenshot, but not for the purpose I need. (I need the correctly antialiased transparent edges.)
If somebody could explain to me where I might find those files, I would much appreciate it.

These buttons are rendered on-the-fly by the theme engine (Murrine for GTK+2, Unico for GTK+3, both created by Andrea Cimitan). There are no images.

But if you need to generate vectorized images of GTK+3 widgets, you can use the gtk-vector-screenshot tool.

Finding default icons used by themes

Most of the icons used in themes are part of icon sets, not the themes themselves. You can use any icon set with any theme.

To find the default icons for use with Ambiance:

1) View as text: /usr/share/themes/Ambiance/index.theme

You will see ubuntu-mono-dark listed as the default.

2) Go to /usr/share/icons/ubuntu-mono-dark

If you browse around the directories, you will Unity specific icons, but not the general application icons.

3) View as text: /usr/share/icons/ubuntu-mono-dark/index.theme

This line Inherits=Humanity-Dark,gnome,hicolor points to the icons.

You can ignore hicolor, which is for accessibility, but the application icons you are looking for are in /usr/share/icons/Humanity-Dark and 'usr/share/icons/gnome`

Most of the application icons will be in /usr/share/icons/Humanity-Dark/apps and usr/share/icons/gnome/apps

Themes for Buttons in Dialogs and Similar Objects

These elements are usually called widgets. The creation and use of widgets in code is controlled by a GUI framework. The two most common in Ubuntu are GTK and Qt, but there are others. Widget frameworks allow the programmer to essentially tell the program to, say, show a dialog with confirmation buttons and to then forget about what the buttons will look like because the GUI framework library handles all of that.

Information about how to style widgets is handled through various combinations of CSS files and XML files in the Gtk theme.

The screen shot you included had a a Gedit save dialog, which is a Gtk application.

I'm running 12.10, so the paths and actual files you find may be slightly different, but in /usr/share/themes/Ambiance where you were before, you want to look mostly in the gtk-3.0 directory.

The main files you want are:

gtk-main.css
gtk-widgets.css
gtk-widgets-assets.css
gtk-widgets-borders.css

and settings.ini, which gives the default color scheme.

These files will have the color and other information that you are looking for. They may not be easy to interpret, but there is documentation on Gnome interface design and on Gnome theming that may help.

I'm not sure what your ultimate purpose is, but if you are creating an application you can easily use Gtk widgets through a interface designer like Glade and let Gtk do all the work for you.


Is it possible to do an apt-get installation and continue it later? Let's say I want to install something big... (kde for example) but I'm doing it in a place with a very poor internet conection, so I want to stop it, and doing it later. But I don't want to start all over again. Can it be done?

Do apt-get install -d  STUFF which will download everything
to the cache but won't act on it.

Later when you have a better
connection you can just drop the -d and apt will download the
rest if needed and begin installing from the cache: /var/cache/apt/archives/

Or, start the installation with GNU Screen. Just run screen by itself, and it will open a new window with a shell inside it. If you run commands here, then press Ctrl-d (^d), the window will "detach" from your current terminal, but it will stay running in the background: run screen -x to get back to it.

This also works for long-running command such as apt-get install [all of KDE]: just start the apt-get install command inside a screen window and press ^d. Then later, simply re-attach using screen -x and see if it's done.

Screen has much more options: ^a c will create new windows (use ^a 1 to go to the first one, ^a n to go to the one "to the right", etc). See http://www.gnu.org/software/screen/manual/ for the manual!

Edit: Of course, the computer running screen windows cannot be restarted, or the windows will be lost.


How do I diff the output of two commands? I had imagined the simplest way to compare the contents of two similar directories would be something like

diff `ls old` `ls new`

But I see why this doesn't work; diff is being handed a big long list of files on the command line, rather than two streams like I had hoped.  How do I pass the two outputs to diff directly?

Command substitution `…` substitutes the output of the command into the command line, so diff sees the list of files in both directories as arguments. What you want is for diff to see two file names on its command line, and have the contents of these files be the directory listings. That's what process substitution does.

diff <(ls old) <(ls new)

The arguments to diff will look like /dev/fd/3 and /dev/fd/4: they are file descriptors corresponding to two pipes created by bash. When diff opens these files, it'll be connected to the read side of each pipe. The write side of each pipe is connected to the ls command.

I often use the technique described in the accepted answer:
diff <(ls old) <(ls new)

but I find I usually use it with much more complex commands than the example above. In such cases it can be annoying to craft the diff command. I have come up with some solutions that others may find useful.
I find that 99% of the time I try out the relevant commands before running diff. Consequently the commands I want to diff are right there in my history ... why not use them?
I make use of the Fix Command (fc) bash builtin to execute the last two commands:
$ echo A
A
$ echo B
B
$ diff --color <( $(fc -ln -1 -1) ) <( $(fc -ln -2 -2 ) )
1c1
< B
---
> A

The fc flags are:

-n: No number. It suppresses the command numbers when listing.
-l: Listing: The commands are listed on standard output.

the -1 -1 refer to the start and end positing in the history, in this case its from the last command to the last command which yields just the last command.
Lastly we wrap this in $() to execute the command in a subshell.
Obviously this is a bit of a pain to type so we can create an alias:
alias dl='diff --color <( $(fc -ln -1 -1) ) <( $(fc -ln -2 -2 ) )'

Or we can create a function:
dl() {
    if [[ -z "$1" ]]; then
        first="1"
    else
        first="$1"
    fi
    if [[ -z "$2" ]]; then
        last="2"
    else
        last="$2"
    fi
    # shellcheck disable=SC2091
    diff --color <( $(fc -ln "-$first" "-$first") ) <( $(fc -ln "-$last" "-$last") )
}

which supports specifying the history lines to use. After using both I find the alias is the version I prefer.


VNC grey screen after upgrade to ubuntu 13.04 The grey screen on a remote VNC session had been succesfully fixed for my 12.10 version by editing the .vnc/xstartup file as in the 12.04 related discussion in this forum. After an upgrade to Ubuntu 13.04 recommended by the updater, I've got the grey screen back on the VNC clients. Gnome-classic is installed and the xstartup has not changed. What else did Ubuntu 13 upgrader do wrong?

Since no-one gave me the apparently simple answer, I had to find out myself.
Gnome support in Ubuntu 13 has changed such that gnome-classic has to be called as gnome-session-fallback. Hurray. Why are they making it so difficult to use the super easy and handy VNC access?

So, in ./vnc/xstartup,
replace

gnome-session --session=gnome-classic &

by

gnome-session-fallback &

And that's it to continue using your iPad on Ubuntu.

for the complete xstartup search for vnc grey screen boot 12.04

So as we now all know the gnome-session in VNC is still broken in Ubuntu 13.10 and actually XFCE on Ubuntu 13.10 was a disaster since I got the XFCE desktop not only in VNC but also on my normal desktop login, which is hopeless because XFCE is only for lightweight in my view. I then tested LinuxMint with Cinnamon which I found a delight compared to the standard Ubuntu Unity desktop, 'way over the top'.
Once a new LinuxMint environment (on vbox, excellent) with vnc4server is built, just ap-get install xfce4 - you will not be hindered with XFCE for your normal login but if you make your xstartup file like this (yes only these lines are necessary!):

#!/bin/sh
unset SESSION_MANAGER
xsetroot -solid grey
vncconfig -iconic &
startxfce4 &

!there you have a good xfce destop in vnc. Only thing for me was that the terminal didnt work - it was there but no interaction in the window. I installed terminator and did not further bother.
All is now well - goodbye plain Ubuntu - hello Mint Cinnamon-XFCE.


Configure Micromax MMX 352G USB 3G Modem and Aircel in Ubuntu Server 12.04 to connect to internet I'm Interested to use Ubuntu Server 12.04 command line only OS to boost my knowledge of linux in depth. I installed it to my DELL Inspiron 1120 Laptop, But I am not able to connect to internet using my Micromax MMX 352G USB 3G Modem ( I'm using Aircel Pocket Internet as ISP with APN "aircelweb" for 2G Network). I don't know how to configure my modem to connect to internet. My lsusb output is a follows:

odswct@odswct:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0bda:0138 Realtek Semiconductor Corp. Card reader
Bus 002 Device 003: ID 0bda:58f3 Realtek Semiconductor Corp.
Bus 001 Device 004: ID 1c9e:9605 OMEGA TECHNOLOGY
odswct@odswct:~$

My modem is detected at last line as "OMEGA TECHNOLOGY".
Is any one there to help me for the configuration in details.

It works fine when I am using this modem with Ubuntu Desktop 12.04 after a modprobe for usbserial. But I want to configure it for Ubuntu Server 12.04 without using sakis3g script.

While I cannot help you much with the details, you need to take a look at wvdial to use your USB 3G modem from commandline. I think it should appear on /dev/modem.

See https://help.ubuntu.com/community/DialupModemHowto/SetUpDialer#Alternative_Way_1_.28using_wvdialconf_.26_wvdial.29

In order to test that the modem is working fine, you can plug it and try to connect to it with :

screen /dev/modem

and test various AT commands. For example, typing ATI + enter should give you the model of your modem ( if I am not wrong )

Perhaps try the link here.

I haven't tried it yet, and I'm on Debian...


'sudo su -' vs 'sudo -i' vs 'sudo /bin/bash' - when does it matter which is used, or does it matter at all? When I'm doing something that requires root be typed in dozens of times in a row, I prefer to switch my session to a root session. In the various tutorials and instructions I have used on the Internet, I see sudo su, sudo su -, sudo -i and sudo /bin/bash being used to open a root session, but I'm not clear on the difference between these and when or if that difference matters.

Can someone clear this up for me?

To explain this you need to know what the programs do:

su - The command su is used to switch to another user (s witch u ser), but you can also switch to the root user by invoking the command with no parameter. su asks you for the password of the user to switch, after typing the password you switched to the user's environment.
sudo - sudo is meant to run a single command with root privileges. But unlike su it prompts you for the password of the current user. This user must be in the sudoers file (or a group that is in the sudoers file). By default, Ubuntu "remembers" your password for 15 minutes, so that you don't have to type your password every time.
bash - A text-interface to interact with the computer. It's important to understand the difference between login, non-login, interactive and non-interactive shells:

Types of shells:

login shell: A login shell logs you into the system as a specified user, necessary for this is a username and password. When you hit ctrl+alt+F1 to login into a virtual terminal you get after successful login a login shell.
non-login shell: A shell that is executed without logging in, necessary for this is a currently logged-in user. When you open a graphic terminal in gnome it is a non-login shell.
interactive shell: A shell (login or non-login) where you can interactively type or interrupt commands. For example a gnome terminal.
non-interactive shell: A (sub)shell that is probably run from an automated process. You will see neither input nor output.

So the cases are:

sudo su Calls sudo with the command su. Bash is called as interactive non-login shell. So bash only executes .bashrc. You can see that after switching to root you are still in the same directory:

user@host:~$ sudo su
root@host:/home/user#

sudo su - This time it is a login shell, so /etc/profile, .profile and .bashrc are executed and you will find yourself in root's home directory with root's environment.
sudo -i It is nearly the same as sudo su - The -i (simulate initial login) option runs the shell specified by the password database entry of the target user as a login shell.  This means that login-specific resource files such as .profile, .bashrc or .login will be read and executed by the shell.
sudo /bin/bash This means that you call sudo with the command /bin/bash. /bin/bash is started as non-login shell so all the dot-files are not executed, but bash itself reads .bashrc of the calling user. Your environment stays the same. Your home will not be root's home. So you are root, but in the environment of the calling user.
sudo -s reads the $SHELL variable and executes the content. If $SHELL contains /bin/bash it invokes sudo /bin/bash (see above).

Check:

To check if you are in a login shell or not (works only in bash because shopt is a builtin command):

shopt -q login_shell && echo 'Login shell' || echo 'No login shell'

To look for differences you may chack the resulting environment among different invocations.

You could find some "small" differences in some critical variables:

PATH, LD_LIBRARY_PATH, LD_PRELOAD

or some difference in ~/. dotfiles handling (~/.config).

Consider also the ownership of $HOME based logfiles (~/.xsession.errors, etc ...) or xauth cookies (~/.Xauthority) that commands generate.

Try these commands:

# 'su -' vs 'su'

diff <(sudo su - -c env | sort) <(sudo su -c env | sort)

# 'su -' vs 'sudo -i'

diff <(sudo su - -c env | sort) <(sudo -i env | sort)


How to speed up VirtualBox Ubuntu 14.04 (disable visual effects, ...) I just installed Ubuntu 14.04 in a VirtualBox machine, which I am planning to use for Java/Web development. After my first steps, I noticed that the CPU usage is very high even when I do simple tasks like browsing files with nautilus. In htop I can see that it is compiz utilizing the CPU heavily.

I have already tried to disable the effects and animations with compizconfig-settings-manager, but it did not change much. I would like to keep the new Unity interface if possible.

A list of steps that leads to the best result would be great.

If you don't need compositing/desktop effects, then Xubuntu would be the better option.

It has a nice tool in its Settings menu to turn them off, and quite frankly you won't lose anything by installing Xubuntu if you're only going to use it for web/java development. You'll be using the same apps as you would do in Ubuntu.

You could just run a completely headless ubuntu box and do everything via command line.

Otherwise lubuntu and xubuntu are pretty light weight, you could try openbox.

Command line is the best way, however.


What to do about this gnome-keyring message? Possible Duplicate:
  Why do I get this warning from Gnome keyring in Xubuntu?

I upgraded from ubuntu 10.04 to 12.04 and installed lxde. Since then whenever I try to print some file (or use command lpstat), I get this message on the terminal:

  "WARNING: gnome-keyring:: couldn't connect to:
  /tmp/keyring-SZ59jJ/pkcs11:  No such file or directory".

This is beyond my knowledge and from search I only realize that this may be related to security (as learned from GNOME Keyring on Wikipedia). I have no idea what to do about this warning. Can anybody please suggest? Evidently as stated, I am not using gnome desktop, I choose lxde session at the time of logging in.

Try running lpstat as root with sudo.  Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo lpstat <filename>


Can't log in to MineCraft? I'm not sure if this is the right place, but I can't log in to my minecraft!! I'm entering my user details and my CORRECT password and using my CORRECT password it thinks I'm NOT using the correct password!

It happens sometimes when mojang amazon server have some troubles, I think the best thing to do is to wait.
You can check here http://help.mojang.com/ the mojang server statuses.

Change it on the website. Someone could have changed it, or there is a broken button on your keyboard.


How do I stop Orca Screen Reader? I accidentally opened Orca Screen Reader from the Dash when I was trying to open Screenshot. Now everything I type or click on is spoken out loud.

How do I make it stop?

For reference, here is a screenshot of Orca Screen Reader running:

If you don't need assistance, you might want to consider:

sudo apt-get remove orca
sudo apt-get remove gnome-orca
killall orca

I say this from the unpleasant experience of accidentally triggering it on several occasions. It is a sledgehammer approach but I have absolutely no use for it.

If you want to keep it but it's starting on boot now, short of hunting through the application to look for the off-switch, consider this question too.

Also note that the package name is transitioning from gnome-orca to orca. I'm leaving both above for the duration of supported releases.

pgrep orca

will tell you the process id of the current running orca process. pgrep is like grep for processes.

kill $(pgrep orca)

will kill the current running orca process. kill takes a process id as argument.


How to text-to-speech output using command-line? How to get speech output from entered text by using command-line?

Also facility to change speech rate, pitch, volume etc using simple command.

In order of descending popularity:

say converts text to audible speech using the GNUstep speech engine.

sudo apt-get install gnustep-gui-runtime
say "hello"

festival General multi-lingual speech synthesis system.

sudo apt-get install festival
echo "hello" | festival --tts

spd-say sends text-to-speech output request to speech-dispatcher

sudo apt-get install speech-dispatcher
spd-say "hello"

espeak is a multi-lingual software speech synthesizer.

sudo apt-get install espeak
espeak "hello"

Balabolka under Wine works fine (for me) with SAPI4 voices (SAPI5 voices are not detected on my Linux system). It can open files and start reading.

Here is link to wine's AppDB entry for Balabolka: https://appdb.winehq.org/objectManager.php?sClass=application&iId=17859


Installer gets stuck with a grayed out forward button I have a CD with Ubuntu 10.10 and a laptop with Ubuntu 8.10. The laptop had all sorts of crud on it, and anything I wanted to keep was backed up on an external drive, so I was happy to do a wipe and reinstall instead of an update. So after a bit of faffing about trying to work out how to get the thing to boot from the CD drive, I did that.

So the screen comes up with the choice: the options are Try Ubuntu and Install Ubuntu. I choose to install and to overwrite my current installation. So far so good. I then get a progress bar labelled something like copying files (I forget the exact wording) and further options to fill in for my location, keyboard locale, username and password. On each of these screens there are forward and back buttons. On the last screen (password), the forward button is greyed out. Well, I think to myself, no doubt it will become active when that copying files progress bar completes.

The progress bar never completes. It hangs. And the label changes from copying files to the chirpy ready when you are. The forward button remains greyed out. The back button is as unhelpful as you'd expect it to be. And there's nothing else to click. We have reached an impasse.

I tried restarting the laptop, to test whether it actually was properly installed. It wasn't. I tried to run Ubuntu live from the CD, to test whether the disk was damaged. That wouldn't work either, but I suspect it's just because the laptop is old and has a slow disk drive. I'm typing this question on another computer using the Ubuntu live CD and it's working fine. So there's nothing wrong with the CD.

I recently encountered the same problem installing Ubuntu on a friend’s computer. It seems that Ubiquity (the Ubuntu installer) for 10.10 is not very informative when things go wrong. Does your username contain uppercase letters? Try making sure all letters in your username are lower case.

For more details, see: How should I file a bug about Ubiquity?

Corresponding Bug Reports:

Username starting with upper letter marked as OK during install and the refused
Ubiquity should give visual feedback that username cannot contains capital letter(s)

You can chose "Try Ubuntu" option, then go to Application > Accessories > Terminal and type
ubiquity --no-migration-assistant


How can I uninstall software? Seeing there are various ways to install on Ubuntu. What are the various ways to uninstall items?

Which ways always work? How can I be sure something was uninstalled?

If the application has been installed via the package manager, all you have to do is run

sudo apt-get remove <application_name>

That should always work. If the terminal isn't what stirs your tea, you could open System → Administration → Synaptic Package Manager, search for the package you want to remove, click on the checkbox next to it and select "mark for removal". Once you click "Apply", the package should be removed. There's of course also the Ubuntu Software Center. It's pretty much the same thing as Synaptic. Just search for the application name and click the "Remove" button.

Sometimes applications can be split up into multiple packages (for example, many games have a separate package for their music). To make sure that you uninstall all related packages AND configuration files, you can type

sudo apt-get purge <package-name>

or -in Synaptic- "mark for complete removal" instead of just "mark for removal".

As for applications that have been manually compiled and installed, there's not always a single way to remove them. The best thing to do is consult the README/INSTALL file that accompanied the source package - if one exists.

If the programme was custom installed on your home directory and you don't have sudo access, that might be the case when you have a user account on the server. You can simply remove the programme folder <rm-rf <programme_folder>. Also, you need to remove the hidden folder and file related to software, which can be something like ./programme_folder.


i have an issue with low graphic mod at the booting, can you help me please? I am a beginner so i dont know really whats my problem i just have a hp pavillon g7 with a amd/ati graphic card, i have tried to update ubuntu from 12.04 to 14 but its still dont work. I have tried to follow instructions on thé site to install fglrx package again but i dont really understand so i ask for help hère.  Sorry for my bas english i am french

I have posted on a forum.org but they dont answer so i try my chance here : i have tried to do sudo apt-get autoremove --purge ati* but that is what my computer answer me : sorry my main langage is french

`Certains paquets ne peuvent être installés. Ceci peut signifier
que vous avez demandé l'impossible, ou bien, si vous utilisez
la distribution unstable, que certains paquets n'ont pas encore
été créés ou ne sont pas sortis d'Incoming.
L'information suivante devrait vous aider à résoudre la situation :

Les paquets suivants contiennent des dépendances non satisfaites :
 hunspell-fr : Dépend: hunspell-fr-classical mais ne sera pas installé ou
                        hunspell-fr-modern mais ne sera pas installé ou
                        hunspell-fr-revised mais ne sera pas installé ou
                        hunspell-fr-comprehensive mais ne sera pas installé
 libpam-modules : Pré-Dépend: debconf (>= 0.5) mais ne sera pas installé ou
                                debconf-2.0
                  Pré-Dépend: libpam-modules-bin (= 1.1.8-1ubuntu2)
 libpam0g : Dépend: debconf (>= 0.5) mais ne sera pas installé ou
                     debconf-2.0
 libreadline6 : Dépend: readline-common mais ne sera pas installé
 libssl1.0.0 : Dépend: debconf (>= 0.5) mais ne sera pas installé ou
                        debconf-2.0
 memtest86+ : Dépend: debconf (>= 0.5) mais ne sera pas installé ou
                       debconf-2.0
 openjdk-7-jre : Dépend: libasound2 (>= 1.0.16)
                 Dépend: libcups2 (>= 1.4.0) mais ne sera pas installé
                 Dépend: libfontconfig1 (>= 2.9.0) mais ne sera pas installé
                 Dépend: libgdk-pixbuf2.0-0 (>= 2.22.0) mais ne sera pas installé
                 Dépend: libgtk2.0-0 (>= 2.8.0) mais ne sera pas installé
                 Dépend: libpango-1.0-0 (>= 1.14.0) mais ne sera pas installé
                 Dépend: libx11-6 mais ne sera pas installé
                 Dépend: libxext6 mais ne sera pas installé
                 Dépend: libxi6 mais ne sera pas installé
                 Dépend: libxrender1 mais ne sera pas installé
                 Dépend: libxtst6 mais ne sera pas installé
                 Dépend: libxrandr2 mais ne sera pas installé
                 Dépend: libxinerama1 mais ne sera pas installé
                 Dépend: libgl1-mesa-glx ou
                          libgl1
                 Dépend: libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2) mais ne sera pas installé
                 Recommande: libgnome2-0 mais ne sera pas installé
                 Recommande: libgnomevfs2-0 mais ne sera pas installé
                 Recommande: libgconf2-4 mais ne sera pas installé
 openjdk-7-jre-headless : Dépend: ca-certificates-java mais ne sera pas installé
                          Dépend: tzdata-java mais ne sera pas installé
                          Dépend: libcups2 (>= 1.4.0) mais ne sera pas installé
                          Dépend: libfontconfig1 (>= 2.9.0) mais ne sera pas installé
 tar : Pré-Dépend: libacl1 (>= 2.2.51-8) mais ne sera pas installé
 wamerican : Dépend: debconf (>= 0.5) mais ne sera pas installé ou
                      debconf-2.0
 x11-common : Dépend: debconf (>= 0.5) mais ne sera pas installé ou
                       debconf-2.0
E: Erreur, pkgProblem::Resolve a généré des ruptures, ce qui a pu être causé par les paquets devant être gardés en l'état.`

Have you tried removing all the fglrx stuff like other posts suggest? Your machine should run with the standard generic drivers. Once that works you can try to reinstall the fancy stuff.

OK i paste here all i have tipped on terminal : tamarin@tamarin-HP-Pavilion-g7-Notebook-PC:~$ sudo apt-get remove fglrx*
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Note : sélection de fglrx-driver-dev pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-pxpress pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-updates pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-dev pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-control pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-core pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-updates-core pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-amdcccle-updates pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-driver-core pour l'expression rationnelle « fglrx* »
Note : sélection de xfree86-driver-fglrx-dev pour l'expression rationnelle « fglrx* »
Note : sélection de xorg-driver-fglrx-dev pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-glx pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-control-qt2 pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-amdcccle pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-driver pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx-updates-dev pour l'expression rationnelle « fglrx* »
Note : sélection de fglrx pour l'expression rationnelle « fglrx* »
Package 'fglrx-glx' is not installed, so not removed
Package 'fglrx-control-qt2' is not installed, so not removed
Package 'xfree86-driver-fglrx-dev' is not installed, so not removed
Package 'xorg-driver-fglrx-dev' is not installed, so not removed
Package 'fglrx-pxpress' is not installed, so not removed
Package 'fglrx-amdcccle-updates' is not installed, so not removed
Package 'fglrx-dev' is not installed, so not removed
Package 'fglrx-updates' is not installed, so not removed
Package 'fglrx-updates-core' is not installed, so not removed
Package 'fglrx-updates-dev' is not installed, so not removed
Les paquets suivants seront ENLEVÉS :
  fglrx fglrx-amdcccle fglrx-core
0 mis à jour, 0 nouvellement installés, 3 à enlever et 0 non mis à jour.
Après cette opération, 480 Mo d'espace disque seront libérés.
Souhaitez-vous continuer ? [O/n]
(Lecture de la base de données... 281537 fichiers et répertoires déjà installés.)
Suppression de fglrx-amdcccle (2:15.200-0ubuntu0.3) ...
Suppression de fglrx (2:15.200-0ubuntu0.3) ...
update-alternatives: utilisation de « /usr/lib/pxpress/ld.so.conf » pour fournir « /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf » (x86_64-linux-gnu_gl_conf) en mode automatique
update-alternatives: avertissement: création de /usr/share/applications/ubuntu-amdcccle.desktop abandonnée car le fichier associé /usr/share/fglrx/amdcccle.desktop (du groupe de liens x86_64-linux-gnu_gl_conf) n'existe pas
update-alternatives: avertissement: création de /usr/share/applications/ubuntu-amdccclesu.desktop abandonnée car le fichier associé /usr/share/fglrx/amdccclesu.desktop (du groupe de liens x86_64-linux-gnu_gl_conf) n'existe pas
update-alternatives: utilisation de « /usr/lib/pxpress/alt_ld.so.conf » pour fournir « /etc/ld.so.conf.d/i386-linux-gnu_GL.conf » (i386-linux-gnu_gl_conf) en mode automatique
update-alternatives: utilisation de « /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf » pour fournir « /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf » (x86_64-linux-gnu_gl_conf) en mode automatique
update-alternatives: utilisation de « /usr/lib/i386-linux-gnu/mesa/ld.so.conf » pour fournir « /etc/ld.so.conf.d/i386-linux-gnu_GL.conf » (i386-linux-gnu_gl_conf) en mode automatique
Suppression de fglrx-core (2:15.200-0ubuntu0.3) ...
Removing all DKMS Modules
Done.
update-alternatives: utilisation de « /usr/lib/fglrx-core/unblacklist_ld.so.conf » pour fournir « /etc/ld.so.conf.d/x86_64-linux-gnu_GFXCORE.conf » (x86_64-linux-gnu_gfxcore_conf) en mode automatique
update-initramfs: deferring update (trigger activated)
Traitement déclenché pour  bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Traitement déclenché pour  libc-bin (2.19-0ubuntu6.6) ...
Traitement déclenché pour  initramfs-tools (0.103ubuntu4.2) ...
update-initramfs: Generating /boot/initrd.img-3.13.0-55-generic

tamarin@tamarin-HP-Pavilion-g7-Notebook-PC:~$  lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Thames [Radeon HD 7500M/7600M Series]
tamarin@tamarin-HP-Pavilion-g7-Notebook-PC:~$ sudo lshw -C video
[sudo] password for tamarin:
  *-display
       description: VGA compatible controller
       produit: Thames [Radeon HD 7500M/7600M Series]
       fabriquant: Advanced Micro Devices, Inc. [AMD/ATI]
       identifiant matériel: 0
       information bus: pci@0000:01:00.0
       version: 00
       bits: 64 bits
       horloge: 33MHz
       fonctionnalités: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=fglrx_pci latency=0
       ressources: irq:48 mémoire:a0000000-afffffff mémoire:c2000000-c201ffff portE/S:4000(taille=256) mémoire:c2020000-c203ffff
  *-display
       description: VGA compatible controller
       produit: 2nd Generation Core Processor Family Integrated Graphics Controller
       fabriquant: Intel Corporation
       identifiant matériel: 2
       information bus: pci@0000:00:02.0
       version: 09
       bits: 64 bits
       horloge: 33MHz
       fonctionnalités: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       ressources: irq:46 mémoire:c3000000-c33fffff mémoire:b0000000-bfffffff portE/S:5000(taille=64)
Section "ServerLayout"
    Identifier "amd-layout"
    Screen 0 "amd-screen" 0 0
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
    Option "AccelMethod" "uxa"
    BusID "PCI:0@0:2:0"
EndSection

Section "Device"
    Identifier "amd-device"
    Driver "fglrx"
    BusID "PCI:1:0:0"
EndSection

Section "Monitor"
    Identifier "amd-monitor"
    Option "VendorName" "ATI Proprietary Driver"
    Option "ModelName" "Generic Autodetecting Monitor"
    Option "DPMS" "true"
EndSection

Section "Screen"
    Identifier "amd-screen"
    Device "amd-device"
    Monitor "amd-monitor"
    DefaultDepth 24
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

Now my computer start and i can access to the desktop now but it is showing system crash error, i will take à desktop pics tho i think its not the ubuntu 14.04 real desktop but à save mode on cordialy


How do I save a file to a subfolder of home? My painting app (GIMP) keeps it brushes in a subfolder of home.

I want to save a brush I have created in the same place, but the Save File As dialog box can't find home.

Your home directory is at /home/your_username/

Depending on your Ubuntu and Gimp versions, respectively: your home directory is propably represented by your own username (usually in the left pane of file picker dialogs).

Optionally, you can access it by choosing "file system" from the places list (left pane) and navigate to /home/your_username/your_subdir. Most file picker dialogs also allow you to edit the path in the location bar (usually at the top, maybe after clicking on it or pressing Strg+L) directly.

Why not save it in any directory, and then open up a terminal and write:

mv </path/my_file> <path_for_file_to_be_moved>

This will move the file to your wanted location. Example:

mv my_brush ~/.brushes/


Same android SDK for Multiple Users I installed android studio on my admin account from ubuntu software center. and It's working without any issue. I have another admin account setup in my desktop PC. I can run android studio from that account as well. but the problem is I have to install android sdk manager again for that account.

Is there a way to use the same sdk manager that I have already installed on the other admin account? If so how do I set necessary permissions?

You could do it with setfacl, giving permissions to all users you want.
Linux setfacl command help and examples


GMA500 screen resolution, 12.04 LTS I have Dell Mini 1010 with GMA 500 chipset. I installed the Ubuntu 12.04 and followed instructions for sorting out distorted display/blank screen.

I am stuck with the 1024x576 screen display now.

The supported resolution for notebook is apparently 1366x768.

I have tried modifying the GRUB_GFXPAYLOAD_LINUX and GRUB_GFXMODE to 1366x768x32 ( as per wiki) but it is not resolving the issue.

Can you please suggest any alternatives to fix this thing ?

Thanks

A friend of mine had the same problem... here is the link we used to solve it...

https://wiki.ubuntu.com/HardwareSupportComponentsVideoCardsPoulsbo

Here is th

Using any editor, create a file /etc/grub.d/01_915resolution , add in lines

echo insmod 915resolution
echo 915resolution 58 1366 768 32
Make the file executable

sudo chmod a+x /etc/grub.d/01_915resolution

Next, edit /etc/default/grub, assign value 1366x768x32 to variables GRUB_GFXMODE and GRUB_GFXPAYLOAD_LINUX:

GRUB_GFXPAYLOAD_LINUX=1366x768x32
Then update grub.

sudo update-grub

First off all try to update to the latest kernel (3.5). The new driver should fix you the resolution issue.


Adding an SSD to dual boot environment to make a triple boot To clarify based on comments below, I installed Windows onto a new disk and now I want to be able to boot from that disk using gGrub installed on a different disk. Do I need to change the way I install Windows, or do I need to do something clever with grub?

I have Windows 7 and Ubuntu 14.04 on the same HDD working well on a dual boot.

I added an SSD, changed BIOS boot order and installed a 'lite' version of Windows 7 on the SSD. I am doing project work and need a version with no antivirus, etc. Now I have changed the BIOS boot order back so I get my grub menu. I want to add an entry to that will allow me to boot the lite drive from grub instead of having to switch the BIOS back and forward every time. I do not want to reinstall Ubuntu or my main Windows 7, but I will consider redoing the 'lite' version if that will help me achieve what I am looking for.

I have a feeling that this should be pretty easy, but I am not seeing it. The obvious solution of running grub-update is not seeing the Windows 8 installation. In the fdisk listing below, /sda is my working dual boot. /sbd is my SSD (note the error reported), /sdc is my shared storage drive and /sdd is my removable backup disk.

paul@Pauls-box:~$ sudo fdisk -l
[sudo] password for paul:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7535f3a5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      417689      208813+   7  HPFS/NTFS/exFAT
/dev/sda2          417690  1441520064   720551187+   7  HPFS/NTFS/exFAT
/dev/sda3      1441521662  1953523711   256001025    5  Extended
/dev/sda5      1441521664  1480583167    19530752   83  Linux
/dev/sda6      1480585216  1544583167    31998976   82  Linux swap / Solaris
/dev/sda7      1544585216  1953521663   204468224   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
256 heads, 63 sectors/track, 30282 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT

Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4228d32c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  2930272255  1465135104    7  HPFS/NTFS/exFAT

Disk /dev/sdd: 1000.2 GB, 1000194400256 bytes
255 heads, 63 sectors/track, 121600 cylinders, total 1953504688 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8d81c186

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *          64  1953499903   976749920    7  HPFS/NTFS/exFAT

have you red the comment in your disk listing ?
"GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted."

Probably, it's teh problem.


How to upgrade Ubuntu via ISO file? How can I upgrade Ubuntu 18.04(LTS) to 19.xx , using an iso file?

There is no upgrade path for Ubuntu through the ISO. The options you have are

overwrite the current OS.
add the new OS on an empty partition.

Next: there is no Ubuntu 18 or Ubuntu 19. It is Ubuntu 18.04 and Ubuntu 19.10. 19.04 has gone end of life on 23rd January 2020 so there is currently no official upgrade path to 19.10.

For an upgrade from 18.04 you will need to wait for Ubuntu 20.04.1.

If you really need 19.10 (and I wonder why as it will go end of life July, 2020) you need to re-install. So create a personal backup, install 19.10 and restore your files.
I would wait for 20.04.1 and upgrade to that LTS.

If you want to upgrade Ubuntu 18.04 LTS to 19.10:

You need to edit file /etc/update-manager/release-upgrades

sudo nano /etc/update-manager/release-upgrades

Just change Prompt=lts to Prompt=normal
Then run

do-release-upgrade -p

You must have enough space in /boot.

I tried this on virtual machine and it worked for my case.


cannot access/delete folder in Rubbish Bin containing hundred of thousand of corrupted files on 14.04 yesterday I discovered a folder in the Trash Bin named FdtN0bhKRX containing more than 700,000 corrupted files. I know the approximate number because I tried to move the folder to a USB key, and when I cancelled the operation, the "preparing to move.." dialogue was showing that mark. The folder is 1017Mb and the files inside are all 0 byte long.
I tried everything I could to remove this folder or to access it, but I failed. sudo rm or sudo su and then rm with -d and -f options goes in infinite loop, which may cause a complete block of the  system's functions (including Ctrl+Alt+Del). I even coded a c++ program, which works great on other folders, but in this case it failed miserably. I searched all over the web and I couldn't find any other case like my one. The files inside the folder are named something like this:

S                             __FrO__                         kj

I could read some of the names one of the times I tried to open the folder in Nautilus, because before the program crashed, if I clicked the back button, some of the files icons were rendered together with their name. The only command I can use on the folder is mv AFIK.

Thanks in advance for your help.

I solved my problem with the monstrous folder which was by me found in the Trash folder. Nor the folder, nor its files had been corrupted, indeed it was a HDD Bad Blocks problem, which I detected with fsck, by running it from another partition. I'm not expert on Hard Drive, but I can say that fsck detected a problem in the folder structure (probably where the Trash folder reside on the disk).

This should work:

sudo rm -rf path-to-the-folder

if didn't work, do it with root privileges type sudo su press Enter and repeat the command no sudo required.

WARNING!

When login as a root, do it at your own risk! If you completely sure this folder is nothing then ok.


How to install Metasploit and Armitage I want to install metasploit and armitage on my ubuntu 16.04 LTS laptop running kernel 4.6

I've read blogs and posts on how to install it but the problem is is that they are outdated. The packages are not there anymore and or the commands dont work.

If anyone can give me an updated tutorial on how to install it that would be great. I also think other users that see this post and want to install it will also be thankful. Thanks.

Here is a blog post (untested but states it works for 16.04): http://www.darkoperator.com/installing-metasploit-in-ubunt/
OR
Install metasploit you can use automated installer:
64 Bit:
wget https://downloads.metasploit.com/data/releases/metasploit-latest-linux-x64-installer.run && wget https://downloads.metasploit.com/data/releases/metasploit-latest-linux-x64-installer.run.sha1 && echo $(cat metasploit-latest-linux-x64-installer.run.sha1)'  'metasploit-latest-linux-x64-installer.run > metasploit-latest-linux-x64-installer.run.sha1 && shasum -c metasploit-latest-linux-x64-installer.run.sha1 && chmod +x ./metasploit-latest-linux-x64-installer.run && sudo ./metasploit-latest-linux-x64-installer.run

(for 32bit version, same command but remove '-x64' from the filename/url)
Note
This should be ran on a virtual machine, dont ignore ssl errors/hash checksums (both are checked using the above script to ensure files being downloaded are from metasploit.com).
if wget failed makes sure you are using wget-ssl.

You can download the free version of Metasploit directly from their website: http://www.rapid7.com/products/metasploit/editions.jsp

Alternatively, install Katoolin from GitHub. This is a script that lets you install all the tools provided in Kali Linux. It has a very simple and good user guide and there are also many YouTube videos explaining its use.

https://github.com/LionSec/katoolin


How to increment a variable in bash? I have tried to increment a numeric variable using both var=$var+1 and var=($var+1) without success. The variable is a number, though bash appears to be reading it as a string.

Bash version 4.2.45(1)-release (x86_64-pc-linux-gnu) on Ubuntu 13.10.

There is more than one way to increment a variable in bash, but what you tried is not correct.

You can use for example arithmetic expansion:

var=$((var+1))
((var=var+1))
((var+=1))
((var++))

Or you can use let:

let "var=var+1"
let "var+=1"
let "var++"

See also: http://tldp.org/LDP/abs/html/dblparens.html.

This is the safe bet
(( var = var + 1 ))

If the resulting value is non zero, then setting exit on error will stop Your script
set -e
var=0
(( var++ ))
echo You will never get here


Wifi not getting connected but LAN cable connection is working. Please help I recently installed Ubuntu 18.04.1 LTS from Windows 10. After installation system is not detecting any Wifi it says no adapters available. But when connected through LAN cable the internet works.

I tried couple of things but nothing helped.

rfkill list all
0: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

lshw -c network
WARNING: you should run this program as super-user.
  *-network
       description: Ethernet interface
       product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 05
       serial: b8:ca:3a:c3:5e:d2
       size: 100Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: 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=rtl_nic/rtl8105e-1.fw ip=192.168.0.9 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:16 ioport:2000(size=256) memory:c0404000-c0404fff memory:c0400000-c0403fff
  *-network
       description: Network controller
       product: BCM43142 802.11b/g/n
       vendor: Broadcom Limited
       physical id: 0
       bus info: pci@0000:02:00.0
       version: 01
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list
       configuration: driver=bcma-pci-bridge latency=0
       resources: irq:17 memory:c0500000-c0507fff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.

Please help!

Code:

sudo apt remove bcmwl-kernel-source && sudo apt install git dkms
git clone -b extended https://github.com/lwfinger/rtlwifi_new.git
sudo dkms add ./rtlwifi_new
sudo dkms install rtlwifi-new/0.6

Reboot
If you notice weak signal try
Code:

sudo modprobe -r rtl8723de && sleep 5 && sudo modprobe rtl8723de ant_sel=1

and see if it is better, if not do
Code:

sudo modprobe -r rtl8723de && sleep 5 && sudo modprobe rtl8723de ant_sel=2

Resource Worked for me


Boot Clonezilla from a ext4 USB Is there a way to boot Clonezilla from a ext4 formatted USB? I use such memory for my system backups and would like to also use it to boot Clonezilla

Format the memory as ext4 if needed
Install tuxboot on the Ubuntu machine. Instructions here http://tuxboot.org/download/
sudo tuxboot
Proceed to install Clonezilla as usual
Machine should boot from the memory


How to enable Paste function with Ctrl-Shift-V in Ubuntu 13.10? I have very simple question after installation/upgrade to 13.10. Seems that Paste function (or Paste without formatting) keyboard shortcut does not work in 13.10. It was a very convenient way to paste non-formatted text in LibreOffice or in the Terminal. Thus, my question is:

How can I enable Paste function with Ctrl+Shift+V in Ubuntu 13.10?

I assume you are using ENGLISH (US) keyboard layout. Otherwise see here.

For me it works with Ctrl+RIGHT_Shift+V in all keyboard layouts Ubuntu 13.10.

The same in LIBREOFFICE + OPENOFFICE

It does NOT work with  Ctrl+LEFT_Shift+V because Ctrl+LEFT_shift is assigned to a different combination in keyboard settings. Check your settings. See here for my example:

Unfortunately, you need to:

sudo apt-get purge libreoffice-gtk libreoffice-gnome

You'll get a somewhat ugly UI, but functional keyboard shortcuts!


Keyboard shortcuts stop working after upgrading to Ubuntu 17.10 I upgraded to Ubuntu 17.10 and wanted to boot with the unity environment, but when I did, I noticed that the keyboard shortcuts like Ctrl+Alt+T for the terminal were not working(only when I boot in unity).

How can I fix that?

As already mentioned in the comments by Aramil Rey, removing the following configuration files seemed to fix the problem:

~/.compiz
~/.gconf
~/.gnome*
~/.kde

And in my case it was a permanent solution and not a temporarily one. For example this can be done by:

mkdir ~/backupFixSO972940
mv ~/.compiz ~/.gconf ~/.gnome* ~/.kde ~/backupFixSO972940

If this does not work, you can also add ~/.config to the list, but be careful as this folder also contains a lot of application related configuration files, thus I advice to make a backup (mv) instead of deleting (rm) all folders directly like from the original solution.


Error getting hardware address for enp3s0 My Ubuntu Server 17 isn't connecting to my network (Ethernet).

I've tried restarting the network service but get an error telling me to run

journalctl1 -xe

which shows me the error

Error getting hardware address for enp3s0
...
Failed to start Raise network address

this is my /etc/network/interfaces

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp3s0
iface enp3s0 inet dhcp

I've searched all over but most people say to change the the interfaces to use eth0, and I've tried that but it didn't fix it at all so not sure what else to try

$ ifconfig

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
  inet 127.0.0.1 netmask 255.0.0.0
  inet6 ::1 prefixlen 128 scopeid 0x10<host>
  loop txqueuelen 1000 (Local Loopback)
  RX packets 352 bytes 26304 (26.3 KB)
  RX errors 0 dropped 0 overruns 0 frame 0
  TX packets 352 bytes 26304 (26.3 KB)
  TX errors 0 dropped 0 overruns 0 frame 0 collisions 0

I was getting the same error for my interface labeled p5p1.

Running lshw -C network yielded output similar to the following (the interface works now so some details will be different):

*-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: p4p1
       version: 06
       serial: 18:67:b0:df:4e:68
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=10.1.2.228 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:27 ioport:e000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff

The pertinent line is logical name: p4p1. Somehow networking was configured to bring up interface p5p1 but the os is recognizing the device as p4p1.

I updated /etc/network/interfaces to replace p5p1 to p4p1 then reset the networking services. The interface came up no problem.


Hostname keeps being reverted I'm struggling with a strange problem on a Ubuntu 14.04.1 LTS VM running on Azure. My hostname keeps getting reverted to something related to my Azure Deployment. In short: the system hostname does not equal cat /etc/hostname while /etc/hostname and /etc/hosts remain unchanged.

This is my /etc/hostname

dbc1mdb

And this my /etc/hosts

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

10.0.1.6 dbc1mdb
10.0.1.7 dbc1sdb1

I am really pulling my hair out. Any suggestions?

UPDATE: I'm now suspecting that either the DHCP client or the Azure Linux Agent is messing with the hostname.

It's probably a script running in the background.

You have 2 options:

1) Remove whatever is changing your hostname.

2) Change your hostname in /etc/hostname and run sudo chattr +i /etc/hostname to prevent it from being changed.

Went through the same scenario and issue.  Removing the cloud-init, cloud-init-utils, and walinuxagent packages cleared the issue.

sudo apt-get remove cloud-init
sudo apt-get remove cloud-init-utils
sudo apt-get remove walinuxagent

Above package names may not be accurate, and removal of dependent packages and/or configs may be called for as well.  YMMV.


How to connect wifi network from raspberry pi 2 (snappy) I've set up new raspberry pi 2 with snappy core.
And I couldn't find how to connect wifi network from snappy terminal.

My wifi dongle working correctly but there is no iwconfig in snappy core.
Wlist not found too. Anyone can help me?

Thanks in advance.

So I just received my Raspberry Pi 3 Model B in the mail and installed Ubuntu Snappy Core 16 in the recommended way. I performed the initial setup via HDMI and usb keyboard, ethernet, & DHCP. Then I created my ssh connection over ethernet and disconnected the monitor and keyboard. From there, I wanted to connect my device to WiFi and stumbled upon this post.
I like to try things without extra installations or workarounds, so I consulted Installation Tips as recommended above and saw that WPA_Supplicant was supposed to be pre-installed. With very little meddling and less effort than the Tips suggested, I found that you can configure the wifi by simply adding a config file consisting of four lines to the default location searched by wpa_supplicant and nothing else. Though it was asked a while ago about a Raspberry Pi 2 I see from recent comments that it might still be relevant and it was so simple I am inclined to share.
I know this answer looks long, but it is very simple and detailed with pictures. Anyone who has a basic knowledge of Terminal and was able to set up their raspberry Pi initially will be able to follow it.

Tl;Dr

Setup your Rasberry Pi and establish a LAN connection via SSH
Shutdown your Raspberry Pi with sudo shutdown -P now
Plug your SD card into a linux distro
In a text editor add a config file called "wpa_supplicant.conf" to the /writable/system-data/etc/ folder on the Writable partition of the SD card
I did this by creating the conf file on my desktop and then using sudo cp to move it to the correct directory
The config file should be:network={ssid="Typhon Secure" Use your network SSIDpsk="*******" Use your network Passkey}
Note: This works for Hidden Networks as well
Eject your SD, plug it into your Pi, boot your Pi; it should connect to your WiFi

My tutorial begins from the point of having an ssh connection via ethernet, which can be achieved by following the instructions at Ubuntu Core Get Started Raspberry Pi 2/3.

Then type wpa_supplicant and you will see that it does not need to be installed as it is pre-built into Snappy Core. As you'll see in the below images, just running wpa_supplicant will return a lot of options, but notice the last line:
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf

What this tells you is first the Driver, then the Interface, then the location that it is looking for the interface file: -c/etc/wpa_supplicant.conf

Now that I knew where the configuration file needed to be, I shutdown the Raspberry Pi with sudo shutdown -P now and once it shutdown; disconnected the power and inserted the SD into a linux box with Fedora. Somehow the file system shows differently so you'll find the location where wpa_supplicant.conf needs to be location is at writable/system-data/etc and the SD card mounted in /run/media/cregger/ for me, so you'll see my file path is /run/media/cregger/writable/system-data/etc/.

I used nano to create a new file called "wpa_supplicant.conf" with the following four lines:
network={
ssid="Typhon Secure" (My network SSID)
psk="*******" (Obviously the asterisks represent my WiFi passkey)
} Don't forget to terminate.
Note that this works for hidden networks with no extra configuration. My network has a hidden SSID and I changed nothing. It has WPA-PSK 2 security; pretty standard fare.

You'll notice that I saved it to the desktop. I then copied it to the proper location with terminal as it is owned by root.

Then eject your SD card from Linux, plug it back into your Raspberry Pi, plug your power source back into your Raspberry Pi; let it boot and it will seek your wifi.
You'll see in my case both Eth and Wlan have taken an IP

I can now ssh via either LAN or WLAN

I know this was long, but I hope it was helpful in helping you to keep from mucking up your FS and installing a bunch of needless applications.

As for me, I had the raspberry connected to ethernet so I didn't need to download deb files individually.

Also, the official guide (claimed by @AnthonyWong to be here: http://developer.ubuntu.com/en/snappy/start/installation-tips ) didn't work for me because it had some fundamental things missing (allow-hotplug line). Plus it's better to centralize all config in just one file (not two, as this guide encourages, which even tells you to place one in some random /home/ubuntu location...).

So, I made this little script that should set everything up for you:

#!/usr/bin/env bash

sudo apt -y install wpasupplicant

echo "allow-hotplug wlan0" > wlan0.cfg.tmp
echo "iface wlan0 inet dhcp" >> wlan0.cfg.tmp
echo '    wpa_ssid "YOUR_WIFI_SSID"' >> wlan0.cfg.tmp
echo '    wpa_psk "YOUR_WIFI_PASSWORD"' >> wlan0.cfg.tmp
echo "" >> wlan0.cfg.tmp

sudo mv wlan0.cfg.tmp /etc/network/interfaces.d/wlan0.cfg

After that, disconnect the ethernet cable, reboot the machine (e.g. via sudo reboot), and you're dandy.

NB: If you prefer static IP instead of relying on DHCP (e.g. for port mapping purposes...):

#!/usr/bin/env bash

sudo apt -y install wpasupplicant

echo "allow-hotplug wlan0" > wlan0.cfg.tmp
echo "iface wlan0 inet static" >> wlan0.cfg.tmp
echo '    address 192.168.1.151' >> wlan0.cfg.tmp
echo '    netmask 255.255.255.0' >> wlan0.cfg.tmp
echo '    gateway 192.168.1.100' >> wlan0.cfg.tmp

#because my router is rubbish and doesn't provide DNS service
echo '    dns-nameservers 8.8.8.8' >> wlan0.cfg.tmp

echo '    wpa_ssid "YOUR_WIFI_SSID"' >> wlan0.cfg.tmp
echo '    wpa_psk "YOUR_WIFI_PASSWORD"' >> wlan0.cfg.tmp
echo "" >> wlan0.cfg.tmp

sudo mv wlan0.cfg.tmp /etc/network/interfaces.d/wlan0.cfg


installation of unity-webapps-preview 12.04 not possible I tried to install unity-webapps-preview on  the long term support version of ubuntu 12.04 64bit.

I used this HOWTO

But every time I try, this happens:

tom@Tom-Laptop:~/Downloads$ sudo apt-get install  unity-webapps-preview
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Statusinformationen werden eingelesen... Fertig
Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dass
Sie eine unmögliche Situation angefordert haben oder, wenn Sie die
Unstable-Distribution verwenden, dass einige erforderliche Pakete noch
nicht erstellt wurden oder Incoming noch nicht verlassen haben.
Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:

Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 unity-webapps-preview : Hängt ab von: xul-ext-unity soll aber nicht installiert werden
                         Hängt ab von: xul-ext-websites-integration soll aber nicht installiert werden
                         Hängt ab von: xul-ext-webaccounts soll aber nicht installiert werden
E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.

Translation:

tom @ tom-laptop: ~ / Downloads $ sudo apt-get install unity-webapps-preview
Reading package lists ... ready
Dependency tree
Status information is read ... ready
Some packages could not be installed. This may mean that
You have requested an impossible situation or if you are
Unstable distribution use that some required packages have
not have been created or have have not been moved from incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
unity-webapps-preview: Depends: xul-ext-unity will not be installed
Depends on: xul-ext-websites-integration will not be installed
Depends on: xul-ext-web accounts will not be installed
E: Problems can not be corrected, you have held broken packages back.

and when i try to install those needed packages (xul-ext-unity, xul ext websites integration, xule xt webaccounts)  I get this:

Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 xul-ext-unity : Beschädigt: firefox (>= 15.+) aber 17.0~b2+build1-0ubuntu0.12.04.1~mfn2 soll installiert werden
 xul-ext-webaccounts : Beschädigt: firefox (>= 14.+) aber 17.0~b2+build1-0ubuntu0.12.04.1~mfn2 soll installiert werden
 xul-ext-websites-integration : Beschädigt: firefox (>= 15.+) aber 17.0~b2+build1-0ubuntu0.12.04.1~mfn2 soll installiert werden
E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.

Translation:

The following packages have unmet dependencies:
  xul-ext-unity: Damaged: firefox (> = 15 +) but 17.0~b2+build1-0ubuntu0.12.04.1~mfn2 will be installed
  xul-ext-web accounts: Damaged: firefox (> = 14 +) but 17.0 will 17.0~b2+build1-0ubuntu0.12.04.1~mfn2 be installed
  xul-ext-websites-integration: Damaged: firefox (> = 15 +) but 17.0~b2+build1-0ubuntu0.12.04.1~mfn2 will be installed
 E: Problems can not be corrected, you have held broken packages back.

(Firefox 17 is installed, though)

EDIT:
Thanks for that extremely quick answer, but unfortunately it helped nothing. Same error still.

PS: I even tried sudo apt-get install -f -m unity-webapps-preview

Open up your terminal and do this :

sudo apt-get update
sudo apt-get install -f
sudo apt-get dist-upgrade

among those 1 is for updating cache and 2 is for fixing broken packages and 3 is to deal with held packages .

hope that helps .

thank you .


How do I preserve the recovery paritition for the notebook eMachines e442 while installing Ubuntu? So as wrote in the Q, here my problem:
I want to install Ubuntu (11.10) on my notebook. On the hard drive I have a 14Gb partition for recovery (with the factory image). I need to preserve it at any cost because this notebook comes without any cd/dvd for recovery. Could you tell me a safe way to install my beloved uby?

During the installation process on the Live CD you will be presented with a menu to choose how you want to install (Alongside Windows, erase the drive and Install Ubuntu, or Something Else). Choose Something Else and you will be presented with a list of partitions. Delete the Windows partitions, but leave the 14GB recovery partition. From there, select New Partition, Choose an EXT4 file system, check the format option, and mount it to /. Afterwards, simply install. It should leave your recovery partition in tact and install Ubuntu in another partition.

probably this is not the answer you are looking for but in my experience i can give you an advice: erase and start from 0.

In a nutshell the recovery partition is composed by:

your operative system
drivers
junk ( spyware, useless software, more useless trials )

From this list the only things that can gain your attention are the OS, that you can easily install from other source, the only thing that matters is the fact that your license is connected to that specific OEM edition of that OS, i.e. "Windows XP professional OEM", and also your license is rapresented by your sticker and not by your recovery partition or cd, or dvd, or whatever else; the drivers are usually outdated and is always better to download them from the internet at the moment you decide to make a new installation.

I had different laptops and netbooks and i can give you this advice without expecting any points against. Also consider that is really easy to boot from USB any modern OS, and you only need a 4Gb usb dongle to do that for everyone of them ( only the Microsoft's OS requires 4Gb, a GNU/linux distro usually requires 1Gb )


How do I enable dual boot after Windows 7 Reinstall with no cd? I downloaded and installed Ubuntu via the internet. No CD was involved. After I reinstalled Win 7 due to issues with it, my dual boot disappeared.  I do not have the option of using Live CD or whatever.  My system does not have an optical drive and my current situation prevents me from getting one (deployed military)  How can I fix Ubuntu?

When you reinstalled Windows, it took over your MBR with it's own boot loader.  Your Ubuntu is still fine you just need to restore GRUB so you can dual boot.  You want to use a tool called boot-repair.

EDIT:

With no optical drive, your best bet is to boot a live distro via USB.  For this, download an Ubuntu iso and then flash it to the USB as a bootable image using Unetbootin.  This is my preference when rescuing systems using a "live CD."  It allows you to get the same effect using a disc or requiring an optical drive.

If you can boot from USB, your answer is there

If your machine has room for more than one HD, and you can borrow one for some time, you can set up the temp HD as primary, install Ubuntu on it and fix the MBR from there. Hello screwdriver, hello headheache, but in the end it will be fine.


How to install Ubuntu in my pc when i don't have enough space in C:\ drive? I want to install ubuntu alongside Windows 10 (which is already installed in my pc) in my pc, i was trying to shrink volume of C:\ drive by disk management but my C:\ drive don't have enough space . Will it work if i shrink my D:\ or E:\ drive in stead of C:\?

I also tried using USB drive by downloading unetbootin but found no result.

Please give a detailed explanation if possible.

You can use the utility gparted within a live USB or CD install to resize your disk offline. It should come preinstalled however if it is not you can run 'sudo apt-get install gparted' to install it.

I happen to find the 'Universal USB Installer' the easiest to use on Windows whenever I try to make a bootable USB key.

Yes, shrinking the D or E drive can work. Look at this video.

For USB bootable OS, do this :

Download ISO file of ubuntu (any version)
Download Universal USB Installer (UUI) from here
Connect your USB drive and run UUI and follow the process.
After 10-20 minutes it will create a bootable USB.
Restart your system and boot from the USB drive.
Install it and enjoy Ubuntu on your system.


How to remove GNOME classic session and associated packages? Ok have been testing unity and I love it. And I have heard that unity-2d will be fallback session from 11.10. I would like to make 11.04 the same without breaking the functionality of unity.

So I would Like to know how can I get just ubuntu(.i.e. Unity) and unity-2d as session choice in 11.04 and completely remove gnome classic desktop session choice(If Possible) ?? What packages shall I purge for this without hindering my desktop experience ??

By the way I have already installed unity-2d and its quite nice as well.

Those packages don't add much overhead to your system, perhaps 50MB total. Relax, enjoy Unity, the rest will drop away in 11.10!

sudo apt-get remove gnome-session-fallback in terminal should help you remove the Gnome classic environment in 11.10 in 11.04 you already have a classic session


How to install libQtGui.so.4 32bit on 64bit ubuntu I am trying to compile the android tree on Ubuntu 64bit 12.04; The build fails on an error of missing shared library libQtGui.so.4;

Check /usr/ lib files i found that: /usr/lib/ or /usr/lib32 doesn't have Qt. /usr/lib/x86_64_xxxxx/libQutGui.so.4 does exist.

The package is already installed; however, i believe the installed version is 64bit while the build requires i386 (32bit) version;

how can i install the i386 version of libQt?

I had the same problem when I ran 32-bit software on a 64-bit system.
ldd xxx
libQtGui.so.4 => not found
libQtCore.so.4 => not found

Then I installed libqtgui4:i386 .
apt-get install libqtgui4:i386
ldd xxx
libQtGui.so.4 => /usr/lib/i386-linux-gnu/libQtGui.so.4 (0xf67e3000)
libQtCore.so.4 => /usr/lib/i386-linux-gnu/libQtCore.so.4 (0xf64dc000)

https://www.slsknet.org/news/node/482

This is it:

apt-get purge qt5-default -y
apt-get purge qt5-qmake -y
apt-get purge qtbase5-dev-tools -y
apt-get purge qttools5-dev-tools -y
apt-get install gcc-4.9 -y
apt-get install qt5-default -y
apt-get install qt5-qmake -y
apt-get install qtbase5-dev-tools -y
apt-get install qttools5-dev-tools -y


How to run cvlc closing after the play Is there any parameter to run cvlc from a terminal command line in a way that the dummy interface returns control after an mp3 file is played?

Currently I run this: me@ubuntu:~/Documents$ cvlc 732533130.mp3 and I can't type again after the file has been played, to take control I have to type ^C.

Running on Ubuntu 12.04.5 LTS (Precise Pangolin).

There are two ways you can instruct VLC to quit playback after the playlist is played fully:

By supplying the --play-and-exit CLI option, e.g.:

cvlc --play-and-exit audio1.mp3 audio2.mp3

or

vlc --play-and-exit audio1.mp3 audio2.mp3

or creating a bash alias (in ~/.bashrc):

alias cvlc='cvlc --play-and-exit'

By adding the dummy item vlc://quit to your playlist, e.g.:

cvlc audio1.mp3 audio2.mp3 vlc://quit

or

vlc audio1.mp3 audio2.mp3 vlc://quit

Source: https://stackoverflow.com/q/10249261/1708932

you can always take control by suffixing an & at the end of the command. the command will launch and you will also have control on the terminal.

try

cvlc 732533130.mp3 &


How to restore default Unity I was messing around with Compiz Settings Manager and result of that is that I cant see my panel bar, cant use alt+tab or start button. Is there a way to restore default Ubuntu environment? I will be grateful for your help

In terminal, type in sudo apt-get install --reinstall ubuntu-desktop to completely reinstall back to defaults.

To remove all compiz settings type rm  -rf ~/.compiz-1 ~/.config/compiz-1 in terminal, then logout and back in.

Try the following, open terminal and type:

unity-reset

Alternatively:

setsid unity

But, If you can't get to the terminal cause your start buttons doesn't work you can always (this only works if you have a folder on the desktop) open the folder then go to 'computer>usr>share>applications' look for terminal inside the folder and click to open, then enter either of the above commands in the terminal.


Why won't chmod +s allow me to do stuff in root's stead? I have a very specific command I'd like anyone to be able to run. For the sake of example, let's pretend the command is ip addr flush dev foo0.

I found this and this. Unless I'm misunderstanding something, I think it's exactly what I need.

echo "ip addr flush dev vboxnet0" > script.sh
chmod +x script.sh

chmod +s script.sh
sudo chown root script.sh
sudo chgrp root script.sh

But then,

./script.sh
Failed to send flush request: Operation not permitted

Why?

I came across this situation some weeks back and found this in the course of my research.  Perhaps it will help you as well.

https://superuser.com/a/636800