기본 콘텐츠로 건너뛰기

error lsb_release

Step 1 : Learning that the package for lsb_release is lsb-release
root@vm1:/usr/bin# apt-get autoremove lsb_release
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package lsb_release
root@vm1:/usr/bin# apt-get install lsb_release
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package lsb_release

Step 2 : removing and installing lsb_release
root@vm1:/usr/bin# apt-get autoremove lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
lsb-release python-central
0 upgraded, 0 newly installed, 2 to remove and 27 not upgraded.
After this operation, 487 kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 99295 files and directories currently installed.)
Removing lsb-release ...
Removing python-central ...
Processing triggers for man-db ...
root@vm1:/usr/bin# apt-get install lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
python-central
Suggested packages:
lsb
The following NEW packages will be installed:
lsb-release python-central
0 upgraded, 2 newly installed, 0 to remove and 27 not upgraded.
Need to get 0 B/52.2 kB of archives.
After this operation, 487 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Selecting previously deselected package python-central.
(Reading database ... 99260 files and directories currently installed.)
Unpacking python-central (from .../python-central_0.6.15ubuntu5_all.deb) ...
Selecting previously deselected package lsb-release.
Unpacking lsb-release (from .../lsb-release_4.0-0ubuntu11_all.deb) ...
Processing triggers for man-db ...
Setting up python-central (0.6.15ubuntu5) ...
Setting up lsb-release (4.0-0ubuntu11) ...
Processing triggers for python-central ...

Step 3 : Learning that it still doesn't work
root@vm1:/usr/bin# /usr/bin/lsb_release
Traceback (most recent call last):
File "/usr/bin/lsb_release", line 26, in
import lsb_release
ImportError: No module named lsb_release

Step 4 : attempting to install with fake lsb_release
root@vm1:/usr/bin# apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
(snip)
Setting up lib32ncursesw5 (5.7+20101128-1) ...
Setting up ia32-libs (20090808ubuntu13) ...
No LSB modules are available.
[: 11: Distributor: unexpected operator
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Hard coded lsb_release :
root@vm1:/usr/bin# cat /usr/bin/lsb_release.new
#!/usr/bin/python

# lsb_release command for Debian
# (C) 2005-08 Chris Lawrence

# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.

# This package is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this package; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

from optparse import OptionParser
import sys
import commands
import os
import re

# import lsb_release

def main():
parser = OptionParser()
parser.add_option('-v', '--version', dest='version', action='store_true',
default=False,
help="show LSB modules this system supports")
parser.add_option('-i', '--id', dest='id', action='store_true',
default=False,
help="show distributor ID")
parser.add_option('-d', '--description', dest='description',
default=False, action='store_true',
help="show description of this distribution")
parser.add_option('-r', '--release', dest='release',
default=False, action='store_true',
help="show release number of this distribution")
parser.add_option('-c', '--codename', dest='codename',
default=False, action='store_true',
help="show code name of this distribution")
parser.add_option('-a', '--all', dest='all',
default=False, action='store_true',
help="show all of the above information")
parser.add_option('-s', '--short', dest='short',
action='store_true', default=False,
help="show requested information in short format")

(options, args) = parser.parse_args()
if args:
parser.error("No arguments are permitted")

short = (options.short)
none = not (options.all or options.version or options.id or
options.description or options.codename or options.release)

print >> sys.stderr, "No LSB modules are available."

if options.id or options.all:
print 'Distributor ID: Ubuntu'

if options.description or options.all:
print 'Description: Ubuntu 11.04'

if options.release or options.all:
print 'Release: 11.04'

if options.codename or options.all:
print 'Codename: natty'

if __name__ == '__main__':
main()

댓글

이 블로그의 인기 게시물

dmesg 메시지 실시간으로 보기

참조사이트 http://imitator.kr/Linux/556 # tail -f /var/log/messages # tail -f |dmesg //기본 2초 단위로 갱신 된다. # watch "dmesg | tail -f" //1초 단위로 갱신하면서 보여준다. # watch -n 1 "dmesg | tail -f" // 보여주는 줄을 20으로 늘린다. (기본 10줄) # watch -n 1 "dmesg | tail -f -n 20"

java 특정 디렉토리에 있는 파일 목록을 읽어내기, 정렬해서 가져오기

폴더 리스트 가져오기 String path="C:\"; File dirFile=new File(path); File []fileList=dirFile.listFiles(); for(File tempFile : fileList) {   if(tempFile.isFile()) {     String tempPath=tempFile.getParent();     String tempFileName=tempFile.getName();     System.out.println("Path="+tempPath);     System.out.println("FileName="+tempFileName);     /*** Do something withd tempPath and temp FileName ^^; ***/   } } 정렬해서 가져오기 import java.io.FileFilter; import java.io.IOException; import java.util.Arrays; import java.util.Date; import org.apache.commons.io.comparator.LastModifiedFileComparator; import org.apache.commons.io.filefilter.FileFileFilter; public class LastModifiedFileComparatorTest { public static void main(String[] args) throws IOException { File directory = new File("."); // get just files, not directories File[] files = directory.listFiles((FileFilter) FileFileFilter.FILE); System.out.println("Defaul...