기본 콘텐츠로 건너뛰기

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()

댓글

이 블로그의 인기 게시물

[Java] Http File Download 이어받기

Http 서버로부터 다운로드 받는 파일을 이어받기 위해서는 Http Header에 아래 두가지 정보를 추가해 주면 된다. URLConnection conn = url.openConnection(); conn.setRequestProperty("Accept-Ranges", "bytes"); conn.setRequestProperty("Range", "bytes=" + mOffset + "-"); 그러면 서버에서는 해당 Offset으로부터 File을 다운로드 시켜준다. 클라이언트가 요청헤더에 Range 필드를 포함 시켜서 보내면, 서버는 그 정보를 가지고 어디서 부터 파일을 보낼지 판단을 합니다. 하지만 클라이언트가(브라우저) Range 필드를 포함 시켜야 할지를 판단하는 기준은 최초 다운로드 요청시 서버의 응답헤더에 따라 다음 요청헤더에 Range 헤더를 생성할지 않할지 판단하게 됩니다. 그걸 당락짓는 응답 헤더 필드는 다음과 같습니다. Accept-Ranges , ETag, Last-Modified 반드시 위 필드를 응답 헤더에 같이 보내줘야 클라이언트는 다음 요청시 Range헤더를 포함시켜 보내게 됩니다. 참고로 말씀 드리면 위 필드를 포함 시켜서 보내더라도 value는 반드시 " " 로 묶어서 보내야 합니다. 안그러면 브라우저는 죽어도 Range 필드를 생성시키지 않습니다. HTTP 1.1 스펙은 따옴표를 강제적으로 해줘라 이런 내용 없습니다. 자바기준 40byte의 파일이라치면 클리이언트 요청을 두번으로 나누었다치면 이케 connection.setRequestProperty("Range", "bytes=0-20"); connection.setRequestProperty("Range", "bytes=20-40"); 단 co...

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...