DON'T PANIC

Archive for the ‘Debian’ Category

Where service_name is the name of the service that I want it starts at boot time or take it off..

To start at boot time

#update-rc.d service_name defaults

To remove it from boot

#update-rc.d -f service_name defaults

Advertisements

Today, I was installing my both lovers: Debian and Archlinux 🙂 on my laptop. After finishing the installation process, I rebooted and.. Grub gave me its famous error: "» [SOLVED] Grub Error 15: File Not Found" arrrrggg… so
Troubleshooting time!.. The thing is:

I have the following partitions in just one disk:
* 2 volume groups: vg_debian and vg_archlinux.
* 2 boot partitions: /dev/sda1 and /dev/sda4.

1. Rebooting operating system with a rescue cd.

2. Installing lvm in case it is not installed on the rescue cd.

3. Logical volumes should now be located in /dev/mapper If you cannot find them, use the next commands to bring up the module for creating device nodes and to make volume groups available:

# modprobe dm-mod
# vgscan
# vgchange -ay

4. Listing grub configuration on /boot/grub/menu.lst

cat /boot/grub/menu.lst
....
title Debian GNU/Linux
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-5-amd64 root=/dev/mapper/vg_debian-lv_raiz ro
initrd /boot/initrd.img-2.6.32-5-amd64

title Archlinux
root (hd0,3)
kernel /vmlinuz-linux root=/dev/mapper/vg_archlinux-lv_raiz ro
initrd /initramfs-linux.img
...

So.. what was the error??.. replace /boot/ y /, if not Grub find kernel on /boot/boot/ and.. of course it doesn’t exist!

5. After modification, save file, reboot and.. taraaaa!!! it works!

Badblocks: is used to search for bad blocks on a device. 🙂
Assuming the faulty disk is: /dev/sdb1


# badblocks -o output_bad_blocks /dev/sdb1

If the disk is healthy, the output_bad_blocks file will be clean. If not, it will have a list of bad blocks. Which is very useful, because you can pass that file as parameter on mkfs tool to say it wont use it on time of creating filesystem 😉

update-alternatives

There are many classes of applications which have many programs that can be used, Debian allows you to choose which particular alternative you wish to be used, globally. This covers a set of programs such as: text-editor, web-browser, windows-manager, x-session-manager, etc.

The way it works is to have a set of standard command names such as editor, www-browser, and view. Each of those commands are merely symobilic links to the real command.

For example assume you have both the vim and emacs21 packages installed. To handle this a program that wishes to allow you to edit a file merely runs:


/usr/bin/editor

This is a symbolic link which links to:

/etc/alternatives/editor

This in turn links to the real editor, either vim or emacs in our example.

So, to set you preferred text-editor, you could update the symbolic links by hand, but the preferred approach is to run:


$update-alternatives --set editor /usr/bin/emacs21

To list which are the options you have:

$update-alternatives --list editor
/usr/bin/vim
/usr/bin/emacs21

You can set other applications, replacing editor by: x-www-browser, x-session-manager, etc.

Apt-pinning

Apt-pinning is one method for allowing packages from different Debian releases to co-exist on the same system.

To use Debian packages on a default release system (stable or testing or unstable or experimental) you should create /etc/apt/apt.conf and set the default release to track:


[root@enterprise ~]# echo "APT::Default-Release "stable";" > /etc/apt/apt.conf

Or you can create /etc/apt/preferences and pin the priority of the different releases:

[root@enterprise ~]# touch /etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release a=testing
Pin-Priority: 90

1. Install packages
# apt-get update & apt-get install git;

2. Clone a existing repository.
2.1 In that case, I will clone WINE 🙂 so, as regular user execute following commands:
taking into account have the necessary permissions on the path where you can close the repository
$ cd /srv/
$ git clone git://source.winehq.org/git/wine.git ~/wine-git
Cloning into /home/bcls/wine-git...
remote: Counting objects: 616281, done.
remote: Compressing objects: 100% (103345/103345), done.
Receiving objects: 100% (616281/616281), 115.02 MiB | 190 KiB/s, done.
Resolving deltas: 100% (511493/511493), done

2.2 Create a file, then adding to Git’s control.
bcls@eulogia:/srv/wine-git$ vi compile_wine

2.3 Following commands indicates that Git doesn’t know about lats file added
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# compile_wine
nothing added to commit but untracked files present (use "git add" to track)

2.4 Adding last file to Git’s control and check its status
bcls@eulogia:/srv/wine-git$ git add compile_wine
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# new file: compile_wine
#
bcls@eulogia:/srv/wine-git$ git commit
[master 0bb324e] Agrego script de compilacion de wine
Committer: bcls
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 files changed, 27 insertions(+), 0 deletions(-)
create mode 100755 compile_wine
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
bcls@eulogia:/srv/wine-git$ git list
git: 'list' is not a git command. See 'git --help'.

Did you mean one of these?
bisect
rev-list

2.5 Creating a separated branch under the original repository
bcls@eulogia:/srv/wine-git$ git branch
* master

2.6 Taking a look to logs from the last created branch
bcls@eulogia:/srv/wine-git$ git log
commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966
Author: bcls
Date: Fri Sep 30 18:27:02 2011 -0300

Agrego script de compilacion de wine

commit fdda702acd1a9ace6925845ec50edcf5e1023c79
Author: Andrew Eikum
Date: Wed Sep 28 13:32:03 2011 -0500

wineoss.drv: Use a temporary OSS device to check format support.

...............
...............

2.7 Creating a new branch
bcls@eulogia:/srv/wine-git$ git branch test

List all branches inside the repository
bcls@eulogia:/srv/wine-git$ git branch
* master
test

Got to last branch inside the original repository
bcls@eulogia:/srv/wine-git$ git checkout test
Switched to branch 'test'

Following command check in wich branch I am
bcls@eulogia:/srv/wine-git$ git branch
master
* test

2.8 List all branches: remote and local
bcls@eulogia:/srv/wine-git$ git branch -a
master
* test
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/stable

2.9 Removing last branch created and check it

bcls@eulogia:/srv/wine-git$ git branch -D test
Deleted branch test (was 0e72807).
bcls@eulogia:/srv/wine-git$ git branch
* master
bcls@eulogia:/srv/wine-git$ git log
commit 0e7280782eeefff079aaf633f39ff9000032ab53
Author: bcls
Date: Fri Sep 30 18:43:38 2011 -0300

Agrego archivo para probar funcionamiento de git en dif. branches

commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966
Author: bcls
Date: Fri Sep 30 18:27:02 2011 -0300

Agrego script de compilacion de wine

2.10 Revert last file created on previuos existing test branch, now this branch doesn’t exist anymore, but its content is part of master branch.

bcls@eulogia:/srv/wine-git$ git revert -s 0bb324e791c7ba941cef5d3d129f56a8a4a36966
[master f2998b7] Revert "Agrego script de compilacion de wine"
Committer: bcls
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 files changed, 0 insertions(+), 27 deletions(-)
delete mode 100755 compile_wine
bcls@eulogia:/srv/wine-git$ git log
commit f2998b78a818284566e0606f5bd25a991e757aa1
Author: bcls
Date: Fri Sep 30 18:53:40 2011 -0300

Revert "Agrego script de compilacion de wine"

This reverts commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966.

Signed-off-by: bcls

commit 0e7280782eeefff079aaf633f39ff9000032ab53
Author: bcls
Date: Fri Sep 30 18:43:38 2011 -0300

Agrego archivo para probar funcionamiento de git en dif. branches

commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966
Author: bcls
Date: Fri Sep 30 18:27:02 2011 -0300

Agrego script de compilacion de wine

commit fdda702acd1a9ace6925845ec50edcf5e1023c79
Author: Andrew Eikum
Date: Wed Sep 28 13:32:03 2011 -0500

bcls@eulogia:/srv/wine-git$ ls archivo
archivo
bcls@eulogia:/srv/wine-git$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
nothing to commit (working directory clean)
bcls@eulogia:/srv/wine-git$ git --help revert
bcls@eulogia:/srv/wine-git$ git branch
* master

After doing that compile_wine file doesn’t exist anymore.

bcls@eulogia:/srv/wine-git$ git revert f2998b78a818284566e0606f5bd25a991e757aa1
[master d4c8a1b] Revert “Revert “Agrego script de compilacion de wine””
Committer: bcls
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config –global user.name “Your Name”
git config –global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit –amend –reset-author

1 files changed, 27 insertions(+), 0 deletions(-)
create mode 100755 compile_wine

bcls@eulogia:/srv/wine-git$ git log
commit d4c8a1b2115b04eac56df70076638fe58326181b
Author: bcls
Date: Fri Sep 30 18:56:43 2011 -0300

Revert “Revert “Agrego script de compilacion de wine””

This reverts commit f2998b78a818284566e0606f5bd25a991e757aa1.

commit f2998b78a818284566e0606f5bd25a991e757aa1
Author: bcls
Date: Fri Sep 30 18:53:40 2011 -0300

Revert “Agrego script de compilacion de wine”

This reverts commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966.

Signed-off-by: bcls

commit 0e7280782eeefff079aaf633f39ff9000032ab53
Author: bcls
Date: Fri Sep 30 18:43:38 2011 -0300

Agrego archivo para probar funcionamiento de git en dif. branches

commit 0bb324e791c7ba941cef5d3d129f56a8a4a36966

3. Create an initial repository
3.1 Create repository’s directory

bcls@eulogia:/srv/repositorios$ mkdir debian-packaging

3.2 Convert debian-packaging directory in a repository

bcls@eulogia:/srv/repositorios$ git init debian-packaging/
Initialized empty Git repository in /srv/repositorios/debian-packaging/.git/
bcls@eulogia:/srv/repositorios$ git status
fatal: Not a git repository (or any of the parent directories): .git
bcls@eulogia:/srv/repositorios$ cd debian-packaging/
bcls@eulogia:/srv/repositorios/debian-packaging$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)

Taking into account that ones a file is added you already can see the branch: “Master”

bcls@eulogia:/srv/repositorios/debian-packaging$ git branch
bcls@eulogia:/srv/repositorios/debian-packaging$ touch file
bcls@eulogia:/srv/repositorios/debian-packaging$ git add file
bcls@eulogia:/srv/repositorios/debian-packaging$ git commit file
bcls@eulogia:/srv/repositorios/debian-packaging$ git status
# On branch master
nothing to commit (working directory clean)
bcls@eulogia:/srv/repositorios/debian-packaging$ git branch
* master


# alsa force-reload



  • analialorenzatto: Buzz is just a host name for this example, it doesn't have any relation to the topic. Instead of being "Buzz", could be whatever name.
  • fridelain: >buzz What's the story behind this host name? Actully running buzz, once running buzz and upgraded many times since, or unrelated to debian naming
  • Pratik: Nice, but I would change it to include more directories. Like my .mozilla and .kde4 by using .{config,mozilla,kde4} instead of just .config .

Categories